Completed
Push — master ( 4e1c5d...6050c4 )
by Grégoire
22:25 queued 19:06
created

PoolTest   A

Complexity

Total Complexity 42

Size/Duplication

Total Lines 541
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 42
lcom 1
cbo 1
dl 0
loc 541
rs 9.0399
c 0
b 0
f 0

41 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 4 1
A testGetGroups() 0 12 1
A testHasGroup() 0 9 1
A testGetDashboardGroups() 0 37 1
A testGetAdminsByGroupWhenGroupNotSet() 0 10 1
A testGetAdminsByGroupWhenGroupIsEmpty() 0 8 1
A testGetAdminsByGroup() 0 18 1
A testGetAdminForClassWhenAdminClassIsNotSet() 0 6 1
A testGetAdminForClassWithInvalidFormat() 0 9 1
A testGetAdminForClassWithTooManyRegisteredAdmin() 0 11 1
A testGetAdminForClassWhenAdminClassIsSet() 0 10 1
A testGetInstanceWithUndefinedServiceId() 0 7 1
A testGetInstanceWithUndefinedServiceIdAndExistsOther() 0 14 1
A testGetAdminByAdminCode() 0 6 1
A testGetAdminByAdminCodeForChildClass() 0 24 1
A testGetAdminByAdminCodeWithInvalidCode() 0 20 1
A testGetAdminByAdminCodeWithCodeNotChild() 0 20 1
A testGetAdminByAdminCodeWithNonStringCode() 0 6 1
A getNonStringAdminServiceNames() 0 10 1
A testGetAdminByAdminCodeWithInvalidRootCode() 0 23 1
A getEmptyRootAdminServiceNames() 0 8 1
A testGetAdminByAdminCodeWithInvalidChildCode() 0 31 1
A getInvalidChildAdminServiceNames() 0 8 1
A testHasAdminByAdminCode() 0 30 2
A getAdminServiceNamesToCheck() 0 7 1
A testHasAdminByAdminCodeWithNonStringCode() 0 5 1
A testHasAdminByAdminCodeWithInvalidCodes() 0 17 1
A getInvalidAdminServiceNamesToCheck() 0 8 1
A testHasAdminByAdminCodeWithNonExistentCode() 0 10 1
A testHasAdminByAdminCodeWithInvalidChildCodes() 0 19 1
A getInvalidChildAdminServiceNamesToCheck() 0 8 1
A testGetAdminClasses() 0 5 1
A testGetAdminGroups() 0 5 1
A testGetAdminServiceIds() 0 5 1
A testGetContainer() 0 4 1
A testGetTitleLogo() 0 4 1
A testGetTitle() 0 4 1
A testGetOption() 0 6 1
A testOptionDefault() 0 4 1
A getContainer() 0 11 1
A getItemArray() 0 9 1

How to fix   Complexity   

Complex Class

Complex classes like PoolTest often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.

Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.

While breaking up the class, it is a good idea to analyze how other classes use PoolTest, and based on these observations, apply Extract Interface, too.

1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Sonata Project package.
7
 *
8
 * (c) Thomas Rabaix <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Sonata\AdminBundle\Tests\Admin;
15
16
use PHPUnit\Framework\MockObject\MockObject;
17
use PHPUnit\Framework\TestCase;
18
use Sonata\AdminBundle\Admin\AdminInterface;
19
use Sonata\AdminBundle\Admin\Pool;
20
use Symfony\Component\DependencyInjection\ContainerInterface;
21
22
class PoolTest extends TestCase
23
{
24
    /**
25
     * @var Pool
26
     */
27
    private $pool = null;
28
29
    public function setUp(): void
30
    {
31
        $this->pool = new Pool($this->getContainer(), 'Sonata Admin', '/path/to/pic.png', ['foo' => 'bar']);
32
    }
33
34
    public function testGetGroups(): void
35
    {
36
        $this->pool->setAdminServiceIds(['sonata.user.admin.group1']);
37
38
        $this->pool->setAdminGroups([
39
            'adminGroup1' => ['sonata.user.admin.group1' => []],
40
        ]);
41
42
        $result = $this->pool->getGroups();
43
        $this->assertArrayHasKey('adminGroup1', $result);
44
        $this->assertArrayHasKey('sonata.user.admin.group1', $result['adminGroup1']);
45
    }
46
47
    public function testHasGroup(): void
48
    {
49
        $this->pool->setAdminGroups([
50
                'adminGroup1' => [],
51
            ]);
52
53
        $this->assertTrue($this->pool->hasGroup('adminGroup1'));
54
        $this->assertFalse($this->pool->hasGroup('adminGroup2'));
55
    }
56
57
    public function testGetDashboardGroups(): void
58
    {
59
        $admin_group1 = $this->createMock(AdminInterface::class);
60
        $admin_group1->expects($this->once())->method('showIn')->willReturn(true);
61
62
        $admin_group2 = $this->createMock(AdminInterface::class);
63
        $admin_group2->expects($this->once())->method('showIn')->willReturn(false);
64
65
        $admin_group3 = $this->createMock(AdminInterface::class);
66
        $admin_group3->expects($this->once())->method('showIn')->willReturn(false);
67
68
        $container = $this->createMock(ContainerInterface::class);
69
70
        $container->method('get')->will($this->onConsecutiveCalls(
71
            $admin_group1, $admin_group2, $admin_group3
72
        ));
73
74
        $pool = new Pool($container, 'Sonata Admin', '/path/to/pic.png');
75
        $pool->setAdminServiceIds(['sonata.user.admin.group1', 'sonata.user.admin.group2', 'sonata.user.admin.group3']);
76
77
        $pool->setAdminGroups([
78
            'adminGroup1' => [
79
                'items' => ['itemKey' => $this->getItemArray('sonata.user.admin.group1')],
80
            ],
81
            'adminGroup2' => [
82
                'items' => ['itemKey' => $this->getItemArray('sonata.user.admin.group2')],
83
            ],
84
            'adminGroup3' => [
85
                'items' => ['itemKey' => $this->getItemArray('sonata.user.admin.group3')],
86
            ],
87
        ]);
88
89
        $groups = $pool->getDashboardGroups();
90
91
        $this->assertCount(1, $groups);
92
        $this->assertSame($admin_group1, $groups['adminGroup1']['items']['itemKey']);
93
    }
94
95
    public function testGetAdminsByGroupWhenGroupNotSet(): void
96
    {
97
        $this->expectException(\InvalidArgumentException::class);
98
99
        $this->pool->setAdminGroups([
100
                'adminGroup1' => [],
101
            ]);
102
103
        $this->pool->getAdminsByGroup('adminGroup2');
104
    }
105
106
    public function testGetAdminsByGroupWhenGroupIsEmpty(): void
107
    {
108
        $this->pool->setAdminGroups([
109
                'adminGroup1' => [],
110
            ]);
111
112
        $this->assertSame([], $this->pool->getAdminsByGroup('adminGroup1'));
113
    }
114
115
    public function testGetAdminsByGroup(): void
116
    {
117
        $this->pool->setAdminServiceIds(['sonata.admin1', 'sonata.admin2', 'sonata.admin3']);
118
        $this->pool->setAdminGroups([
119
            'adminGroup1' => [
120
                'items' => [
121
                    $this->getItemArray('sonata.admin1'),
122
                    $this->getItemArray('sonata.admin2'),
123
                ],
124
            ],
125
            'adminGroup2' => [
126
                'items' => [$this->getItemArray('sonata.admin3')],
127
            ],
128
        ]);
129
130
        $this->assertCount(2, $this->pool->getAdminsByGroup('adminGroup1'));
131
        $this->assertCount(1, $this->pool->getAdminsByGroup('adminGroup2'));
132
    }
133
134
    public function testGetAdminForClassWhenAdminClassIsNotSet(): void
135
    {
136
        $this->pool->setAdminClasses(['someclass' => 'sonata.user.admin.group1']);
137
        $this->assertFalse($this->pool->hasAdminByClass('notexists'));
138
        $this->assertNull($this->pool->getAdminByClass('notexists'));
139
    }
140
141
    public function testGetAdminForClassWithInvalidFormat(): void
142
    {
143
        $this->expectException(\RuntimeException::class);
144
145
        $this->pool->setAdminClasses(['someclass' => 'sonata.user.admin.group1']);
146
        $this->assertTrue($this->pool->hasAdminByClass('someclass'));
147
148
        $this->pool->getAdminByClass('someclass');
149
    }
150
151
    public function testGetAdminForClassWithTooManyRegisteredAdmin(): void
152
    {
153
        $this->expectException(\RuntimeException::class);
154
155
        $this->pool->setAdminClasses([
156
            'someclass' => ['sonata.user.admin.group1', 'sonata.user.admin.group2'],
157
        ]);
158
159
        $this->assertTrue($this->pool->hasAdminByClass('someclass'));
160
        $this->pool->getAdminByClass('someclass');
161
    }
162
163
    public function testGetAdminForClassWhenAdminClassIsSet(): void
164
    {
165
        $this->pool->setAdminServiceIds(['sonata.user.admin.group1']);
166
        $this->pool->setAdminClasses([
167
            'someclass' => ['sonata.user.admin.group1'],
168
        ]);
169
170
        $this->assertTrue($this->pool->hasAdminByClass('someclass'));
171
        $this->assertInstanceOf(AdminInterface::class, $this->pool->getAdminByClass('someclass'));
172
    }
173
174
    public function testGetInstanceWithUndefinedServiceId(): void
175
    {
176
        $this->expectException(\InvalidArgumentException::class);
177
        $this->expectExceptionMessage('Admin service "sonata.news.admin.post" not found in admin pool.');
178
179
        $this->pool->getInstance('sonata.news.admin.post');
180
    }
181
182
    public function testGetInstanceWithUndefinedServiceIdAndExistsOther(): void
183
    {
184
        $this->pool->setAdminServiceIds([
185
            'sonata.news.admin.post',
186
            'sonata.news.admin.category',
187
        ]);
188
189
        $this->expectException(\InvalidArgumentException::class);
190
        $this->expectExceptionMessage('Admin service "sonata.news.admin.pos" not found in admin pool. '
191
            .'Did you mean "sonata.news.admin.post" '
192
            .'or one of those: [sonata.news.admin.category]?');
193
194
        $this->pool->getInstance('sonata.news.admin.pos');
195
    }
196
197
    public function testGetAdminByAdminCode(): void
198
    {
199
        $this->pool->setAdminServiceIds(['sonata.news.admin.post']);
200
201
        $this->assertInstanceOf(AdminInterface::class, $this->pool->getAdminByAdminCode('sonata.news.admin.post'));
202
    }
203
204
    public function testGetAdminByAdminCodeForChildClass(): void
205
    {
206
        $adminMock = $this->createMock(AdminInterface::class);
207
        $adminMock
208
            ->method('hasChild')
209
            ->willReturn(true);
210
211
        $childAdmin = $this->createMock(AdminInterface::class);
212
213
        $adminMock->expects($this->once())
214
            ->method('getChild')
215
            ->with($this->equalTo('sonata.news.admin.comment'))
216
            ->willReturn($childAdmin);
217
218
        $containerMock = $this->createMock(ContainerInterface::class);
219
        $containerMock
220
            ->method('get')
221
            ->willReturn($adminMock);
222
223
        $this->pool = new Pool($containerMock, 'Sonata', '/path/to/logo.png');
224
        $this->pool->setAdminServiceIds(['sonata.news.admin.post', 'sonata.news.admin.comment']);
225
226
        $this->assertSame($childAdmin, $this->pool->getAdminByAdminCode('sonata.news.admin.post|sonata.news.admin.comment'));
227
    }
228
229
    public function testGetAdminByAdminCodeWithInvalidCode(): void
230
    {
231
        $adminMock = $this->createMock(AdminInterface::class);
232
        $adminMock
233
            ->method('hasChild')
234
            ->willReturn(false);
235
236
        $containerMock = $this->createMock(ContainerInterface::class);
237
        $containerMock
238
            ->method('get')
239
            ->willReturn($adminMock);
240
241
        $this->pool = new Pool($containerMock, 'Sonata', '/path/to/logo.png');
242
        $this->pool->setAdminServiceIds(['sonata.news.admin.post']);
243
244
        $this->expectException(\InvalidArgumentException::class);
245
        $this->expectExceptionMessage('Argument 1 passed to Sonata\AdminBundle\Admin\Pool::getAdminByAdminCode() must contain a valid admin reference, "sonata.news.admin.invalid" found at "sonata.news.admin.post|sonata.news.admin.invalid".');
246
247
        $this->pool->getAdminByAdminCode('sonata.news.admin.post|sonata.news.admin.invalid');
248
    }
249
250
    public function testGetAdminByAdminCodeWithCodeNotChild(): void
251
    {
252
        $adminMock = $this->getMockBuilder(AdminInterface::class)
253
            ->disableOriginalConstructor()
254
            ->getMock();
255
        $adminMock->expects($this->any())
256
            ->method('hasChild')
257
            ->willReturn(false);
258
259
        $containerMock = $this->createMock(ContainerInterface::class);
260
        $containerMock->expects($this->any())
261
            ->method('get')
262
            ->willReturn($adminMock);
263
264
        $this->pool = new Pool($containerMock, 'Sonata', '/path/to/logo.png');
265
        $this->pool->setAdminServiceIds(['sonata.news.admin.post', 'sonata.news.admin.valid']);
266
267
        $this->expectException(\InvalidArgumentException::class);
268
        $this->pool->getAdminByAdminCode('sonata.news.admin.post|sonata.news.admin.valid');
269
    }
270
271
    /**
272
     * @dataProvider getNonStringAdminServiceNames
273
     */
274
    public function testGetAdminByAdminCodeWithNonStringCode($adminId): void
275
    {
276
        $this->expectException(\TypeError::class);
277
278
        $this->pool->getAdminByAdminCode($adminId);
279
    }
280
281
    public function getNonStringAdminServiceNames(): array
282
    {
283
        return [
284
            [null],
285
            [false],
286
            [1],
287
            [['some_value']],
288
            [new \stdClass()],
289
        ];
290
    }
291
292
    /**
293
     * @dataProvider getEmptyRootAdminServiceNames
294
     */
295
    public function testGetAdminByAdminCodeWithInvalidRootCode(string $adminId): void
296
    {
297
        $adminMock = $this->createMock(AdminInterface::class);
298
        $adminMock->expects($this->never())
299
            ->method('hasChild');
300
301
        $containerMock = $this->createMock(ContainerInterface::class);
302
        $containerMock->expects($this->never())
303
            ->method('get');
304
305
        /** @var MockObject|Pool $poolMock */
306
        $poolMock = $this->getMockBuilder(Pool::class)
307
            ->setConstructorArgs([$containerMock, 'Sonata', '/path/to/logo.png'])
308
            ->disableOriginalClone()
309
            ->setMethodsExcept(['getAdminByAdminCode'])
310
            ->getMock();
311
        $poolMock->expects($this->never())
0 ignored issues
show
Bug introduced by
The method expects() does not seem to exist on object<Sonata\AdminBundle\Admin\Pool>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
312
            ->method('getInstance');
313
314
        $this->expectException(\InvalidArgumentException::class);
315
        $this->expectExceptionMessage('Root admin code must contain a valid admin reference, empty string given.');
316
        $poolMock->getAdminByAdminCode($adminId);
317
    }
318
319
    public function getEmptyRootAdminServiceNames()
320
    {
321
        return [
322
            [''],
323
            ['   '],
324
            ['|sonata.news.admin.child_of_empty_code'],
325
        ];
326
    }
327
328
    /**
329
     * @dataProvider getInvalidChildAdminServiceNames
330
     */
331
    public function testGetAdminByAdminCodeWithInvalidChildCode(string $adminId): void
332
    {
333
        $adminMock = $this->createMock(AdminInterface::class);
334
        $adminMock
335
            ->method('hasChild')
336
            ->willReturn(false);
337
        $adminMock->expects($this->never())
338
            ->method('getChild');
339
340
        $containerMock = $this->createMock(ContainerInterface::class);
341
        $containerMock->expects($this->never())
342
            ->method('get');
343
344
        /** @var MockObject|Pool $poolMock */
345
        $poolMock = $this->getMockBuilder(Pool::class)
346
            ->setConstructorArgs([$containerMock, 'Sonata', '/path/to/logo.png'])
347
            ->disableOriginalClone()
348
            ->setMethodsExcept(['getAdminByAdminCode'])
349
            ->getMock();
350
        $poolMock
0 ignored issues
show
Bug introduced by
The method method() does not seem to exist on object<Sonata\AdminBundle\Admin\Pool>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
351
            ->method('getInstance')
352
            ->willReturn($adminMock);
353
354
        $this->expectException(\InvalidArgumentException::class);
355
        $this->expectExceptionMessageRegExp(sprintf(
356
            '{^Argument 1 passed to Sonata\\\AdminBundle\\\Admin\\\Pool::getAdminByAdminCode\(\) must contain a valid admin reference, "[^"]+" found at "%s"\.$}',
357
            $adminId
358
        ));
359
360
        $poolMock->getAdminByAdminCode($adminId);
361
    }
362
363
    public function getInvalidChildAdminServiceNames()
364
    {
365
        return [
366
            ['admin1|'],
367
            ['admin1|nonexistent_code'],
368
            ['admin1||admin3'],
369
        ];
370
    }
371
372
    /**
373
     * @dataProvider getAdminServiceNamesToCheck
374
     */
375
    public function testHasAdminByAdminCode(string $adminId): void
376
    {
377
        $adminMock = $this->createMock(AdminInterface::class);
378
379
        if (false !== strpos($adminId, '|')) {
380
            $childAdminMock = $this->createMock(AdminInterface::class);
381
            $adminMock
382
                ->method('hasChild')
383
                ->willReturn(true);
384
            $adminMock->expects($this->once())
385
                ->method('getChild')
386
                ->with($this->equalTo('sonata.news.admin.comment'))
387
                ->willReturn($childAdminMock);
388
        } else {
389
            $adminMock->expects($this->never())
390
                ->method('hasChild');
391
            $adminMock->expects($this->never())
392
                ->method('getChild');
393
        }
394
395
        $containerMock = $this->createMock(ContainerInterface::class);
396
        $containerMock
397
            ->method('get')
398
            ->willReturn($adminMock);
399
400
        $this->pool = new Pool($containerMock, 'Sonata', '/path/to/logo.png');
401
        $this->pool->setAdminServiceIds(['sonata.news.admin.post', 'sonata.news.admin.comment']);
402
403
        $this->assertTrue($this->pool->hasAdminByAdminCode($adminId));
404
    }
405
406
    public function getAdminServiceNamesToCheck()
407
    {
408
        return [
409
            ['sonata.news.admin.post'],
410
            ['sonata.news.admin.post|sonata.news.admin.comment'],
411
        ];
412
    }
413
414
    /**
415
     * @dataProvider getNonStringAdminServiceNames
416
     */
417
    public function testHasAdminByAdminCodeWithNonStringCode($adminId): void
418
    {
419
        $this->expectException(\TypeError::class);
420
        $this->pool->hasAdminByAdminCode($adminId);
421
    }
422
423
    /**
424
     * @dataProvider getInvalidAdminServiceNamesToCheck
425
     */
426
    public function testHasAdminByAdminCodeWithInvalidCodes(string $adminId): void
427
    {
428
        $adminMock = $this->createMock(AdminInterface::class);
429
        $adminMock
430
            ->method('hasChild')
431
            ->willReturn(false);
432
        $adminMock->expects($this->never())
433
            ->method('getChild');
434
435
        $containerMock = $this->createMock(ContainerInterface::class);
436
        $containerMock->expects($this->never())
437
            ->method('get');
438
439
        $this->pool = new Pool($containerMock, 'Sonata', '/path/to/logo.png');
440
441
        $this->assertFalse($this->pool->hasAdminByAdminCode($adminId));
442
    }
443
444
    public function getInvalidAdminServiceNamesToCheck()
445
    {
446
        return [
447
            [''],
448
            ['   '],
449
            ['|sonata.news.admin.child_of_empty_code'],
450
        ];
451
    }
452
453
    public function testHasAdminByAdminCodeWithNonExistentCode(): void
454
    {
455
        $containerMock = $this->createMock(ContainerInterface::class);
456
        $containerMock->expects($this->never())
457
            ->method('get');
458
459
        $this->pool = new Pool($containerMock, 'Sonata', '/path/to/logo.png');
460
461
        $this->assertFalse($this->pool->hasAdminByAdminCode('sonata.news.admin.nonexistent_code'));
462
    }
463
464
    /**
465
     * @dataProvider getInvalidChildAdminServiceNamesToCheck
466
     */
467
    public function testHasAdminByAdminCodeWithInvalidChildCodes(string $adminId): void
468
    {
469
        $adminMock = $this->createMock(AdminInterface::class);
470
        $adminMock
471
            ->method('hasChild')
472
            ->willReturn(false);
473
        $adminMock->expects($this->never())
474
            ->method('getChild');
475
476
        $containerMock = $this->createMock(ContainerInterface::class);
477
        $containerMock->expects($this->once())
478
            ->method('get')
479
            ->willReturn($adminMock);
480
481
        $this->pool = new Pool($containerMock, 'Sonata', '/path/to/logo.png');
482
        $this->pool->setAdminServiceIds(['sonata.news.admin.post']);
483
484
        $this->assertFalse($this->pool->hasAdminByAdminCode($adminId));
485
    }
486
487
    public function getInvalidChildAdminServiceNamesToCheck()
488
    {
489
        return [
490
            ['sonata.news.admin.post|'],
491
            ['sonata.news.admin.post|nonexistent_code'],
492
            ['sonata.news.admin.post||admin3'],
493
        ];
494
    }
495
496
    public function testGetAdminClasses(): void
497
    {
498
        $this->pool->setAdminClasses(['someclass' => 'sonata.user.admin.group1']);
499
        $this->assertSame(['someclass' => 'sonata.user.admin.group1'], $this->pool->getAdminClasses());
500
    }
501
502
    public function testGetAdminGroups(): void
503
    {
504
        $this->pool->setAdminGroups(['adminGroup1' => 'sonata.user.admin.group1']);
505
        $this->assertSame(['adminGroup1' => 'sonata.user.admin.group1'], $this->pool->getAdminGroups());
506
    }
507
508
    public function testGetAdminServiceIds(): void
509
    {
510
        $this->pool->setAdminServiceIds(['sonata.user.admin.group1', 'sonata.user.admin.group2', 'sonata.user.admin.group3']);
511
        $this->assertSame(['sonata.user.admin.group1', 'sonata.user.admin.group2', 'sonata.user.admin.group3'], $this->pool->getAdminServiceIds());
512
    }
513
514
    public function testGetContainer(): void
515
    {
516
        $this->assertInstanceOf(ContainerInterface::class, $this->pool->getContainer());
517
    }
518
519
    public function testGetTitleLogo(): void
520
    {
521
        $this->assertSame('/path/to/pic.png', $this->pool->getTitleLogo());
522
    }
523
524
    public function testGetTitle(): void
525
    {
526
        $this->assertSame('Sonata Admin', $this->pool->getTitle());
527
    }
528
529
    public function testGetOption(): void
530
    {
531
        $this->assertSame('bar', $this->pool->getOption('foo'));
532
533
        $this->assertNull($this->pool->getOption('non_existent_option'));
534
    }
535
536
    public function testOptionDefault(): void
537
    {
538
        $this->assertSame([], $this->pool->getOption('nonexistantarray', []));
539
    }
540
541
    private function getContainer(): ContainerInterface
542
    {
543
        $containerMock = $this->createMock(ContainerInterface::class);
544
        $containerMock
545
            ->method('get')
546
            ->willReturnCallback(function () {
547
                return $this->createMock(AdminInterface::class);
548
            });
549
550
        return $containerMock;
551
    }
552
553
    private function getItemArray(string $serviceId): array
554
    {
555
        return [
556
            'admin' => $serviceId,
557
            'label' => '',
558
            'route' => '',
559
            'route_params' => [],
560
        ];
561
    }
562
}
563