@@ -112,16 +112,16 @@ |
||
112 | 112 | $eventManager->attach( |
113 | 113 | MvcEvent::EVENT_DISPATCH_ERROR, |
114 | 114 | function ($event) { |
115 | - if($event instanceof MvcEvent){ |
|
116 | - $application = $event->getApplication(); |
|
115 | + if($event instanceof MvcEvent){ |
|
116 | + $application = $event->getApplication(); |
|
117 | 117 | |
118 | - if ($application::ERROR_EXCEPTION == $event->getError()) { |
|
119 | - $ex = $event->getParam('exception'); |
|
120 | - if (404 == $ex->getCode()) { |
|
121 | - $event->setError($application::ERROR_CONTROLLER_NOT_FOUND); |
|
122 | - } |
|
123 | - } |
|
124 | - } |
|
118 | + if ($application::ERROR_EXCEPTION == $event->getError()) { |
|
119 | + $ex = $event->getParam('exception'); |
|
120 | + if (404 == $ex->getCode()) { |
|
121 | + $event->setError($application::ERROR_CONTROLLER_NOT_FOUND); |
|
122 | + } |
|
123 | + } |
|
124 | + } |
|
125 | 125 | }, |
126 | 126 | 500 |
127 | 127 | ); |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | public function getConsoleBanner(Console $console) |
42 | 42 | { |
43 | 43 | $version = `git describe 2>/dev/null`; |
44 | - $name = 'YAWIK ' . trim($version); |
|
44 | + $name = 'YAWIK '.trim($version); |
|
45 | 45 | $width = $console->getWidth(); |
46 | 46 | return sprintf( |
47 | 47 | "==%1\$s==\n%2\$s%3\$s\n**%1\$s**\n", |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | |
85 | 85 | /* @var \Core\Options\ModuleOptions $options */ |
86 | 86 | $languageRouteListener = new LanguageRouteListener( |
87 | - $sm->get('Core/Locale'),$sm->get('Core/Options') |
|
87 | + $sm->get('Core/Locale'), $sm->get('Core/Options') |
|
88 | 88 | ); |
89 | 89 | $languageRouteListener->attach($eventManager); |
90 | 90 | |
@@ -113,8 +113,8 @@ discard block |
||
113 | 113 | |
114 | 114 | $eventManager->attach( |
115 | 115 | MvcEvent::EVENT_DISPATCH_ERROR, |
116 | - function ($event) { |
|
117 | - if($event instanceof MvcEvent){ |
|
116 | + function($event) { |
|
117 | + if ($event instanceof MvcEvent) { |
|
118 | 118 | $application = $event->getApplication(); |
119 | 119 | |
120 | 120 | if ($application::ERROR_EXCEPTION == $event->getError()) { |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | ); |
130 | 130 | $eventManager->attach( |
131 | 131 | MvcEvent::EVENT_DISPATCH, |
132 | - function ($event) use ($eventManager) { |
|
132 | + function($event) use ($eventManager) { |
|
133 | 133 | $eventManager->trigger('postDispatch', $event); |
134 | 134 | }, |
135 | 135 | -150 |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | */ |
145 | 145 | public function getConfig() |
146 | 146 | { |
147 | - $config = include __DIR__ . '/config/module.config.php'; |
|
147 | + $config = include __DIR__.'/config/module.config.php'; |
|
148 | 148 | return $config; |
149 | 149 | } |
150 | 150 | |
@@ -157,13 +157,13 @@ discard block |
||
157 | 157 | { |
158 | 158 | return array( |
159 | 159 | 'Zend\Loader\ClassMapAutoloader' => [ |
160 | - __DIR__ . '/src/autoload_classmap.php' |
|
160 | + __DIR__.'/src/autoload_classmap.php' |
|
161 | 161 | ], |
162 | 162 | 'Zend\Loader\StandardAutoloader' => array( |
163 | 163 | 'namespaces' => array( |
164 | - __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__, |
|
165 | - 'CoreTest' => __DIR__ . '/test/' . 'CoreTest', |
|
166 | - 'CoreTestUtils' => __DIR__ . '/test/CoreTestUtils', |
|
164 | + __NAMESPACE__ => __DIR__.'/src/'.__NAMESPACE__, |
|
165 | + 'CoreTest' => __DIR__.'/test/'.'CoreTest', |
|
166 | + 'CoreTestUtils' => __DIR__.'/test/CoreTestUtils', |
|
167 | 167 | ), |
168 | 168 | ), |
169 | 169 | ); |
@@ -14,7 +14,7 @@ |
||
14 | 14 | |
15 | 15 | class ServiceLocatorAwareConfiguration extends Configuration |
16 | 16 | { |
17 | - public function setServiceLocator($serviceLocator) |
|
17 | + public function setServiceLocator($serviceLocator) |
|
18 | 18 | { |
19 | 19 | $this->attributes['serviceLocator'] = $serviceLocator; |
20 | 20 | return $this; |
@@ -22,17 +22,17 @@ |
||
22 | 22 | */ |
23 | 23 | class DocumentManagerFactory implements FactoryInterface |
24 | 24 | { |
25 | - public function __invoke( ContainerInterface $container, $requestedName, array $options = null ) { |
|
26 | - $container->setAllowOverride(true); |
|
27 | - $container->setFactory('doctrine.configuration.odm_default', new ConfigurationFactory('odm_default')); |
|
28 | - $container->setAllowOverride(false); |
|
25 | + public function __invoke( ContainerInterface $container, $requestedName, array $options = null ) { |
|
26 | + $container->setAllowOverride(true); |
|
27 | + $container->setFactory('doctrine.configuration.odm_default', new ConfigurationFactory('odm_default')); |
|
28 | + $container->setAllowOverride(false); |
|
29 | 29 | |
30 | - $configFactory = new ConfigurationFactory('odm_default'); |
|
31 | - $config = $configFactory->createService($container); |
|
30 | + $configFactory = new ConfigurationFactory('odm_default'); |
|
31 | + $config = $configFactory->createService($container); |
|
32 | 32 | |
33 | - $dm = $container->get('doctrine.documentmanager.odm_default'); |
|
34 | - $dm = DoctrineDocumentManager::create($dm->getConnection(), $config, $dm->getEventManager()); |
|
35 | - $dm->getSchemaManager()->ensureIndexes(); |
|
36 | - return $dm; |
|
37 | - } |
|
33 | + $dm = $container->get('doctrine.documentmanager.odm_default'); |
|
34 | + $dm = DoctrineDocumentManager::create($dm->getConnection(), $config, $dm->getEventManager()); |
|
35 | + $dm->getSchemaManager()->ensureIndexes(); |
|
36 | + return $dm; |
|
37 | + } |
|
38 | 38 | } |
@@ -22,7 +22,7 @@ |
||
22 | 22 | */ |
23 | 23 | class DocumentManagerFactory implements FactoryInterface |
24 | 24 | { |
25 | - public function __invoke( ContainerInterface $container, $requestedName, array $options = null ) { |
|
25 | + public function __invoke(ContainerInterface $container, $requestedName, array $options = null) { |
|
26 | 26 | $container->setAllowOverride(true); |
27 | 27 | $container->setFactory('doctrine.configuration.odm_default', new ConfigurationFactory('odm_default')); |
28 | 28 | $container->setAllowOverride(false); |
@@ -21,16 +21,16 @@ |
||
21 | 21 | class RepositoryServiceFactory implements FactoryInterface |
22 | 22 | { |
23 | 23 | |
24 | - public function __invoke( ContainerInterface $container, $requestedName, array $options = null ) { |
|
25 | - $dm = $container->get('Core/DocumentManager'); |
|
26 | - $service = new RepositoryService($dm); |
|
24 | + public function __invoke( ContainerInterface $container, $requestedName, array $options = null ) { |
|
25 | + $dm = $container->get('Core/DocumentManager'); |
|
26 | + $service = new RepositoryService($dm); |
|
27 | 27 | |
28 | - /* Attach persistence listener */ |
|
29 | - $application = $container->get('Application'); |
|
30 | - $events = $application->getEventManager(); |
|
31 | - $persistenceListener = new PersistenceListener($service); |
|
32 | - $persistenceListener->attach($events); |
|
28 | + /* Attach persistence listener */ |
|
29 | + $application = $container->get('Application'); |
|
30 | + $events = $application->getEventManager(); |
|
31 | + $persistenceListener = new PersistenceListener($service); |
|
32 | + $persistenceListener->attach($events); |
|
33 | 33 | |
34 | - return $service; |
|
35 | - } |
|
34 | + return $service; |
|
35 | + } |
|
36 | 36 | } |
@@ -21,7 +21,7 @@ |
||
21 | 21 | class RepositoryServiceFactory implements FactoryInterface |
22 | 22 | { |
23 | 23 | |
24 | - public function __invoke( ContainerInterface $container, $requestedName, array $options = null ) { |
|
24 | + public function __invoke(ContainerInterface $container, $requestedName, array $options = null) { |
|
25 | 25 | $dm = $container->get('Core/DocumentManager'); |
26 | 26 | $service = new RepositoryService($dm); |
27 | 27 |
@@ -22,20 +22,20 @@ |
||
22 | 22 | */ |
23 | 23 | class XssFilterFactory implements FactoryInterface |
24 | 24 | { |
25 | - /** |
|
26 | - * @param ContainerInterface $container |
|
27 | - * @param string $requestedName |
|
28 | - * @param array|null $options |
|
29 | - * |
|
30 | - * @return XssFilter |
|
31 | - */ |
|
32 | - public function __invoke( ContainerInterface $container, $requestedName, array $options = null ) |
|
33 | - { |
|
34 | - $htmlPurifier = new Filter\HTMLPurifierFilter(); |
|
35 | - $htmlPurifier->setConfig(array("Cache.SerializerPath" => "cache/HtmlPurifier")); |
|
25 | + /** |
|
26 | + * @param ContainerInterface $container |
|
27 | + * @param string $requestedName |
|
28 | + * @param array|null $options |
|
29 | + * |
|
30 | + * @return XssFilter |
|
31 | + */ |
|
32 | + public function __invoke( ContainerInterface $container, $requestedName, array $options = null ) |
|
33 | + { |
|
34 | + $htmlPurifier = new Filter\HTMLPurifierFilter(); |
|
35 | + $htmlPurifier->setConfig(array("Cache.SerializerPath" => "cache/HtmlPurifier")); |
|
36 | 36 | |
37 | - $filter = new XssFilter($htmlPurifier); |
|
37 | + $filter = new XssFilter($htmlPurifier); |
|
38 | 38 | |
39 | - return $filter; |
|
40 | - } |
|
39 | + return $filter; |
|
40 | + } |
|
41 | 41 | } |
@@ -29,7 +29,7 @@ |
||
29 | 29 | * |
30 | 30 | * @return XssFilter |
31 | 31 | */ |
32 | - public function __invoke( ContainerInterface $container, $requestedName, array $options = null ) |
|
32 | + public function __invoke(ContainerInterface $container, $requestedName, array $options = null) |
|
33 | 33 | { |
34 | 34 | $htmlPurifier = new Filter\HTMLPurifierFilter(); |
35 | 35 | $htmlPurifier->setConfig(array("Cache.SerializerPath" => "cache/HtmlPurifier")); |
@@ -86,9 +86,9 @@ |
||
86 | 86 | $values = []; |
87 | 87 | /* @var NodeInterface $item */ |
88 | 88 | foreach ($this->getItems() as $item) { |
89 | - if(!is_null($item)){ |
|
90 | - $values[] = $item->getValueWithParents(); |
|
91 | - } |
|
89 | + if(!is_null($item)){ |
|
90 | + $values[] = $item->getValueWithParents(); |
|
91 | + } |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | $this->values = $values; |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | { |
29 | 29 | use EntityTrait, ClonePropertiesTrait; |
30 | 30 | |
31 | - private $cloneProperties = [ '!items' ]; |
|
31 | + private $cloneProperties = ['!items']; |
|
32 | 32 | |
33 | 33 | /** |
34 | 34 | * The leafs. |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | $values = []; |
87 | 87 | /* @var NodeInterface $item */ |
88 | 88 | foreach ($this->getItems() as $item) { |
89 | - if(!is_null($item)){ |
|
89 | + if (!is_null($item)) { |
|
90 | 90 | $values[] = $item->getValueWithParents(); |
91 | 91 | } |
92 | 92 | } |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | $parent = $nextParent; |
116 | 116 | } |
117 | 117 | $nameParts[] = $item->getName(); |
118 | - $items[] = join(' | ' , $nameParts); |
|
118 | + $items[] = join(' | ', $nameParts); |
|
119 | 119 | |
120 | 120 | } |
121 | 121 |
@@ -21,15 +21,15 @@ discard block |
||
21 | 21 | { |
22 | 22 | protected $hydrator; |
23 | 23 | |
24 | - public function __invoke( ContainerInterface $container, $requestedName, array $options = null ) |
|
25 | - { |
|
26 | - $this->hydrator = $this->getEntityHydrator(); |
|
27 | - $this->prepareHydrator(); |
|
28 | - return $this->hydrator; |
|
29 | - } |
|
24 | + public function __invoke( ContainerInterface $container, $requestedName, array $options = null ) |
|
25 | + { |
|
26 | + $this->hydrator = $this->getEntityHydrator(); |
|
27 | + $this->prepareHydrator(); |
|
28 | + return $this->hydrator; |
|
29 | + } |
|
30 | 30 | |
31 | 31 | |
32 | - /** |
|
32 | + /** |
|
33 | 33 | * Create the Json Entity Hydrator |
34 | 34 | * |
35 | 35 | * @param ServiceLocatorInterface $serviceLocator |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | */ |
38 | 38 | public function createService(ServiceLocatorInterface $serviceLocator) |
39 | 39 | { |
40 | - return $this($serviceLocator,EntityHydrator::class); |
|
40 | + return $this($serviceLocator,EntityHydrator::class); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | protected function prepareHydrator() |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | { |
22 | 22 | protected $hydrator; |
23 | 23 | |
24 | - public function __invoke( ContainerInterface $container, $requestedName, array $options = null ) |
|
24 | + public function __invoke(ContainerInterface $container, $requestedName, array $options = null) |
|
25 | 25 | { |
26 | 26 | $this->hydrator = $this->getEntityHydrator(); |
27 | 27 | $this->prepareHydrator(); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | */ |
38 | 38 | public function createService(ServiceLocatorInterface $serviceLocator) |
39 | 39 | { |
40 | - return $this($serviceLocator,EntityHydrator::class); |
|
40 | + return $this($serviceLocator, EntityHydrator::class); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | protected function prepareHydrator() |
@@ -21,17 +21,17 @@ |
||
21 | 21 | { |
22 | 22 | protected $hydrator; |
23 | 23 | |
24 | - public function __invoke( ContainerInterface $container, $requestedName, array $options = null ) |
|
25 | - { |
|
26 | - $this->hydrator = new JsonEntityHydrator(); |
|
27 | - $entityHydrator = $this->getEntityHydrator(); |
|
28 | - $this->hydrator->injectHydrator($entityHydrator); |
|
29 | - $this->prepareHydrator(); |
|
30 | - return $this->hydrator; |
|
31 | - } |
|
24 | + public function __invoke( ContainerInterface $container, $requestedName, array $options = null ) |
|
25 | + { |
|
26 | + $this->hydrator = new JsonEntityHydrator(); |
|
27 | + $entityHydrator = $this->getEntityHydrator(); |
|
28 | + $this->hydrator->injectHydrator($entityHydrator); |
|
29 | + $this->prepareHydrator(); |
|
30 | + return $this->hydrator; |
|
31 | + } |
|
32 | 32 | |
33 | 33 | |
34 | - /** |
|
34 | + /** |
|
35 | 35 | * Create the Json Entity Hydrator |
36 | 36 | * |
37 | 37 | * @param ServiceLocatorInterface $serviceLocator |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | { |
22 | 22 | protected $hydrator; |
23 | 23 | |
24 | - public function __invoke( ContainerInterface $container, $requestedName, array $options = null ) |
|
24 | + public function __invoke(ContainerInterface $container, $requestedName, array $options = null) |
|
25 | 25 | { |
26 | 26 | $this->hydrator = new JsonEntityHydrator(); |
27 | 27 | $entityHydrator = $this->getEntityHydrator(); |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | */ |
40 | 40 | public function createService(ServiceLocatorInterface $serviceLocator) |
41 | 41 | { |
42 | - return $this($serviceLocator,JsonEntityHydrator::class); |
|
42 | + return $this($serviceLocator, JsonEntityHydrator::class); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | protected function prepareHydrator() { |
@@ -93,11 +93,11 @@ |
||
93 | 93 | $this->trigger(FileEvent::INSERTFILE, $event); |
94 | 94 | } |
95 | 95 | |
96 | - /** |
|
97 | - * @param ContainerInterface $container |
|
98 | - * |
|
99 | - * @return InsertFile |
|
100 | - */ |
|
96 | + /** |
|
97 | + * @param ContainerInterface $container |
|
98 | + * |
|
99 | + * @return InsertFile |
|
100 | + */ |
|
101 | 101 | public static function factory(ContainerInterface $container) |
102 | 102 | { |
103 | 103 | return new static($container); |