Exemple #1
0
 /**
  * @param $name
  * @return ServiceLocator|mixed
  * @throws \InvalidArgumentException
  */
 public function __get($name)
 {
     switch (strtolower($name)) {
         case 'services':
         case 'servicelocator':
             return $this->serviceLocator;
         case 'router':
             return $this->serviceLocator->get('Router');
         case 'routes':
             return $this->serviceLocator->get('Router')->getRouteStack();
         default:
             if ($this->serviceLocator->has($name)) {
                 return $this->serviceLocator->get($name);
             }
     }
     throw new \InvalidArgumentException($name . ' is not a valid property in the application object or a valid service in the ServiceLocator');
 }