@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | list($module, $entityName) = explode('.', $fileStoreName); |
76 | 76 | $response = $this->getResponse(); |
77 | 77 | $fileManager = $this->fileManager; |
78 | - $entityClass = $module . '\\Entity\\' . $entityName; |
|
78 | + $entityClass = $module.'\\Entity\\'.$entityName; |
|
79 | 79 | $fileId = $this->params('fileId', 0); |
80 | 80 | |
81 | 81 | if (preg_match('/^(.*)\..*$/', $fileId, $baseFileName)) { |
@@ -149,11 +149,11 @@ discard block |
||
149 | 149 | $events = $this->coreFileEvents; |
150 | 150 | $event = $events->getEvent(FileEvent::EVENT_DELETE, $this, ['file' => $file]); |
151 | 151 | |
152 | - $results = $events->triggerEventUntil(function ($r) { |
|
152 | + $results = $events->triggerEventUntil(function($r) { |
|
153 | 153 | return true === $r; |
154 | 154 | }, $event); |
155 | 155 | |
156 | - if(true !== $results->last()){ |
|
156 | + if (true !== $results->last()) { |
|
157 | 157 | $this->fileManager->remove($file, true); |
158 | 158 | } |
159 | 159 |
@@ -41,8 +41,8 @@ discard block |
||
41 | 41 | protected function setUp(): void |
42 | 42 | { |
43 | 43 | $this->target = $this->getMockBuilder('\Core\Factory\EventManager\EventManagerAbstractFactory') |
44 | - ->setMethods([ 'attachListeners', 'getConfig' ]) |
|
45 | - ->getMock(); |
|
44 | + ->setMethods([ 'attachListeners', 'getConfig' ]) |
|
45 | + ->getMock(); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | protected function setTargetConfig($config) |
@@ -69,9 +69,9 @@ discard block |
||
69 | 69 | protected function getServiceManagerMock($events, $args = []) |
70 | 70 | { |
71 | 71 | $services = $this->getMockBuilder('\Laminas\ServiceManager\ServiceManager') |
72 | - ->setMethods(['has', 'get', 'build']) |
|
73 | - ->disableOriginalConstructor() |
|
74 | - ->getMock(); |
|
72 | + ->setMethods(['has', 'get', 'build']) |
|
73 | + ->disableOriginalConstructor() |
|
74 | + ->getMock(); |
|
75 | 75 | |
76 | 76 | |
77 | 77 | if (is_Array($events)) { |
@@ -203,9 +203,9 @@ discard block |
||
203 | 203 | { |
204 | 204 | $event = new \Laminas\EventManager\Event(); |
205 | 205 | $events = $this->getMockBuilder('\Laminas\EventManager\EventManager') |
206 | - ->disableOriginalConstructor() |
|
207 | - ->setMethods(['setIdentifiers', 'setEventPrototype']) |
|
208 | - ->getMock() |
|
206 | + ->disableOriginalConstructor() |
|
207 | + ->setMethods(['setIdentifiers', 'setEventPrototype']) |
|
208 | + ->getMock() |
|
209 | 209 | ; |
210 | 210 | $events |
211 | 211 | ->expects($this->once()) |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | protected function setUp(): void |
42 | 42 | { |
43 | 43 | $this->target = $this->getMockBuilder('\Core\Factory\EventManager\EventManagerAbstractFactory') |
44 | - ->setMethods([ 'attachListeners', 'getConfig' ]) |
|
44 | + ->setMethods(['attachListeners', 'getConfig']) |
|
45 | 45 | ->getMock(); |
46 | 46 | } |
47 | 47 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | $config['listeners'] = []; |
55 | 55 | } |
56 | 56 | if (!isset($config['identifiers'])) { |
57 | - $config['identifiers'] = [ 'Test/Events/Manager' ]; |
|
57 | + $config['identifiers'] = ['Test/Events/Manager']; |
|
58 | 58 | } |
59 | 59 | if (!isset($config['event'])) { |
60 | 60 | $config['event'] = '\Laminas\EventManager\Event'; |
@@ -82,13 +82,13 @@ discard block |
||
82 | 82 | $eventsService = 'Test/Events/Manager'; |
83 | 83 | } |
84 | 84 | |
85 | - $hasMap = [ [ $eventsService, true ] ]; |
|
86 | - $getMap = [ [ $eventsService, $events ] ]; |
|
87 | - $buildMap = [ [ $eventsService, null, $events ] ]; |
|
85 | + $hasMap = [[$eventsService, true]]; |
|
86 | + $getMap = [[$eventsService, $events]]; |
|
87 | + $buildMap = [[$eventsService, null, $events]]; |
|
88 | 88 | |
89 | 89 | foreach ($args as $serviceName => $serviceValue) { |
90 | 90 | if (false === $serviceValue) { |
91 | - $hasMap[] = [ $serviceName, true ]; |
|
91 | + $hasMap[] = [$serviceName, true]; |
|
92 | 92 | } else { |
93 | 93 | if (is_array($serviceValue)) { |
94 | 94 | $serviceOptions = $serviceValu1[1] ?? null; |
@@ -96,9 +96,9 @@ discard block |
||
96 | 96 | } else { |
97 | 97 | $serviceOptions = null; |
98 | 98 | } |
99 | - $hasMap[] = [ $serviceName, true]; |
|
100 | - $getMap[] = [ $serviceName, $serviceValue ]; |
|
101 | - $buildMap[] = [ $serviceName, $serviceOptions, $serviceValue ]; |
|
99 | + $hasMap[] = [$serviceName, true]; |
|
100 | + $getMap[] = [$serviceName, $serviceValue]; |
|
101 | + $buildMap[] = [$serviceName, $serviceOptions, $serviceValue]; |
|
102 | 102 | } |
103 | 103 | } |
104 | 104 | |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | |
138 | 138 | $services->setFactory('Test/Events/Manager', $factory); |
139 | 139 | |
140 | - $this->setTargetConfig([ 'service' => 'Test/Events/Manager', 'configure' => false, 'listeners' => []]); |
|
140 | + $this->setTargetConfig(['service' => 'Test/Events/Manager', 'configure' => false, 'listeners' => []]); |
|
141 | 141 | |
142 | 142 | $this->target->expects($this->once())->method('attachListeners')->with($services, $events, []); |
143 | 143 | $this->target->createServiceWithName($services, 'irrelevant', 'Test/Events'); |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | |
146 | 146 | public function testInstatiatesEventManagerFromClassName() |
147 | 147 | { |
148 | - $this->setTargetConfig([ 'service' => '\Laminas\EventManager\EventManager', 'configure' => false, 'listeners' => []]); |
|
148 | + $this->setTargetConfig(['service' => '\Laminas\EventManager\EventManager', 'configure' => false, 'listeners' => []]); |
|
149 | 149 | |
150 | 150 | $services = new ServiceManager(); |
151 | 151 | $events = $this->target->createServiceWithName($services, 'irrelevant', 'irrelevant'); |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | $this->expectException(\UnexpectedValueException::class); |
159 | 159 | $this->expectExceptionMessage('Cannot create'); |
160 | 160 | |
161 | - $this->setTargetConfig(['service' => 'NonExistantClass' ]); |
|
161 | + $this->setTargetConfig(['service' => 'NonExistantClass']); |
|
162 | 162 | |
163 | 163 | $this->target->createServiceWithName(new ServiceManager(), 'irrelevant', 'irrelevant'); |
164 | 164 | } |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | |
174 | 174 | public function testSetsIdentifiersOnEventManagerInstance() |
175 | 175 | { |
176 | - $ids = [ 'testID', 'TestId2' ]; |
|
176 | + $ids = ['testID', 'TestId2']; |
|
177 | 177 | $events = new EventManager(); |
178 | 178 | $services = $this->getServiceManagerMock(['EventManager' => $events]); |
179 | 179 | $this->setTargetConfig(['configure' => true, 'identifiers' => $ids, 'service' => 'EventManager']); |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | ->with($event) |
195 | 195 | ; |
196 | 196 | |
197 | - $services = $this->getServiceManagerMock(['EventManager' => $events], [ 'Event' => $event ]); |
|
197 | + $services = $this->getServiceManagerMock(['EventManager' => $events], ['Event' => $event]); |
|
198 | 198 | $this->setTargetConfig(['configure' => true, 'service' => 'EventManager', 'event' => 'Event']); |
199 | 199 | $this->target->createServiceWithName($services, 'irrelevant', 'Test/Events'); |
200 | 200 | } |
@@ -48,7 +48,7 @@ |
||
48 | 48 | { |
49 | 49 | if (!$this->hydrator) { |
50 | 50 | /* @var $formElementManager FormElementManager */ |
51 | - $hydrator = new EntityHydrator(); |
|
51 | + $hydrator = new EntityHydrator(); |
|
52 | 52 | |
53 | 53 | $repositoryManager = $this->repositories; |
54 | 54 | $repOrganizationName = $repositoryManager->get('Organizations/OrganizationName'); |
@@ -52,7 +52,7 @@ |
||
52 | 52 | { |
53 | 53 | /* @var \Doctrine\ODM\MongoDB\Query\Builder $qb */ |
54 | 54 | $qb = $this->repository->createQueryBuilder(); |
55 | - $q && $qb->field('title')->equals(new Regex('/' . addslashes($q) . '/i')); |
|
55 | + $q && $qb->field('title')->equals(new Regex('/'.addslashes($q).'/i')); |
|
56 | 56 | |
57 | 57 | $adapter = new DoctrineMongoAdapter($qb); |
58 | 58 | parent::__construct($adapter); |
@@ -85,7 +85,7 @@ |
||
85 | 85 | { |
86 | 86 | /* @var $formElementManager \Laminas\Form\FormElementManager\FormElement */ |
87 | 87 | $formElementManager = $container->get('FormElementManager'); |
88 | - $options=null; |
|
88 | + $options = null; |
|
89 | 89 | if ($this->options) { |
90 | 90 | $options = $container->get($this->options); |
91 | 91 | } |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | ], |
52 | 52 | ]; |
53 | 53 | |
54 | - private $inheritance = [ FactoryInterface::class]; |
|
54 | + private $inheritance = [FactoryInterface::class]; |
|
55 | 55 | |
56 | 56 | public function testSetCreationOptions() |
57 | 57 | { |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $services = new ServiceManager(); |
70 | 70 | $forms = new FormElementManager($services); |
71 | 71 | |
72 | - $options = [ 'test' => 'work?' ]; |
|
72 | + $options = ['test' => 'work?']; |
|
73 | 73 | $this->target->setCreationOptions($options); |
74 | 74 | |
75 | 75 | $this->target |
@@ -86,11 +86,11 @@ discard block |
||
86 | 86 | public function provideMissingOptions() |
87 | 87 | { |
88 | 88 | return [ |
89 | - [ null ], |
|
90 | - [ [] ], |
|
91 | - [ ['tree' => ['value' => 'test']] ], |
|
92 | - [ ['tree' => ['entity' => 'test']] ], |
|
93 | - [ ['tree' => ['name' => 'test']] ], |
|
89 | + [null], |
|
90 | + [[]], |
|
91 | + [['tree' => ['value' => 'test']]], |
|
92 | + [['tree' => ['entity' => 'test']]], |
|
93 | + [['tree' => ['name' => 'test']]], |
|
94 | 94 | ]; |
95 | 95 | } |
96 | 96 | |
@@ -122,10 +122,10 @@ discard block |
||
122 | 122 | $this->expectException(\RuntimeException::class); |
123 | 123 | $this->expectExceptionMessage('Tree root not found'); |
124 | 124 | |
125 | - $this->target->__invoke($services, '', ['tree' => [ 'entity' => 'testEntityRepository', 'value' => 'test']]); |
|
125 | + $this->target->__invoke($services, '', ['tree' => ['entity' => 'testEntityRepository', 'value' => 'test']]); |
|
126 | 126 | } |
127 | 127 | |
128 | - private function getServiceContainer($criteria, $root=null) |
|
128 | + private function getServiceContainer($criteria, $root = null) |
|
129 | 129 | { |
130 | 130 | if (null === $root) { |
131 | 131 | $root = new Node('Test'); |
@@ -188,9 +188,9 @@ discard block |
||
188 | 188 | $root3 = $this->createRoot('root', ['child1' => ['gChild11', 'gChild12']]); |
189 | 189 | |
190 | 190 | return [ |
191 | - [ $root1, [], ['child1' => ['label' => 'child1', 'options' => ['child1-gchild11' => 'gChild11', 'child1-gchild12' => 'gChild12']]]], |
|
192 | - [ $root2, ['use_root_item' => true], ['root' => ['label' => 'root', 'options' => ['child1' => ['label' => 'child1', 'options' => ['child1-gchild11' => 'gChild11', 'child1-gchild12' => 'gChild12']]]]]], |
|
193 | - [ $root3, ['allow_select_nodes' => true], ['child1-group' => ['label' => 'child1', 'options' => ['child1' => 'child1', 'child1-gchild11' => 'gChild11', 'child1-gchild12' => 'gChild12']]] ] |
|
191 | + [$root1, [], ['child1' => ['label' => 'child1', 'options' => ['child1-gchild11' => 'gChild11', 'child1-gchild12' => 'gChild12']]]], |
|
192 | + [$root2, ['use_root_item' => true], ['root' => ['label' => 'root', 'options' => ['child1' => ['label' => 'child1', 'options' => ['child1-gchild11' => 'gChild11', 'child1-gchild12' => 'gChild12']]]]]], |
|
193 | + [$root3, ['allow_select_nodes' => true], ['child1-group' => ['label' => 'child1', 'options' => ['child1' => 'child1', 'child1-gchild11' => 'gChild11', 'child1-gchild12' => 'gChild12']]]] |
|
194 | 194 | ]; |
195 | 195 | } |
196 | 196 |