0

I installed a composer, downloaded the Aura, created an index.pxp and wrote in it:

require('vendor/autoload.php');

use Aura\Di\ContainerBuilder;
$builder = new ContainerBuilder();
$di = $builder->newInstance();

$object = $di->newInstance('Vendor\Package\ClassName');

But phpStorm says:Undefined namespase DI

And i have error: Fatal error: Class 'Aura\Di\ContainerBuilder' not found in... on line 4

I do as follows: http://auraphp.com/packages/3.x/Di/getting-started.html#1-1-1

fosh4455
  • 361
  • 1
  • 4
  • 11

1 Answers1

0

In order for the composer auto-loader to pick up \Aura\Di, the dependency needs to be managed by composer.

You can easily do this by executing

composer require aura/di

which will add the dependency to your composer.json file and register with the auto-loader.


If you have manually downloaded and installed aura/di, you can revert that.

Phil
  • 157,677
  • 23
  • 242
  • 245