{"id":665,"date":"2025-05-12T22:06:01","date_gmt":"2025-05-12T20:06:01","guid":{"rendered":"https:\/\/renor.it\/from-zero-to-packagist-publishing-a-php-library-on-composer\/"},"modified":"2025-12-20T15:53:58","modified_gmt":"2025-12-20T14:53:58","slug":"from-zero-to-packagist-publishing-a-php-library-on-composer","status":"publish","type":"post","link":"https:\/\/renor.it\/en\/blog\/sviluppo-software-programmazione\/from-zero-to-packagist-publishing-a-php-library-on-composer\/","title":{"rendered":"From Zero to Packagist: Publishing a PHP Library on Composer"},"content":{"rendered":"\n<p>Publishing a Composer package means making your code installable with a simple CLI command.<\/p>\n\n<p><code>composer require vendor\/package<\/code><\/p>\n\n<p>and keeping updates, versions, and dependencies under control.<br\/>To follow the guide, we need:  <\/p>\n\n<ul class=\"wp-block-list\">\n<li>Git version 2.0 or higher installed and configured<\/li>\n\n\n\n<li>A GitHub account and a token with repo permission<\/li>\n\n\n\n<li>Composer version 2.5 or higher installed <code>$PATH<\/code><\/li>\n\n\n\n<li>A free account on Packagist.org (registered via GitHub using OAuth)<\/li>\n<\/ul>\n\n<p>Referring back to the article where we explored how to develop a <a href=\"https:\/\/renor.it\/a-descriptive-statistics-class-in-php\/?lang=en\" data-type=\"link\" data-id=\"https:\/\/renor.it\/una-classe-di-statistica-descrittiva-in-php\/\">descriptive statistics library<\/a>, the repository structure was as follows:<\/p>\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#1E1E1E\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewbox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"descriptive-statistics-php\/ \u251c\u2500 composer.json \u251c\u2500 composer.lock \u251c\u2500 phpunit.xml \u251c\u2500 examples\/ \u2502 \u2514\u2500 geometric_mean_demo.php \u2502 \u2514\u2500 harmonic_mean_demo.php \u2502 \u2514\u2500 iqr_demo.php \u2502 \u2514\u2500 mad_demo.php \u2502 \u2514\u2500 mean_demo.php \u2502 \u2514\u2500 median_demo.php \u2502 \u2514\u2500 min_max_demo.php \u2502 \u2514\u2500 mode_demo.php \u2502 \u2514\u2500 percentile_demo.php \u2502 \u2514\u2500 range_demo.php \u2502 \u2514\u2500 standard_deviation_demo.php \u2502 \u2514\u2500 trimmed_mean_demo.php \u2502 \u2514\u2500 variance_demo.php \u251c\u2500 src\/ \u2502 \u2514\u2500 DescriptiveStats.php \u251c\u2500 tests\/ \u2502 \u2514\u2500 DescriptiveStatsTest.php \u2514\u2500 vendor\/ \u2514\u2500 autoload.php\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewbox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D4D4D4\">descriptive-statistics-php\/<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">\u251c\u2500 composer<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #D4D4D4\">json<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">\u251c\u2500 composer<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #D4D4D4\">lock<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">\u251c\u2500 phpunit<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #D4D4D4\">xml<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">\u251c\u2500 examples\/<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">\u2502  \u2514\u2500 geometric_mean_demo<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #D4D4D4\">php<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">\u2502  \u2514\u2500 harmonic_mean_demo<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #D4D4D4\">php<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">\u2502  \u2514\u2500 iqr_demo<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #D4D4D4\">php<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">\u2502  \u2514\u2500 mad_demo<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #D4D4D4\">php<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">\u2502  \u2514\u2500 mean_demo<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #D4D4D4\">php<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">\u2502  \u2514\u2500 median_demo<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #D4D4D4\">php<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">\u2502  \u2514\u2500 min_max_demo<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #D4D4D4\">php<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">\u2502  \u2514\u2500 mode_demo<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #D4D4D4\">php<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">\u2502  \u2514\u2500 percentile_demo<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #D4D4D4\">php<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">\u2502  \u2514\u2500 range_demo<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #D4D4D4\">php<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">\u2502  \u2514\u2500 standard_deviation_demo<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #D4D4D4\">php<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">\u2502  \u2514\u2500 trimmed_mean_demo<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #D4D4D4\">php<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">\u2502  \u2514\u2500 variance_demo<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #D4D4D4\">php<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">\u251c\u2500 src\/<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">\u2502  \u2514\u2500 DescriptiveStats<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #D4D4D4\">php<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">\u251c\u2500 tests\/<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">\u2502  \u2514\u2500 DescriptiveStatsTest<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #D4D4D4\">php<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">\u2514\u2500 vendor\/<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    \u2514\u2500 autoload<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #D4D4D4\">php<\/span><\/span><\/code><\/pre><\/div>\n\n<p>In the terminal, inside the project folder, we type the command: <\/p>\n\n<p><code>composer init<\/code><\/p>\n\n<p>Composer will ask us for some information, starting with the package name, which is expressed as vendor\/package-name. In my case, since my account is named \u201cthesimon82\u201d, the package name will be <code>thesimon82\/descriptive-statistics<\/code>. We confirm by pressing Enter.  <\/p>\n\n<p>Now we are asked for the description\u2014<br\/>for this project, we\u2019ll enter: <code>Lightweight PHP class for descriptive statistics<\/code>.<\/p>\n\n<p>Next is the author field: if we\u2019ve already configured it previously, Composer will show a default author; otherwise, we enter our name and surname manually. <\/p>\n\n<p>Minimum stability: if it\u2019s a stable release, we enter \u201cstable\u201d.<\/p>\n\n<p>For Package Type, we enter: \u201clibrary\u201d.<\/p>\n\n<p>In license: MIT<\/p>\n\n<p>We are then asked whether we want to add, one by one, the production packages (require) that the library needs in order to work. In this case, the class is stand-alone (it only uses native PHP functions), so we don\u2019t have any dependencies other than the minimum PHP version\u2014therefore, we can safely answer \u201cno\u201d.<br\/><br\/><br\/>If you\u2019re thinking about PHPUnit for testing the class methods, remember that PHPUnit is only used during development and testing, so it should be placed in require-dev, not in require.<br\/><br\/><br\/>This way, anyone installing the package in a production environment won\u2019t have PHPUnit among their runtime dependencies.    <\/p>\n\n<p>The next prompt, in fact, asks whether we intend to define our development dependencies interactively (require-dev). Here, we type \u201cyes\u201d, and Composer will then prompt us to enter the name of the package.<br\/><br\/><br\/>We now type:<br\/><br\/><br\/><code>phpunit\/phpunit<\/code><br\/><br\/><br\/>Composer will return a list of matching packages\u2014select phpunit\/phpunit by entering the corresponding number.<br\/><br\/><br\/>Then it will ask which version to include.<br\/>We simply press Enter to install the latest available version.    <\/p>\n\n<p>It will now ask if we want to install any additional dependency packages, but since we don\u2019t have any others, we simply press Enter. <br\/>It will now ask if we want to add a PSR-4 autoload mapping for the classes, suggesting to map the namespace Thesimon82\\DescriptiveStatistics.<br\/>However, in our project we used Renor\\\\Statistics, so we type n to skip the proposal.<\/p>\n\n<p>Finally, we obtain a summary of the entered data:<\/p>\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#1E1E1E\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewbox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"{ \"name\": \"thesimon82\/descriptive-statistics\", \"description\": \"Lightweight PHP class for descriptive statistics\", \"type\": \"library\", \"require-dev\": { \"phpunit\/phpunit\": \"^12.1\" }, \"license\": \"MIT\", \"authors\": [ { \"name\": \"Simone Renzi\", \"email\": \"info@simonerenzi.com\" } ], \"minimum-stability\": \"stable\", \"require\": {}, \"autoload\": { \"psr-4\": { \"Renor\\\\Statistics\\\\\": \"src\/\" } } } Do you confirm generation [yes]?  \" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewbox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D4D4D4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    \"name\": \"thesimon82\/descriptive-statistics\",<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    \"description\": \"Lightweight PHP class for descriptive statistics\",<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    \"type\": \"library\",<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    \"require-dev\": {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">        \"phpunit\/phpunit\": \"^12.1\"<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    },<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    \"license\": \"MIT\",<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    \"authors\": [<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">        {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">            \"name\": \"Simone Renzi\",<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">            \"email\": \"info@simonerenzi.com\"<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">        }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    ],<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    \"minimum-stability\": \"stable\",<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    \"require\": {},<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    \"autoload\": {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">        \"psr-4\": {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">            \"Renor\\\\Statistics\\\\\": \"src\/\"<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">        }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">}<\/span><\/span>\n<span class=\"line\"\/>\n<span class=\"line\"><span style=\"color: #D4D4D4\">Do you confirm generation [yes]? <\/span><\/span><\/code><\/pre><\/div>\n\n<p>Here we review the data, and if everything is correct, we confirm with \u201cyes\u201d and proceed to install the dependencies.<\/p>\n\n<p>At the end, we type the command:<\/p>\n\n<p><code>composer dump-autoload<\/code> to regenerate the class autoloader.<\/p>\n\n<p>It\u2019s time to make the commit using the following series of commands: <\/p>\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#1E1E1E\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewbox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"git add . git commit -m \"feat: first stable release\" git tag v1.0.0 git push origin main v1.0.0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewbox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D4D4D4\">git add .<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">git commit -m \"feat: first stable release\"<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">git tag v1.0.0<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">git push origin main v1.0.0<\/span><\/span><\/code><\/pre><\/div>\n\n<p>Now we move to GitHub, and we should see our repository with the latest commit\u2014<br\/>in my case: thesimon82 feat: first stable release.<\/p>\n\n<p>We copy the URL from the address bar at the top and head over to Packagist.<\/p>\n\n<p>Click on \u201cSubmit\u201d at the top, then paste the GitHub link you copied into the text field. Press the Check button.<br\/>At this point, Packagist will analyze the composer.json file and immediately display the package details.<br\/>Clicking the \u201cSubmit\u201d button at the bottom will create the package.    <\/p>\n\n<p>We\u2019re done\u2014now it\u2019s time to test if everything works correctly.<\/p>\n\n<p>Create a new folder named \u201cStats Test\u201d, then open the terminal and navigate into that folder using: <br\/>Here we type:<\/p>\n\n<p><code>composer require thesimon82\/descriptive-statistics<\/code><\/p>\n\n<p>Now import this folder into your development environment and create a new file in the root directory named: test.php.<\/p>\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#1E1E1E\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewbox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"&lt;encoded_tag_open \/&gt;?php require_once 'vendor\/autoload.php'; use Renor\\Statistics\\DescriptiveStats; $stats = new DescriptiveStats([1, 2, 3, 4, 5,6.22]); echo $stats-&lt;encoded_tag_closed \/&gt;mean();\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewbox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D4D4D4\">&lt;?php<\/span><\/span>\n<span class=\"line\"><span style=\"color: #C586C0\">require_once<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">'vendor\/autoload.php'<\/span><span style=\"color: #D4D4D4\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #569CD6\">use<\/span><span style=\"color: #D4D4D4\"> Renor\\Statistics\\<\/span><span style=\"color: #4EC9B0\">DescriptiveStats<\/span><span style=\"color: #D4D4D4\">;<\/span><\/span>\n<span class=\"line\"\/>\n<span class=\"line\"><span style=\"color: #9CDCFE\">$stats<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #569CD6\">new<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #4EC9B0\">DescriptiveStats<\/span><span style=\"color: #D4D4D4\">([<\/span><span style=\"color: #B5CEA8\">1<\/span><span style=\"color: #D4D4D4\">, <\/span><span style=\"color: #B5CEA8\">2<\/span><span style=\"color: #D4D4D4\">, <\/span><span style=\"color: #B5CEA8\">3<\/span><span style=\"color: #D4D4D4\">, <\/span><span style=\"color: #B5CEA8\">4<\/span><span style=\"color: #D4D4D4\">, <\/span><span style=\"color: #B5CEA8\">5<\/span><span style=\"color: #D4D4D4\">,<\/span><span style=\"color: #B5CEA8\">6.22<\/span><span style=\"color: #D4D4D4\">]);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">echo<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #9CDCFE\">$stats<\/span><span style=\"color: #D4D4D4\">-&gt;<\/span><span style=\"color: #DCDCAA\">mean<\/span><span style=\"color: #D4D4D4\">();<\/span><\/span><\/code><\/pre><\/div>\n\n<p>As we can see, we\u2019re including the Composer-generated autoloader, which makes all classes mapped via PSR-4 available automatically\u2014without the need for additional require statements. <\/p>\n\n<p>We define the namespace used in the DescriptiveStats class and instantiate a new object with a numeric dataset.<br\/>You\u2019ll recall that the class constructor automatically filters out non-numeric values, reindexes the array keys, and throws an exception if the resulting dataset is empty.<br\/><br\/><br\/>Then, the method <code>mean()<\/code>is called, which computes the mean and displays it on the screen.   <\/p>\n\n<p>If you now run the command: <code>php test.php<\/code> from the terminal, and if everything was done correctly, you should see the result: <br\/>3.5366666666667,<br\/>which is precisely the approximate mean of the values we passed to the class constructor. <\/p>\n\n<h2 class=\"wp-block-heading\">Conclusions<\/h2>\n\n<p>We\u2019ve seen how to transform a simple PHP class into a Composer package distributed on Packagist.<br\/>Now the library can be installed with a single command, benefits from semantic versioning, continuous integration, and automation that updates the Packagist listing automatically with every new tag.  <\/p>\n\n<p>From this point on, the lifecycle is straightforward:<br\/>you implement a feature, run the tests, increment the version, create the tag, and push it to GitHub.<br\/>Packagist and Composer will take care of the rest! <\/p>\n\n<p>[starbox]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Publishing a Composer package means making your code installable with a simple CLI command. composer require vendor\/package and keeping updates, versions, and dependencies under control.To follow the guide, we need: Referring back to the article where we explored how to develop a descriptive statistics library, the repository structure was as follows: In the terminal, inside [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":493,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_writerflow_disable_suggestions":false,"footnotes":""},"categories":[1977],"tags":[1396,1397,1398,1352,1367,1399,1400,1391,1401,1402,1403,1404,1405],"class_list":["post-665","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-sviluppo-software-programmazione","tag-ci-cd-en","tag-composer-en","tag-dependency-management-en","tag-github-en","tag-open-source-en","tag-package-publishing-en","tag-packagist-en","tag-php-en","tag-php-library-en","tag-phpunit-en","tag-psr-4-en","tag-release-workflow-en","tag-semantic-versioning-en"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.4 (Yoast SEO v27.6) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>From Zero to Packagist: Publishing a PHP Library on Composer | RENOR &amp; Partners S.r.l.<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/renor.it\/en\/blog\/sviluppo-software-programmazione\/from-zero-to-packagist-publishing-a-php-library-on-composer\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"From Zero to Packagist: Publishing a PHP Library on Composer\" \/>\n<meta property=\"og:description\" content=\"Publishing a Composer package means making your code installable with a simple CLI command. composer require vendor\/package and keeping updates, versions, and dependencies under control.To follow the guide, we need: Referring back to the article where we explored how to develop a descriptive statistics library, the repository structure was as follows: In the terminal, inside [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/renor.it\/en\/blog\/sviluppo-software-programmazione\/from-zero-to-packagist-publishing-a-php-library-on-composer\/\" \/>\n<meta property=\"og:site_name\" content=\"RENOR &amp; Partners S.r.l.\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/renorsrl\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/simone.renzi.3954\/\" \/>\n<meta property=\"article:published_time\" content=\"2025-05-12T20:06:01+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-12-20T14:53:58+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/renor.it\/wp-content\/uploads\/2025\/05\/packagist.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1536\" \/>\n\t<meta property=\"og:image:height\" content=\"1024\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"Simone Renzi\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Simone Renzi\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/renor.it\\\/en\\\/blog\\\/sviluppo-software-programmazione\\\/from-zero-to-packagist-publishing-a-php-library-on-composer\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/renor.it\\\/en\\\/blog\\\/sviluppo-software-programmazione\\\/from-zero-to-packagist-publishing-a-php-library-on-composer\\\/\"},\"author\":{\"name\":\"Simone Renzi\",\"@id\":\"https:\\\/\\\/renor.it\\\/en\\\/#\\\/schema\\\/person\\\/21343be04e5983a87f3a9a6182cf8795\"},\"headline\":\"From Zero to Packagist: Publishing a PHP Library on Composer\",\"datePublished\":\"2025-05-12T20:06:01+00:00\",\"dateModified\":\"2025-12-20T14:53:58+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/renor.it\\\/en\\\/blog\\\/sviluppo-software-programmazione\\\/from-zero-to-packagist-publishing-a-php-library-on-composer\\\/\"},\"wordCount\":833,\"publisher\":{\"@id\":\"https:\\\/\\\/renor.it\\\/en\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/renor.it\\\/en\\\/blog\\\/sviluppo-software-programmazione\\\/from-zero-to-packagist-publishing-a-php-library-on-composer\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/renor.it\\\/wp-content\\\/uploads\\\/2025\\\/05\\\/packagist.webp\",\"keywords\":[\"CI\\\/CD\",\"Composer\",\"dependency management\",\"GitHub\",\"open-source\",\"package publishing\",\"Packagist\",\"php\",\"PHP library\",\"PHPUnit\",\"PSR-4\",\"release workflow\",\"semantic versioning\"],\"articleSection\":[\"Sviluppo Software &amp; Programmazione\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/renor.it\\\/en\\\/blog\\\/sviluppo-software-programmazione\\\/from-zero-to-packagist-publishing-a-php-library-on-composer\\\/\",\"url\":\"https:\\\/\\\/renor.it\\\/en\\\/blog\\\/sviluppo-software-programmazione\\\/from-zero-to-packagist-publishing-a-php-library-on-composer\\\/\",\"name\":\"From Zero to Packagist: Publishing a PHP Library on Composer | RENOR &amp; Partners S.r.l.\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/renor.it\\\/en\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/renor.it\\\/en\\\/blog\\\/sviluppo-software-programmazione\\\/from-zero-to-packagist-publishing-a-php-library-on-composer\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/renor.it\\\/en\\\/blog\\\/sviluppo-software-programmazione\\\/from-zero-to-packagist-publishing-a-php-library-on-composer\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/renor.it\\\/wp-content\\\/uploads\\\/2025\\\/05\\\/packagist.webp\",\"datePublished\":\"2025-05-12T20:06:01+00:00\",\"dateModified\":\"2025-12-20T14:53:58+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/renor.it\\\/en\\\/blog\\\/sviluppo-software-programmazione\\\/from-zero-to-packagist-publishing-a-php-library-on-composer\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/renor.it\\\/en\\\/blog\\\/sviluppo-software-programmazione\\\/from-zero-to-packagist-publishing-a-php-library-on-composer\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/renor.it\\\/en\\\/blog\\\/sviluppo-software-programmazione\\\/from-zero-to-packagist-publishing-a-php-library-on-composer\\\/#primaryimage\",\"url\":\"https:\\\/\\\/renor.it\\\/wp-content\\\/uploads\\\/2025\\\/05\\\/packagist.webp\",\"contentUrl\":\"https:\\\/\\\/renor.it\\\/wp-content\\\/uploads\\\/2025\\\/05\\\/packagist.webp\",\"width\":1536,\"height\":1024,\"caption\":\"Figura 1 \u2013 Il flusso di pubblicazione su Packagist: dal comando Composer sullo schermo ai loghi GitHub e Packagist che certificano la distribuzione del pacchetto.\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/renor.it\\\/en\\\/blog\\\/sviluppo-software-programmazione\\\/from-zero-to-packagist-publishing-a-php-library-on-composer\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/renor.it\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Blog\",\"item\":\"https:\\\/\\\/renor.it\\\/en\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Software Development &amp; Programming\",\"item\":\"https:\\\/\\\/renor.it\\\/en\\\/blog\\\/software-development-programming\\\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"From Zero to Packagist: Publishing a PHP Library on Composer\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/renor.it\\\/en\\\/#website\",\"url\":\"https:\\\/\\\/renor.it\\\/en\\\/\",\"name\":\"RENOR & Partners S.r.l.\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/renor.it\\\/en\\\/#organization\"},\"alternateName\":\"RENOR & Partners S.r.l.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/renor.it\\\/en\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/renor.it\\\/en\\\/#organization\",\"name\":\"RENOR & Partners S.r.l.\",\"url\":\"https:\\\/\\\/renor.it\\\/en\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/renor.it\\\/en\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/renor.it\\\/wp-content\\\/uploads\\\/2025\\\/12\\\/logo-new-1.webp\",\"contentUrl\":\"https:\\\/\\\/renor.it\\\/wp-content\\\/uploads\\\/2025\\\/12\\\/logo-new-1.webp\",\"width\":432,\"height\":146,\"caption\":\"RENOR & Partners S.r.l.\"},\"image\":{\"@id\":\"https:\\\/\\\/renor.it\\\/en\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/renorsrl\",\"https:\\\/\\\/www.instagram.com\\\/renorpartners\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/renor-partners\\\/posts\\\/?feedView=all\"],\"description\":\"RENOR & Partners Srl \u00e8 una societ\u00e0 di consulenza tecnologica e ingegneristica specializzata in sviluppo software, cloud computing, integrazione di sistemi, intelligenza artificiale applicata e progettazione elettronica. L\u2019azienda supporta imprese e pubbliche amministrazioni nella realizzazione di soluzioni digitali affidabili, scalabili e orientate all\u2019efficienza, con un approccio pragmatico basato su competenze tecniche, progettazione su misura e innovazione concreta.\",\"email\":\"info@renor.it\",\"telephone\":\"3791489430\",\"legalName\":\"RENOR AND PARTNERS S.r.l.\",\"foundingDate\":\"2022-06-21\",\"vatID\":\"16768411007\",\"taxID\":\"16768411007\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":\"1\",\"maxValue\":\"10\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/renor.it\\\/en\\\/#\\\/schema\\\/person\\\/21343be04e5983a87f3a9a6182cf8795\",\"name\":\"Simone Renzi\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/54f81b51be6bda6d63a06a1cd6563d9b0d5778d7af4f0bda4e246fc3e5737e2e?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/54f81b51be6bda6d63a06a1cd6563d9b0d5778d7af4f0bda4e246fc3e5737e2e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/54f81b51be6bda6d63a06a1cd6563d9b0d5778d7af4f0bda4e246fc3e5737e2e?s=96&d=mm&r=g\",\"caption\":\"Simone Renzi\"},\"description\":\"Senior full-stack web engineer with over 20 years of experience in cloud architectures, AI, and SaaS solutions; member of Mensa Italia. Creator of platforms such as HR24.ai and Paghe.ai, he oversaw the web development of FNS, a neural network simulator cited in Scientific Reports (Nature Portfolio), and has collaborated on research projects with INFN \u2013 Laboratori Nazionali di Frascati, Universit\u00e0 di Roma \u201cTor Vergata\u201d, Universidad Complutense, Universidad Polit\u00e9cnica and Centro de Tecnolog\u00eda Biom\u00e9dica in Madrid. A classical pianist, he combines musical creativity and technological rigor in every project.\",\"sameAs\":[\"https:\\\/\\\/renor.it\",\"https:\\\/\\\/www.facebook.com\\\/simone.renzi.3954\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/simone-renzi\"],\"url\":\"https:\\\/\\\/renor.it\\\/en\\\/author\\\/thesimon\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"From Zero to Packagist: Publishing a PHP Library on Composer | RENOR &amp; Partners S.r.l.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/renor.it\/en\/blog\/sviluppo-software-programmazione\/from-zero-to-packagist-publishing-a-php-library-on-composer\/","og_locale":"en_US","og_type":"article","og_title":"From Zero to Packagist: Publishing a PHP Library on Composer","og_description":"Publishing a Composer package means making your code installable with a simple CLI command. composer require vendor\/package and keeping updates, versions, and dependencies under control.To follow the guide, we need: Referring back to the article where we explored how to develop a descriptive statistics library, the repository structure was as follows: In the terminal, inside [&hellip;]","og_url":"https:\/\/renor.it\/en\/blog\/sviluppo-software-programmazione\/from-zero-to-packagist-publishing-a-php-library-on-composer\/","og_site_name":"RENOR &amp; Partners S.r.l.","article_publisher":"https:\/\/www.facebook.com\/renorsrl","article_author":"https:\/\/www.facebook.com\/simone.renzi.3954\/","article_published_time":"2025-05-12T20:06:01+00:00","article_modified_time":"2025-12-20T14:53:58+00:00","og_image":[{"width":1536,"height":1024,"url":"https:\/\/renor.it\/wp-content\/uploads\/2025\/05\/packagist.webp","type":"image\/webp"}],"author":"Simone Renzi","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Simone Renzi","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/renor.it\/en\/blog\/sviluppo-software-programmazione\/from-zero-to-packagist-publishing-a-php-library-on-composer\/#article","isPartOf":{"@id":"https:\/\/renor.it\/en\/blog\/sviluppo-software-programmazione\/from-zero-to-packagist-publishing-a-php-library-on-composer\/"},"author":{"name":"Simone Renzi","@id":"https:\/\/renor.it\/en\/#\/schema\/person\/21343be04e5983a87f3a9a6182cf8795"},"headline":"From Zero to Packagist: Publishing a PHP Library on Composer","datePublished":"2025-05-12T20:06:01+00:00","dateModified":"2025-12-20T14:53:58+00:00","mainEntityOfPage":{"@id":"https:\/\/renor.it\/en\/blog\/sviluppo-software-programmazione\/from-zero-to-packagist-publishing-a-php-library-on-composer\/"},"wordCount":833,"publisher":{"@id":"https:\/\/renor.it\/en\/#organization"},"image":{"@id":"https:\/\/renor.it\/en\/blog\/sviluppo-software-programmazione\/from-zero-to-packagist-publishing-a-php-library-on-composer\/#primaryimage"},"thumbnailUrl":"https:\/\/renor.it\/wp-content\/uploads\/2025\/05\/packagist.webp","keywords":["CI\/CD","Composer","dependency management","GitHub","open-source","package publishing","Packagist","php","PHP library","PHPUnit","PSR-4","release workflow","semantic versioning"],"articleSection":["Sviluppo Software &amp; Programmazione"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/renor.it\/en\/blog\/sviluppo-software-programmazione\/from-zero-to-packagist-publishing-a-php-library-on-composer\/","url":"https:\/\/renor.it\/en\/blog\/sviluppo-software-programmazione\/from-zero-to-packagist-publishing-a-php-library-on-composer\/","name":"From Zero to Packagist: Publishing a PHP Library on Composer | RENOR &amp; Partners S.r.l.","isPartOf":{"@id":"https:\/\/renor.it\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/renor.it\/en\/blog\/sviluppo-software-programmazione\/from-zero-to-packagist-publishing-a-php-library-on-composer\/#primaryimage"},"image":{"@id":"https:\/\/renor.it\/en\/blog\/sviluppo-software-programmazione\/from-zero-to-packagist-publishing-a-php-library-on-composer\/#primaryimage"},"thumbnailUrl":"https:\/\/renor.it\/wp-content\/uploads\/2025\/05\/packagist.webp","datePublished":"2025-05-12T20:06:01+00:00","dateModified":"2025-12-20T14:53:58+00:00","breadcrumb":{"@id":"https:\/\/renor.it\/en\/blog\/sviluppo-software-programmazione\/from-zero-to-packagist-publishing-a-php-library-on-composer\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/renor.it\/en\/blog\/sviluppo-software-programmazione\/from-zero-to-packagist-publishing-a-php-library-on-composer\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/renor.it\/en\/blog\/sviluppo-software-programmazione\/from-zero-to-packagist-publishing-a-php-library-on-composer\/#primaryimage","url":"https:\/\/renor.it\/wp-content\/uploads\/2025\/05\/packagist.webp","contentUrl":"https:\/\/renor.it\/wp-content\/uploads\/2025\/05\/packagist.webp","width":1536,"height":1024,"caption":"Figura 1 \u2013 Il flusso di pubblicazione su Packagist: dal comando Composer sullo schermo ai loghi GitHub e Packagist che certificano la distribuzione del pacchetto."},{"@type":"BreadcrumbList","@id":"https:\/\/renor.it\/en\/blog\/sviluppo-software-programmazione\/from-zero-to-packagist-publishing-a-php-library-on-composer\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/renor.it\/en\/"},{"@type":"ListItem","position":2,"name":"Blog","item":"https:\/\/renor.it\/en\/blog\/"},{"@type":"ListItem","position":3,"name":"Software Development &amp; Programming","item":"https:\/\/renor.it\/en\/blog\/software-development-programming\/"},{"@type":"ListItem","position":4,"name":"From Zero to Packagist: Publishing a PHP Library on Composer"}]},{"@type":"WebSite","@id":"https:\/\/renor.it\/en\/#website","url":"https:\/\/renor.it\/en\/","name":"RENOR & Partners S.r.l.","description":"","publisher":{"@id":"https:\/\/renor.it\/en\/#organization"},"alternateName":"RENOR & Partners S.r.l.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/renor.it\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/renor.it\/en\/#organization","name":"RENOR & Partners S.r.l.","url":"https:\/\/renor.it\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/renor.it\/en\/#\/schema\/logo\/image\/","url":"https:\/\/renor.it\/wp-content\/uploads\/2025\/12\/logo-new-1.webp","contentUrl":"https:\/\/renor.it\/wp-content\/uploads\/2025\/12\/logo-new-1.webp","width":432,"height":146,"caption":"RENOR & Partners S.r.l."},"image":{"@id":"https:\/\/renor.it\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/renorsrl","https:\/\/www.instagram.com\/renorpartners\/","https:\/\/www.linkedin.com\/company\/renor-partners\/posts\/?feedView=all"],"description":"RENOR & Partners Srl \u00e8 una societ\u00e0 di consulenza tecnologica e ingegneristica specializzata in sviluppo software, cloud computing, integrazione di sistemi, intelligenza artificiale applicata e progettazione elettronica. L\u2019azienda supporta imprese e pubbliche amministrazioni nella realizzazione di soluzioni digitali affidabili, scalabili e orientate all\u2019efficienza, con un approccio pragmatico basato su competenze tecniche, progettazione su misura e innovazione concreta.","email":"info@renor.it","telephone":"3791489430","legalName":"RENOR AND PARTNERS S.r.l.","foundingDate":"2022-06-21","vatID":"16768411007","taxID":"16768411007","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"1","maxValue":"10"}},{"@type":"Person","@id":"https:\/\/renor.it\/en\/#\/schema\/person\/21343be04e5983a87f3a9a6182cf8795","name":"Simone Renzi","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/54f81b51be6bda6d63a06a1cd6563d9b0d5778d7af4f0bda4e246fc3e5737e2e?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/54f81b51be6bda6d63a06a1cd6563d9b0d5778d7af4f0bda4e246fc3e5737e2e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/54f81b51be6bda6d63a06a1cd6563d9b0d5778d7af4f0bda4e246fc3e5737e2e?s=96&d=mm&r=g","caption":"Simone Renzi"},"description":"Senior full-stack web engineer with over 20 years of experience in cloud architectures, AI, and SaaS solutions; member of Mensa Italia. Creator of platforms such as HR24.ai and Paghe.ai, he oversaw the web development of FNS, a neural network simulator cited in Scientific Reports (Nature Portfolio), and has collaborated on research projects with INFN \u2013 Laboratori Nazionali di Frascati, Universit\u00e0 di Roma \u201cTor Vergata\u201d, Universidad Complutense, Universidad Polit\u00e9cnica and Centro de Tecnolog\u00eda Biom\u00e9dica in Madrid. A classical pianist, he combines musical creativity and technological rigor in every project.","sameAs":["https:\/\/renor.it","https:\/\/www.facebook.com\/simone.renzi.3954\/","https:\/\/www.linkedin.com\/in\/simone-renzi"],"url":"https:\/\/renor.it\/en\/author\/thesimon\/"}]}},"_links":{"self":[{"href":"https:\/\/renor.it\/en\/wp-json\/wp\/v2\/posts\/665","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/renor.it\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/renor.it\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/renor.it\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/renor.it\/en\/wp-json\/wp\/v2\/comments?post=665"}],"version-history":[{"count":0,"href":"https:\/\/renor.it\/en\/wp-json\/wp\/v2\/posts\/665\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/renor.it\/en\/wp-json\/wp\/v2\/media\/493"}],"wp:attachment":[{"href":"https:\/\/renor.it\/en\/wp-json\/wp\/v2\/media?parent=665"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/renor.it\/en\/wp-json\/wp\/v2\/categories?post=665"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/renor.it\/en\/wp-json\/wp\/v2\/tags?post=665"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}