Satheesh Narayanan
Satheesh Narayanan

Reputation: 321

PS-4 PHP package - Main folder classes are not able to access the sub folder classes - Namespace

I am learning to setup PHP package with PSR-4 autoload using composer. I have managed to set up the working package. But I can access the classes in the same directory but cannot access the sub folder classes from main folder class.

adding my src code link here https://github.com/nsatheesh87/PSR-4-PHP-Test

Kernel.php from src directory trying to access the Http->Request.php class but only i can get Class cannot found error. Also I Checked the namespaces

Upvotes: 0

Views: 78

Answers (1)

buildok
buildok

Reputation: 785

You miss parameter with create Kernel object https://github.com/nsatheesh87/PSR-4-PHP-Test/blob/master/src/app.php#L14

This constructor require object of Request class https://github.com/nsatheesh87/PSR-4-PHP-Test/blob/master/src/Kernel.php#L11

Upvotes: 1

Related Questions