/**
  * Inject all your properties into controller at run time
  * @param $controllerInstance
  * @param $controller
  * @throws Exception
  */
 public function propertyInjection($controllerInstance, $controller)
 {
     $definition = $this->getDefinition();
     $injectableDefinitions = $definition()->getPropertyDependencies();
     $this->setPropertyInjection($injectableDefinitions);
     $dependencies = $this->getDefinitions($controller);
     if (array_key_exists($controller, $this->definitions)) {
         $reflection = new Reflection();
         $reflection->setClass($controller);
         foreach ($dependencies as $classProperty => $object) {
             if (!$reflection->reflectionClass->hasProperty($classProperty)) {
                 throw new Exception(sprintf("Property %s is not defined in {$controller} controller", $classProperty));
             }
             $reflection->makePropertyAccessible($classProperty);
             //set property value
             $reflection->reflectionProperty->setValue($controllerInstance, $object);
         }
     }
 }