Category: PHP, api

If you check the composer website you’ll see there is a new major version of composer coming out soon. Version Two (v2) has some features that you should be aware of, but the main one being deprecation of support for incorrect namespaces.

The first reason if your web application has some library and it is located in lib/SomeLibrary/SomeLibrary.php and the namespace of the file SomeLibrary.php is Lib\SomeLibrary: In this case the composer v1 will show the warning message: To resolve this issue you should rename the lib folder to Lib, it should be exactly the same as what you have in the namespace.

namespace lib\SomeLibrary; If your file is Library.php but the class name is different - SomeLibrary: To resolve this one you should rename the file Library.php to SomeLibrary.php to be the same as the class name.

A similar issue to this is if you have added an extra path to your namespace.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners