Autoload issue after installation and use
plasid opened this issue · 4 comments
$ composer require nette/php-generator --dev
THEN LATER IN MY OWN CODE
use Nette\PhpGenerator\ClassType;
.
$class = new ClassType('Demo');
.
.
THEN
Error: Nette\PhpGenerator\ClassType not found...
BUT
When you: composer require without the --dev flag then all works fine.
Is there a way to install it as a dev dependency and get it to autoload/resolve correctly?
It should work identically with and without --dev flag. Only difference is dev dependencies are not installed if you run composer install --no-dev
instead of composer install
If it does not work with composer install
- do you have any Composer plugins installed, that could modify autoloading or installation directory?
Had the same issue, try deleting the vendor
folder and the composer.lock
file and run composer update
Will you try reporting it to composer?