@@ -25,9 +25,9 @@ discard block |
||
25 | 25 | */ |
26 | 26 | class CommentController extends AbstractActionController implements ContainerAwareInterface |
27 | 27 | { |
28 | - private $repositories; |
|
28 | + private $repositories; |
|
29 | 29 | |
30 | - private $formManager; |
|
30 | + private $formManager; |
|
31 | 31 | |
32 | 32 | /** |
33 | 33 | * Lists comments of an application |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | $application->getComments()->add($comment); |
84 | 84 | $application->changeStatus($application->getStatus(), sprintf( |
85 | 85 | /* @translate */ 'Application was rated by %s', |
86 | - $this->auth()->getUser()->getInfo()->getDisplayName()) |
|
86 | + $this->auth()->getUser()->getInfo()->getDisplayName()) |
|
87 | 87 | ); |
88 | 88 | } |
89 | 89 | $viewModel->setVariable('isSaved', true); |
@@ -100,18 +100,18 @@ discard block |
||
100 | 100 | return $viewModel; |
101 | 101 | } |
102 | 102 | |
103 | - public function setContainer( ContainerInterface $container ) |
|
104 | - { |
|
105 | - $this->repositories = $container->get('repositories'); |
|
106 | - $this->formManager = $container->get('forms'); |
|
107 | - } |
|
103 | + public function setContainer( ContainerInterface $container ) |
|
104 | + { |
|
105 | + $this->repositories = $container->get('repositories'); |
|
106 | + $this->formManager = $container->get('forms'); |
|
107 | + } |
|
108 | 108 | |
109 | - /** |
|
110 | - * @param ContainerInterface $container |
|
111 | - * |
|
112 | - * @return CommentController |
|
113 | - */ |
|
114 | - static public function factory(ContainerInterface $container) |
|
109 | + /** |
|
110 | + * @param ContainerInterface $container |
|
111 | + * |
|
112 | + * @return CommentController |
|
113 | + */ |
|
114 | + static public function factory(ContainerInterface $container) |
|
115 | 115 | { |
116 | 116 | $ob = new self(); |
117 | 117 | $ob->setContainer($container); |
@@ -100,7 +100,7 @@ |
||
100 | 100 | return $viewModel; |
101 | 101 | } |
102 | 102 | |
103 | - public function setContainer( ContainerInterface $container ) |
|
103 | + public function setContainer(ContainerInterface $container) |
|
104 | 104 | { |
105 | 105 | $this->repositories = $container->get('repositories'); |
106 | 106 | $this->formManager = $container->get('forms'); |
@@ -115,27 +115,27 @@ |
||
115 | 115 | */ |
116 | 116 | protected function generateHtml() |
117 | 117 | { |
118 | - /* |
|
118 | + /* |
|
119 | 119 | * "ViewHelperManager" defined by ZF2 |
120 | 120 | * see http://framework.zend.com/manual/2.0/en/modules/zend.mvc.services.html#viewmanager |
121 | 121 | */ |
122 | - $viewManager = $this->viewManager; |
|
122 | + $viewManager = $this->viewManager; |
|
123 | 123 | |
124 | 124 | return $viewManager->get("partial")->__invoke('applications/mail/forward', array("application"=>$this->application)); |
125 | 125 | } |
126 | 126 | |
127 | 127 | public function setContainer(ContainerInterface $container) |
128 | 128 | { |
129 | - $this->viewManager = $container->get('ViewHelperManager'); |
|
129 | + $this->viewManager = $container->get('ViewHelperManager'); |
|
130 | 130 | } |
131 | 131 | |
132 | - /** |
|
133 | - * @param ContainerInterface $container |
|
134 | - * @param $requestedName |
|
135 | - * @param array $options |
|
136 | - * |
|
137 | - * @return Forward |
|
138 | - */ |
|
132 | + /** |
|
133 | + * @param ContainerInterface $container |
|
134 | + * @param $requestedName |
|
135 | + * @param array $options |
|
136 | + * |
|
137 | + * @return Forward |
|
138 | + */ |
|
139 | 139 | static public function factory(ContainerInterface $container,$requestedName,array $options=[]) |
140 | 140 | { |
141 | 141 | $ob = new self($options); |
@@ -136,7 +136,7 @@ |
||
136 | 136 | * |
137 | 137 | * @return Forward |
138 | 138 | */ |
139 | - static public function factory(ContainerInterface $container,$requestedName,array $options=[]) |
|
139 | + static public function factory(ContainerInterface $container, $requestedName, array $options = []) |
|
140 | 140 | { |
141 | 141 | $ob = new self($options); |
142 | 142 | $ob->setContainer($container); |
@@ -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() |