Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught Error: Class "DVDoug\BoxPacker\Test\TestBox" not found (composer/3.12.0) #586

Closed
b2b-fesports opened this issue Nov 27, 2023 · 0 comments

Comments

@b2b-fesports
Copy link

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

dvdoug added a commit that referenced this issue Dec 2, 2023
…-dev install

Resolves issue with copy/pasting the samples from the docs
@dvdoug dvdoug closed this as completed in 51ded4d Dec 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant