Uncaught Error: Class "DVDoug\BoxPacker\Test\TestBox" not found (composer/3.12.0)
Closed this issue · 0 comments
b2b-fesports commented
I fixed the problem in my code but this might help others out.
Maybe something for the manual.
Installed via composer - dvdoug/boxpacker 3.12.0
Example code produced this error
PHP Fatal error: Uncaught Error: Class "DVDoug\BoxPacker\Test\TestBox" not found
when using $packer->addBox( new DVDoug\BoxPacker\Test\TestBox(blah) )
The problem was i used these 4 USE commands from the manual, the first 2 cannot be used when autoloading.
But i still needed the last 2 for the TestBox class to be found.
use DVDoug\BoxPacker\Rotation; // Not required when autoloading
use DVDoug\BoxPacker\Packer; // Not required when autoloading
use DVDoug\BoxPacker\Test\TestBox; // use your own 'Box' implementation
use DVDoug\BoxPacker\Test\TestItem; // use your own 'Item' implementation
I also had to call the full namespace.
//$packer = new Packer();
$packer = new DVDoug\BoxPacker\Packer();
Great work btw, awesome utility!
Chris