@@ -128,7 +128,6 @@ |
||
128 | 128 | } |
129 | 129 | |
130 | 130 | /** |
131 | - * @param ControllerManager $controllerManager |
|
132 | 131 | * @return CreatePaginator |
133 | 132 | * @codeCoverageIgnore |
134 | 133 | */ |
@@ -44,12 +44,12 @@ discard block |
||
44 | 44 | */ |
45 | 45 | protected $request; |
46 | 46 | |
47 | - /** |
|
48 | - * CreatePaginator constructor. |
|
49 | - * |
|
50 | - * @param ContainerInterface $container |
|
51 | - * @param HttpRequest $request |
|
52 | - */ |
|
47 | + /** |
|
48 | + * CreatePaginator constructor. |
|
49 | + * |
|
50 | + * @param ContainerInterface $container |
|
51 | + * @param HttpRequest $request |
|
52 | + */ |
|
53 | 53 | public function __construct(ContainerInterface $container, HttpRequest $request) |
54 | 54 | { |
55 | 55 | $this->serviceManager = $container->get('ServiceManager'); |
@@ -105,9 +105,9 @@ discard block |
||
105 | 105 | /* @var \Core\EventManager\EventManager $events */ |
106 | 106 | /* @var \Zend\Paginator\Paginator $paginator */ |
107 | 107 | /* @var CreatePaginatorEvent $event */ |
108 | - $events = $this->serviceManager->get('Core/CreatePaginator/Events'); |
|
108 | + $events = $this->serviceManager->get('Core/CreatePaginator/Events'); |
|
109 | 109 | |
110 | - $event = $events->getEvent(CreatePaginatorEvent::EVENT_CREATE_PAGINATOR,$this,[ |
|
110 | + $event = $events->getEvent(CreatePaginatorEvent::EVENT_CREATE_PAGINATOR,$this,[ |
|
111 | 111 | 'paginatorParams' => $params, |
112 | 112 | 'paginators' => $paginators, |
113 | 113 | 'paginatorName' => $paginatorName |
@@ -121,8 +121,8 @@ discard block |
||
121 | 121 | $paginator = $paginators->get($paginatorName,$params); |
122 | 122 | } |
123 | 123 | $paginator->setCurrentPageNumber(isset($params['page']) ? $params['page'] : 1) |
124 | - ->setItemCountPerPage(isset($params['count']) ? $params['count'] : 10) |
|
125 | - ->setPageRange(isset($params['range']) ? $params['range'] : 5); |
|
124 | + ->setItemCountPerPage(isset($params['count']) ? $params['count'] : 10) |
|
125 | + ->setPageRange(isset($params['range']) ? $params['range'] : 5); |
|
126 | 126 | |
127 | 127 | return $paginator; |
128 | 128 | } |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | /* @var CreatePaginatorEvent $event */ |
108 | 108 | $events = $this->serviceManager->get('Core/CreatePaginator/Events'); |
109 | 109 | |
110 | - $event = $events->getEvent(CreatePaginatorEvent::EVENT_CREATE_PAGINATOR,$this,[ |
|
110 | + $event = $events->getEvent(CreatePaginatorEvent::EVENT_CREATE_PAGINATOR, $this, [ |
|
111 | 111 | 'paginatorParams' => $params, |
112 | 112 | 'paginators' => $paginators, |
113 | 113 | 'paginatorName' => $paginatorName |
@@ -116,9 +116,9 @@ discard block |
||
116 | 116 | |
117 | 117 | $paginator = $event->getPaginator(); |
118 | 118 | |
119 | - if(!$paginator instanceof Paginator){ |
|
119 | + if (!$paginator instanceof Paginator) { |
|
120 | 120 | // no paginator created by listener, so let's create default paginator |
121 | - $paginator = $paginators->get($paginatorName,$params); |
|
121 | + $paginator = $paginators->get($paginatorName, $params); |
|
122 | 122 | } |
123 | 123 | $paginator->setCurrentPageNumber(isset($params['page']) ? $params['page'] : 1) |
124 | 124 | ->setItemCountPerPage(isset($params['count']) ? $params['count'] : 10) |
@@ -60,8 +60,8 @@ |
||
60 | 60 | * |
61 | 61 | * If no event instance is passed, it creates one prior to triggering. |
62 | 62 | * |
63 | - * @param EventInterface|string $eventName |
|
64 | - * @param object|string|null $target |
|
63 | + * @param EventInterface $eventName |
|
64 | + * @param \Core\Controller\AdminController $target |
|
65 | 65 | * @param array $argv |
66 | 66 | * |
67 | 67 | * @return \Zend\EventManager\ResponseCollection |
@@ -55,8 +55,8 @@ discard block |
||
55 | 55 | return $event; |
56 | 56 | } |
57 | 57 | |
58 | - /** |
|
59 | - * Trigger an event. |
|
58 | + /** |
|
59 | + * Trigger an event. |
|
60 | 60 | * |
61 | 61 | * If no event instance is passed, it creates one prior to triggering. |
62 | 62 | * |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | * @param array $argv |
66 | 66 | * |
67 | 67 | * @return \Zend\EventManager\ResponseCollection |
68 | - */ |
|
68 | + */ |
|
69 | 69 | public function trigger($eventName, $target = null, $argv = []) |
70 | 70 | { |
71 | 71 | $event = $eventName instanceOf EventInterface |
@@ -58,7 +58,7 @@ |
||
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
61 | - * @return mixed |
|
61 | + * @return null|string |
|
62 | 62 | */ |
63 | 63 | abstract protected function getUri(); |
64 | 64 |
@@ -38,15 +38,15 @@ |
||
38 | 38 | */ |
39 | 39 | protected $serviceLocator; |
40 | 40 | |
41 | - public function __invoke( ContainerInterface $container, $requestedName, array $options = null ) |
|
42 | - { |
|
43 | - $this->serviceLocator = $container; |
|
44 | - $service = new RestClient($this->getUri(), $this->getConfig()); |
|
45 | - return $service; |
|
46 | - } |
|
41 | + public function __invoke( ContainerInterface $container, $requestedName, array $options = null ) |
|
42 | + { |
|
43 | + $this->serviceLocator = $container; |
|
44 | + $service = new RestClient($this->getUri(), $this->getConfig()); |
|
45 | + return $service; |
|
46 | + } |
|
47 | 47 | |
48 | 48 | |
49 | - /** |
|
49 | + /** |
|
50 | 50 | * Create the settings service |
51 | 51 | * |
52 | 52 | * @param ServiceLocatorInterface $serviceLocator |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | */ |
39 | 39 | protected $serviceLocator; |
40 | 40 | |
41 | - public function __invoke( ContainerInterface $container, $requestedName, array $options = null ) |
|
41 | + public function __invoke(ContainerInterface $container, $requestedName, array $options = null) |
|
42 | 42 | { |
43 | 43 | $this->serviceLocator = $container; |
44 | 44 | $service = new RestClient($this->getUri(), $this->getConfig()); |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | */ |
55 | 55 | public function createService(ServiceLocatorInterface $serviceLocator) |
56 | 56 | { |
57 | - return $this($serviceLocator,RestClient::class); |
|
57 | + return $this($serviceLocator, RestClient::class); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
@@ -31,7 +31,7 @@ |
||
31 | 31 | * @param string $requestedName |
32 | 32 | * @param null|array $options |
33 | 33 | * |
34 | - * @return object |
|
34 | + * @return Locale |
|
35 | 35 | * @throws ServiceNotFoundException if unable to resolve the service. |
36 | 36 | * @throws ServiceNotCreatedException if an exception is raised when |
37 | 37 | * creating a service. |
@@ -41,7 +41,6 @@ |
||
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
44 | - * @param ContainerInterface $serviceLocator |
|
45 | 44 | * @return mixed|Paginator |
46 | 45 | */ |
47 | 46 | public function createService(ContainerInterface $container) |
@@ -28,19 +28,19 @@ |
||
28 | 28 | |
29 | 29 | public function __invoke( ContainerInterface $container, $requestedName, array $options = null ) |
30 | 30 | { |
31 | - /* @var PaginatorService $paginatorService */ |
|
32 | - /* @var RepositoryService $repositories */ |
|
33 | - $repositories = $container->get('repositories'); |
|
34 | - $repository = $repositories->get($this->getRepository()); |
|
35 | - $queryBuilder = $repository->createQueryBuilder(); |
|
36 | - $filter = $container->get('FilterManager')->get($this->getFilter()); |
|
37 | - $adapter = new \Core\Paginator\Adapter\DoctrineMongoLateCursor($queryBuilder, $filter, $options); |
|
38 | - $service = new Paginator($adapter); |
|
31 | + /* @var PaginatorService $paginatorService */ |
|
32 | + /* @var RepositoryService $repositories */ |
|
33 | + $repositories = $container->get('repositories'); |
|
34 | + $repository = $repositories->get($this->getRepository()); |
|
35 | + $queryBuilder = $repository->createQueryBuilder(); |
|
36 | + $filter = $container->get('FilterManager')->get($this->getFilter()); |
|
37 | + $adapter = new \Core\Paginator\Adapter\DoctrineMongoLateCursor($queryBuilder, $filter, $options); |
|
38 | + $service = new Paginator($adapter); |
|
39 | 39 | |
40 | - return $service; |
|
40 | + return $service; |
|
41 | 41 | } |
42 | 42 | |
43 | - /** |
|
43 | + /** |
|
44 | 44 | * @param ContainerInterface $serviceLocator |
45 | 45 | * @return mixed|Paginator |
46 | 46 | */ |
@@ -26,7 +26,7 @@ |
||
26 | 26 | abstract class PaginatorFactoryAbstract implements FactoryInterface |
27 | 27 | { |
28 | 28 | |
29 | - public function __invoke( ContainerInterface $container, $requestedName, array $options = null ) |
|
29 | + public function __invoke(ContainerInterface $container, $requestedName, array $options = null) |
|
30 | 30 | { |
31 | 31 | /* @var PaginatorService $paginatorService */ |
32 | 32 | /* @var RepositoryService $repositories */ |
@@ -86,7 +86,6 @@ |
||
86 | 86 | } |
87 | 87 | |
88 | 88 | /** |
89 | - * @param HelperPluginManager $helperPluginManager |
|
90 | 89 | * @return Services |
91 | 90 | */ |
92 | 91 | public static function factory($sm) |
@@ -11,23 +11,23 @@ |
||
11 | 11 | */ |
12 | 12 | |
13 | 13 | return array( |
14 | - 'Zend\ServiceManager\Di', |
|
15 | - 'Zend\Session', |
|
16 | - 'Zend\Router', |
|
17 | - 'Zend\Navigation', |
|
18 | - 'Zend\I18n', |
|
19 | - 'Zend\Filter', |
|
20 | - 'Zend\InputFilter', |
|
21 | - 'Zend\Form', |
|
22 | - 'Zend\Validator', |
|
23 | - 'Zend\Log', |
|
24 | - 'Zend\Mvc\Plugin\Prg', |
|
25 | - 'Zend\Mvc\Plugin\Identity', |
|
26 | - 'Zend\Mvc\Plugin\FlashMessenger', |
|
27 | - 'Zend\Mvc\I18n', |
|
28 | - 'Zend\Mvc\Console', |
|
29 | - 'Zend\Hydrator', |
|
30 | - 'Zend\Serializer', |
|
31 | - 'DoctrineModule', |
|
32 | - 'DoctrineMongoODMModule', |
|
14 | + 'Zend\ServiceManager\Di', |
|
15 | + 'Zend\Session', |
|
16 | + 'Zend\Router', |
|
17 | + 'Zend\Navigation', |
|
18 | + 'Zend\I18n', |
|
19 | + 'Zend\Filter', |
|
20 | + 'Zend\InputFilter', |
|
21 | + 'Zend\Form', |
|
22 | + 'Zend\Validator', |
|
23 | + 'Zend\Log', |
|
24 | + 'Zend\Mvc\Plugin\Prg', |
|
25 | + 'Zend\Mvc\Plugin\Identity', |
|
26 | + 'Zend\Mvc\Plugin\FlashMessenger', |
|
27 | + 'Zend\Mvc\I18n', |
|
28 | + 'Zend\Mvc\Console', |
|
29 | + 'Zend\Hydrator', |
|
30 | + 'Zend\Serializer', |
|
31 | + 'DoctrineModule', |
|
32 | + 'DoctrineMongoODMModule', |
|
33 | 33 | ); |
34 | 34 | \ No newline at end of file |
@@ -26,18 +26,18 @@ |
||
26 | 26 | */ |
27 | 27 | public function register(array $config) |
28 | 28 | { |
29 | - try{ |
|
30 | - // enable logging of all error types globally |
|
31 | - Debugger::enable($config['mode'], $config['log'], $config['email']); |
|
32 | - Debugger::$strictMode = $config['strict']; |
|
33 | - Debugger::$showBar = $config['bar']; |
|
29 | + try{ |
|
30 | + // enable logging of all error types globally |
|
31 | + Debugger::enable($config['mode'], $config['log'], $config['email']); |
|
32 | + Debugger::$strictMode = $config['strict']; |
|
33 | + Debugger::$showBar = $config['bar']; |
|
34 | 34 | |
35 | - /** @var \Tracy\Logger $logger */ |
|
36 | - $logger = Debugger::getLogger(); |
|
37 | - $logger->emailSnooze = $config['email_snooze']; |
|
38 | - }catch (\Exception $e){ |
|
39 | - throw $e; |
|
40 | - } |
|
35 | + /** @var \Tracy\Logger $logger */ |
|
36 | + $logger = Debugger::getLogger(); |
|
37 | + $logger->emailSnooze = $config['email_snooze']; |
|
38 | + }catch (\Exception $e){ |
|
39 | + throw $e; |
|
40 | + } |
|
41 | 41 | |
42 | 42 | } |
43 | 43 | } |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | */ |
27 | 27 | public function register(array $config) |
28 | 28 | { |
29 | - try{ |
|
29 | + try { |
|
30 | 30 | // enable logging of all error types globally |
31 | 31 | Debugger::enable($config['mode'], $config['log'], $config['email']); |
32 | 32 | Debugger::$strictMode = $config['strict']; |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | /** @var \Tracy\Logger $logger */ |
36 | 36 | $logger = Debugger::getLogger(); |
37 | 37 | $logger->emailSnooze = $config['email_snooze']; |
38 | - }catch (\Exception $e){ |
|
38 | + } catch (\Exception $e) { |
|
39 | 39 | throw $e; |
40 | 40 | } |
41 | 41 |
@@ -35,7 +35,7 @@ |
||
35 | 35 | /** @var \Tracy\Logger $logger */ |
36 | 36 | $logger = Debugger::getLogger(); |
37 | 37 | $logger->emailSnooze = $config['email_snooze']; |
38 | - }catch (\Exception $e){ |
|
38 | + } catch (\Exception $e){ |
|
39 | 39 | throw $e; |
40 | 40 | } |
41 | 41 |
@@ -23,31 +23,31 @@ |
||
23 | 23 | */ |
24 | 24 | class TracyListener implements ListenerAggregateInterface |
25 | 25 | { |
26 | - use ListenerAggregateTrait; |
|
26 | + use ListenerAggregateTrait; |
|
27 | 27 | |
28 | - /** |
|
29 | - * {@inheritDoc} |
|
30 | - * @see \Zend\EventManager\ListenerAggregateInterface::attach() |
|
31 | - */ |
|
32 | - public function attach(EventManagerInterface $events, $priority = 1) |
|
33 | - { |
|
34 | - $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH_ERROR, [$this, 'handleError'], $priority); |
|
35 | - $this->listeners[] = $events->attach(MvcEvent::EVENT_RENDER_ERROR, [$this, 'handleError'], $priority); |
|
36 | - } |
|
28 | + /** |
|
29 | + * {@inheritDoc} |
|
30 | + * @see \Zend\EventManager\ListenerAggregateInterface::attach() |
|
31 | + */ |
|
32 | + public function attach(EventManagerInterface $events, $priority = 1) |
|
33 | + { |
|
34 | + $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH_ERROR, [$this, 'handleError'], $priority); |
|
35 | + $this->listeners[] = $events->attach(MvcEvent::EVENT_RENDER_ERROR, [$this, 'handleError'], $priority); |
|
36 | + } |
|
37 | 37 | |
38 | - /** |
|
39 | - * @param MvcEvent $e |
|
40 | - */ |
|
41 | - public function handleError(MvcEvent $e) |
|
42 | - { |
|
43 | - if ($e->getError() == \Zend\Mvc\Application::ERROR_EXCEPTION) { |
|
44 | - if (Debugger::$productionMode) { |
|
45 | - // log an exception in production environment (this will send email as well if email address is set) |
|
46 | - Debugger::log($e->getParam('exception'), Debugger::ERROR); |
|
47 | - } else { |
|
48 | - // just re-throw an exception in non-production environment to let tracy display so called blue screen |
|
49 | - throw $e->getParam('exception'); |
|
50 | - } |
|
51 | - } |
|
52 | - } |
|
38 | + /** |
|
39 | + * @param MvcEvent $e |
|
40 | + */ |
|
41 | + public function handleError(MvcEvent $e) |
|
42 | + { |
|
43 | + if ($e->getError() == \Zend\Mvc\Application::ERROR_EXCEPTION) { |
|
44 | + if (Debugger::$productionMode) { |
|
45 | + // log an exception in production environment (this will send email as well if email address is set) |
|
46 | + Debugger::log($e->getParam('exception'), Debugger::ERROR); |
|
47 | + } else { |
|
48 | + // just re-throw an exception in non-production environment to let tracy display so called blue screen |
|
49 | + throw $e->getParam('exception'); |
|
50 | + } |
|
51 | + } |
|
52 | + } |
|
53 | 53 | } |