@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | |
72 | 72 | public function testDoesDeleteJobIfProcessedSuccessfully() |
73 | 73 | { |
74 | - /* @var AbstractJob $jobMock */ |
|
74 | + /* @var AbstractJob $jobMock */ |
|
75 | 75 | $job = $this->prophesize(AbstractJob::class); |
76 | 76 | $job->execute()->willReturn(ProcessJobEvent::JOB_STATUS_SUCCESS); |
77 | 77 | $jobMock = $job->reveal(); |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | { |
91 | 91 | $options = ['delay' => 10]; |
92 | 92 | |
93 | - /* @var AbstractJob $jobMock */ |
|
93 | + /* @var AbstractJob $jobMock */ |
|
94 | 94 | $job = $this->prophesize(AbstractJob::class); |
95 | 95 | $job->execute()->willThrow(new RecoverableJobException('test recoverable', $options)); |
96 | 96 | $jobMock = $job->reveal(); |
@@ -41,12 +41,12 @@ |
||
41 | 41 | private $target = [ |
42 | 42 | MongoWorker::class, |
43 | 43 | 'setupConstructorArgs', |
44 | - '@testInheritance' => [ 'as_reflection' => true ] |
|
44 | + '@testInheritance' => ['as_reflection' => true] |
|
45 | 45 | ]; |
46 | 46 | |
47 | 47 | private $eventsMock; |
48 | 48 | |
49 | - private $inheritance = [ AbstractWorker::class ]; |
|
49 | + private $inheritance = [AbstractWorker::class]; |
|
50 | 50 | |
51 | 51 | private function setupConstructorArgs() |
52 | 52 | { |
@@ -30,5 +30,5 @@ |
||
30 | 30 | 'as_reflection' => true, |
31 | 31 | ]; |
32 | 32 | |
33 | - private $inheritance = [ AbstractWorkerController::class ]; |
|
33 | + private $inheritance = [AbstractWorkerController::class]; |
|
34 | 34 | } |
@@ -32,7 +32,7 @@ |
||
32 | 32 | |
33 | 33 | private $target = MongoQueueControllerFactory::class; |
34 | 34 | |
35 | - private $inheritance = [ FactoryInterface::class ]; |
|
35 | + private $inheritance = [FactoryInterface::class]; |
|
36 | 36 | |
37 | 37 | public function testCreateService() |
38 | 38 | { |
@@ -30,7 +30,7 @@ |
||
30 | 30 | |
31 | 31 | private $target = MongoQueueListControllerFactory::class; |
32 | 32 | |
33 | - private $inheritance = [ FactoryInterface::class ]; |
|
33 | + private $inheritance = [FactoryInterface::class]; |
|
34 | 34 | |
35 | 35 | public function testCreateService() |
36 | 36 | { |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | { |
112 | 112 | $queueName = 'test'; |
113 | 113 | $queue = $this->getMockBuilder(MongoQueue::class)->disableOriginalConstructor() |
114 | - ->setMethods(['listing'])->getMock(); |
|
114 | + ->setMethods(['listing'])->getMock(); |
|
115 | 115 | $this->queueManager->expects($this->once())->method('get')->with($queueName)->willReturn($queue); |
116 | 116 | $params = $this->setupParamsMock([ |
117 | 117 | ['queue', null, $queueName], |
@@ -135,13 +135,13 @@ discard block |
||
135 | 135 | $date = new \DateTime(); |
136 | 136 | $date->setTimezone(new \DateTimeZone('UTC')); |
137 | 137 | $jobs = [ |
138 | - [ |
|
139 | - 'job' => $job, |
|
140 | - 'created' => new \MongoDb\BSON\UTCDateTime($date->getTimestamp() * 1000), |
|
141 | - 'executed' => new \MongoDb\BSON\UTCDateTime($date->getTimestamp() * 1000), |
|
142 | - 'scheduled' => new \MongoDb\BSON\UTCDateTime($date->getTimestamp() * 1000), |
|
143 | - 'tried' => 10, |
|
144 | - ], |
|
138 | + [ |
|
139 | + 'job' => $job, |
|
140 | + 'created' => new \MongoDb\BSON\UTCDateTime($date->getTimestamp() * 1000), |
|
141 | + 'executed' => new \MongoDb\BSON\UTCDateTime($date->getTimestamp() * 1000), |
|
142 | + 'scheduled' => new \MongoDb\BSON\UTCDateTime($date->getTimestamp() * 1000), |
|
143 | + 'tried' => 10, |
|
144 | + ], |
|
145 | 145 | ]; |
146 | 146 | |
147 | 147 | $queue->expects($this->once())->method('listing')->with(['limit' => 10, 'status' => 1])->willReturn($jobs); |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | ], |
45 | 45 | ]; |
46 | 46 | |
47 | - private $inheritance = [ AbstractConsoleController::class ]; |
|
47 | + private $inheritance = [AbstractConsoleController::class]; |
|
48 | 48 | |
49 | 49 | private function injectConstructorDependencies() |
50 | 50 | { |
@@ -149,11 +149,11 @@ discard block |
||
149 | 149 | $lineTmpl = '%-20s %s'; |
150 | 150 | $console = $this->target->getConsole(); |
151 | 151 | $console->expects($this->exactly(7))->method('writeLine')->withConsecutive( |
152 | - [ get_class($job) . ' [ test ]' ], |
|
153 | - [ sprintf($lineTmpl, 'Created', $date->format('Y-m-d H:i:s')) ], |
|
154 | - [ sprintf($lineTmpl, 'Executed', $date->format('Y-m-d H:i:s')) ], |
|
155 | - [ sprintf($lineTmpl, 'Scheduled', $date->format('Y-m-d H:i:s')) ], |
|
156 | - [ sprintf($lineTmpl, 'Tries', $jobs[0]['tried']) ] |
|
152 | + [get_class($job).' [ test ]'], |
|
153 | + [sprintf($lineTmpl, 'Created', $date->format('Y-m-d H:i:s'))], |
|
154 | + [sprintf($lineTmpl, 'Executed', $date->format('Y-m-d H:i:s'))], |
|
155 | + [sprintf($lineTmpl, 'Scheduled', $date->format('Y-m-d H:i:s'))], |
|
156 | + [sprintf($lineTmpl, 'Tries', $jobs[0]['tried'])] |
|
157 | 157 | )->willReturn(null); |
158 | 158 | |
159 | 159 | $this->assertEmpty($this->target->listAction()); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | */ |
37 | 37 | private $target = MongoQueueFactory::class; |
38 | 38 | |
39 | - private $inheritance = [ FactoryInterface::class ]; |
|
39 | + private $inheritance = [FactoryInterface::class]; |
|
40 | 40 | |
41 | 41 | public function testCreateServiceWithoutConfig() |
42 | 42 | { |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | { |
60 | 60 | $this->client = $client; |
61 | 61 | } |
62 | - public function getMongoClient() { return $this->client;} |
|
62 | + public function getMongoClient() { return $this->client; } |
|
63 | 63 | })->shouldBeCalled(); |
64 | 64 | |
65 | 65 | $dm->getConfiguration()->willReturn(new class { public function getDefaultDB() { return 'testdb'; }})->shouldBeCalled(); |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | { |
99 | 99 | $this->client = $client; |
100 | 100 | } |
101 | - public function getMongoClient() { return $this->client;} |
|
101 | + public function getMongoClient() { return $this->client; } |
|
102 | 102 | })->shouldBeCalled(); |
103 | 103 | |
104 | 104 | $dm->getConfiguration()->shouldNotBeCalled(); |
@@ -27,7 +27,7 @@ |
||
27 | 27 | |
28 | 28 | private $target = ProcessId::class; |
29 | 29 | |
30 | - private $inheritance = [ ProcessorInterface::class ]; |
|
30 | + private $inheritance = [ProcessorInterface::class]; |
|
31 | 31 | |
32 | 32 | public function testProcessAddsProcessIdToEventArray() |
33 | 33 | { |
@@ -76,25 +76,25 @@ |
||
76 | 76 | 'log' => array( |
77 | 77 | 'Core/Log' => array( |
78 | 78 | 'writers' => array( |
79 | - array( |
|
80 | - 'name' => 'stream', |
|
79 | + array( |
|
80 | + 'name' => 'stream', |
|
81 | 81 | 'priority' => 1000, |
82 | 82 | 'options' => array( |
83 | - 'stream' => getcwd().'/var/log/yawik.log', |
|
83 | + 'stream' => getcwd().'/var/log/yawik.log', |
|
84 | + ), |
|
84 | 85 | ), |
85 | - ), |
|
86 | 86 | ), |
87 | 87 | ), |
88 | 88 | 'Log/Core/Mail' => array( |
89 | 89 | 'writers' => array( |
90 | - array( |
|
91 | - 'name' => 'stream', |
|
90 | + array( |
|
91 | + 'name' => 'stream', |
|
92 | 92 | 'priority' => 1000, |
93 | 93 | 'options' => array( |
94 | - 'stream' => getcwd().'/var/log/mails.log', |
|
94 | + 'stream' => getcwd().'/var/log/mails.log', |
|
95 | 95 | ), |
96 | 96 | |
97 | - ), |
|
97 | + ), |
|
98 | 98 | ), |
99 | 99 | ), |
100 | 100 | 'Log/Core/Queue' => array( |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | use Core\Service\Tracy; |
23 | 23 | use Zend\I18n\Translator\Resources; |
24 | 24 | |
25 | -$doctrineConfig = include __DIR__ . '/doctrine.config.php'; |
|
25 | +$doctrineConfig = include __DIR__.'/doctrine.config.php'; |
|
26 | 26 | |
27 | 27 | |
28 | 28 | return array( |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | ], |
62 | 62 | |
63 | 63 | 'options' => [ |
64 | - 'Core/MailServiceOptions' => [ 'class' => '\Core\Options\MailServiceOptions' ], |
|
64 | + 'Core/MailServiceOptions' => ['class' => '\Core\Options\MailServiceOptions'], |
|
65 | 65 | ], |
66 | 66 | |
67 | 67 | 'Core' => array( |
@@ -339,19 +339,19 @@ discard block |
||
339 | 339 | 'modules/Core/jsonEntityHydrator' => 'Core\Entity\Hydrator\JsonEntityHydratorFactory', |
340 | 340 | 'Core/EntityHydrator' => 'Core\Entity\Hydrator\EntityHydratorFactory', |
341 | 341 | 'Core/Options' => 'Core\Factory\ModuleOptionsFactory', |
342 | - 'Core/DoctrineMongoODM/RepositoryEvents' => [\Core\Repository\DoctrineMongoODM\Event\RepositoryEventsSubscriber::class,'factory'], |
|
343 | - 'DefaultListeners' => ['Core\Listener\DefaultListener','factory'], |
|
344 | - 'templateProviderStrategy' => ['Core\Form\Hydrator\Strategy\TemplateProviderStrategy','factory'], |
|
345 | - 'Core/Listener/DeferredListenerAggregate' => [\Core\Listener\DeferredListenerAggregate::class,'factory'], |
|
342 | + 'Core/DoctrineMongoODM/RepositoryEvents' => [\Core\Repository\DoctrineMongoODM\Event\RepositoryEventsSubscriber::class, 'factory'], |
|
343 | + 'DefaultListeners' => ['Core\Listener\DefaultListener', 'factory'], |
|
344 | + 'templateProviderStrategy' => ['Core\Form\Hydrator\Strategy\TemplateProviderStrategy', 'factory'], |
|
345 | + 'Core/Listener/DeferredListenerAggregate' => [\Core\Listener\DeferredListenerAggregate::class, 'factory'], |
|
346 | 346 | 'Core/Listener/CreatePaginator' => 'Core\Listener\CreatePaginatorListener::factory', |
347 | 347 | 'Core/Locale' => 'Core\I18n\LocaleFactory', |
348 | 348 | \Core\Listener\AjaxRouteListener::class => \Core\Factory\Listener\AjaxRouteListenerFactory::class, |
349 | 349 | \Core\Listener\DeleteImageSetListener::class => \Core\Factory\Listener\DeleteImageSetListenerFactory::class, |
350 | 350 | 'Imagine' => \Core\Factory\Service\ImagineFactory::class, |
351 | - 'Core/Listener/Notification' => [\Core\Listener\NotificationListener::class,'factory'], |
|
352 | - 'Tracy' => [Tracy::class,'factory'], |
|
351 | + 'Core/Listener/Notification' => [\Core\Listener\NotificationListener::class, 'factory'], |
|
352 | + 'Tracy' => [Tracy::class, 'factory'], |
|
353 | 353 | Service\EntityEraser\DefaultEntityLoaderListener::class => Service\EntityEraser\DefaultEntityLoaderListenerFactory::class, |
354 | - ClearCacheService::class => [ClearCacheService::class,'factory'], |
|
354 | + ClearCacheService::class => [ClearCacheService::class, 'factory'], |
|
355 | 355 | Queue\Worker\MongoWorker::class => \SlmQueue\Factory\WorkerFactory::class, |
356 | 356 | ), |
357 | 357 | 'abstract_factories' => array( |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | 'translation_file_patterns' => array( |
376 | 376 | [ |
377 | 377 | 'type' => 'gettext', |
378 | - 'base_dir' => __DIR__ . '/../language', |
|
378 | + 'base_dir' => __DIR__.'/../language', |
|
379 | 379 | 'pattern' => '%s.mo', |
380 | 380 | ], |
381 | 381 | [ |
@@ -420,8 +420,8 @@ discard block |
||
420 | 420 | 'Core/File' => FileControllerFactory::class, |
421 | 421 | 'Core/Content' => LazyControllerFactory::class, |
422 | 422 | Controller\Console\PurgeController::class => Controller\Console\PurgeControllerFactory::class, |
423 | - AssetsInstallController::class => [AssetsInstallController::class,'factory'], |
|
424 | - ClearCacheController::class => [ClearCacheController::class,'factory'], |
|
423 | + AssetsInstallController::class => [AssetsInstallController::class, 'factory'], |
|
424 | + ClearCacheController::class => [ClearCacheController::class, 'factory'], |
|
425 | 425 | Queue\Controller\MongoQueueController::class => Queue\Controller\MongoQueueControllerFactory::class, |
426 | 426 | Queue\Controller\MongoQueueListController::class => Queue\Controller\MongoQueueListControllerFactory::class, |
427 | 427 | |
@@ -436,9 +436,9 @@ discard block |
||
436 | 436 | 'Core/SearchForm' => 'Core\Factory\Controller\Plugin\SearchFormFactory', |
437 | 437 | 'listquery' => 'Core\Controller\Plugin\ListQuery::factory', |
438 | 438 | 'mail' => 'Core\Controller\Plugin\Mail::factory', |
439 | - 'Core/Mailer' => ['Core\Controller\Plugin\Mailer','factory'], |
|
440 | - 'Core/CreatePaginator' => [\Core\Controller\Plugin\CreatePaginator::class,'factory'], |
|
441 | - 'Core/PaginatorService' => [\Core\Controller\Plugin\CreatePaginatorService::class,'factory'], |
|
439 | + 'Core/Mailer' => ['Core\Controller\Plugin\Mailer', 'factory'], |
|
440 | + 'Core/CreatePaginator' => [\Core\Controller\Plugin\CreatePaginator::class, 'factory'], |
|
441 | + 'Core/PaginatorService' => [\Core\Controller\Plugin\CreatePaginatorService::class, 'factory'], |
|
442 | 442 | Controller\Plugin\EntityEraser::class => Controller\Plugin\EntityEraserFactory::class, |
443 | 443 | ), |
444 | 444 | 'invokables' => array( |
@@ -469,32 +469,32 @@ discard block |
||
469 | 469 | 'exception_template' => 'error/index', |
470 | 470 | // Map template to files. Speeds up the lookup through the template stack. |
471 | 471 | 'template_map' => array( |
472 | - 'noscript-notice' => __DIR__ . '/../view/layout/_noscript-notice.phtml', |
|
473 | - 'layout/layout' => __DIR__ . '/../view/layout/layout.phtml', |
|
474 | - 'error/404' => __DIR__ . '/../view/error/404.phtml', |
|
475 | - 'error/403' => __DIR__ . '/../view/error/403.phtml', |
|
476 | - 'error/index' => __DIR__ . '/../view/error/index.phtml', |
|
477 | - 'main-navigation' => __DIR__ . '/../view/partial/main-navigation.phtml', |
|
478 | - 'pagination-control' => __DIR__ . '/../view/partial/pagination-control.phtml', |
|
479 | - 'core/loading-popup' => __DIR__ . '/../view/partial/loading-popup.phtml', |
|
480 | - 'core/notifications' => __DIR__ . '/../view/partial/notifications.phtml', |
|
481 | - 'form/core/buttons' => __DIR__ . '/../view/form/buttons.phtml', |
|
482 | - 'core/social-buttons' => __DIR__ . '/../view/partial/social-buttons.phtml', |
|
483 | - 'form/core/privacy' => __DIR__ . '/../view/form/privacy.phtml', |
|
484 | - 'core/form/permissions-fieldset' => __DIR__ . '/../view/form/permissions-fieldset.phtml', |
|
485 | - 'core/form/permissions-collection' => __DIR__ . '/../view/form/permissions-collection.phtml', |
|
486 | - 'core/form/container-view' => __DIR__ . '/../view/form/container.view.phtml', |
|
487 | - 'core/form/tree-manage.view' => __DIR__ . '/../view/form/tree-manage.view.phtml', |
|
488 | - 'core/form/tree-manage.form' => __DIR__ . '/../view/form/tree-manage.form.phtml', |
|
489 | - 'core/form/tree-add-item' => __DIR__ . '/../view/form/tree-add-item.phtml', |
|
490 | - 'mail/header' => __DIR__ . '/../view/mail/header.phtml', |
|
491 | - 'mail/footer' => __DIR__ . '/../view/mail/footer.phtml', |
|
492 | - 'mail/footer.en' => __DIR__ . '/../view/mail/footer.en.phtml', |
|
472 | + 'noscript-notice' => __DIR__.'/../view/layout/_noscript-notice.phtml', |
|
473 | + 'layout/layout' => __DIR__.'/../view/layout/layout.phtml', |
|
474 | + 'error/404' => __DIR__.'/../view/error/404.phtml', |
|
475 | + 'error/403' => __DIR__.'/../view/error/403.phtml', |
|
476 | + 'error/index' => __DIR__.'/../view/error/index.phtml', |
|
477 | + 'main-navigation' => __DIR__.'/../view/partial/main-navigation.phtml', |
|
478 | + 'pagination-control' => __DIR__.'/../view/partial/pagination-control.phtml', |
|
479 | + 'core/loading-popup' => __DIR__.'/../view/partial/loading-popup.phtml', |
|
480 | + 'core/notifications' => __DIR__.'/../view/partial/notifications.phtml', |
|
481 | + 'form/core/buttons' => __DIR__.'/../view/form/buttons.phtml', |
|
482 | + 'core/social-buttons' => __DIR__.'/../view/partial/social-buttons.phtml', |
|
483 | + 'form/core/privacy' => __DIR__.'/../view/form/privacy.phtml', |
|
484 | + 'core/form/permissions-fieldset' => __DIR__.'/../view/form/permissions-fieldset.phtml', |
|
485 | + 'core/form/permissions-collection' => __DIR__.'/../view/form/permissions-collection.phtml', |
|
486 | + 'core/form/container-view' => __DIR__.'/../view/form/container.view.phtml', |
|
487 | + 'core/form/tree-manage.view' => __DIR__.'/../view/form/tree-manage.view.phtml', |
|
488 | + 'core/form/tree-manage.form' => __DIR__.'/../view/form/tree-manage.form.phtml', |
|
489 | + 'core/form/tree-add-item' => __DIR__.'/../view/form/tree-add-item.phtml', |
|
490 | + 'mail/header' => __DIR__.'/../view/mail/header.phtml', |
|
491 | + 'mail/footer' => __DIR__.'/../view/mail/footer.phtml', |
|
492 | + 'mail/footer.en' => __DIR__.'/../view/mail/footer.en.phtml', |
|
493 | 493 | //'startpage' => __DIR__ . '/../view/layout/startpage.phtml', |
494 | 494 | ), |
495 | 495 | // Where to look for view templates not mapped above |
496 | 496 | 'template_path_stack' => array( |
497 | - __DIR__ . '/../view', |
|
497 | + __DIR__.'/../view', |
|
498 | 498 | ), |
499 | 499 | ), |
500 | 500 | 'view_helpers' => array( |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | } |
73 | 73 | |
74 | 74 | if (!is_array($options)) { |
75 | - throw new \InvalidArgumentException('Options must be of type array or ' . LoggerInterface::class); |
|
75 | + throw new \InvalidArgumentException('Options must be of type array or '.LoggerInterface::class); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | parent::__construct($options); |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | */ |
283 | 283 | private function formatJob(JobInterface $job) : string |
284 | 284 | { |
285 | - return get_class($job) . ' [ ' . $job->getId() . ' ] '; |
|
285 | + return get_class($job).' [ '.$job->getId().' ] '; |
|
286 | 286 | } |
287 | 287 | |
288 | 288 | } |