$this->repository = $repository; } public function getName() { return $this->repository->getName(); } } /** * Initialize a new Box */ $box = new Box(); /** * Bind Product to the container */ $box->bind('Product', function () { return new Product(); }); /** * Bind Repository to the container */ $box->bind('ProductRepositoryInterface', function () use($box) { return new ProductRepository($box->make('Product')); }); /** * Create new Reflection Class for the ProductController */ $class = new ReflectionClass('ProductController'); /** * Get the constructor */ $constructor = $class->getConstructor();