File: BenchTrait.php

package info (click to toggle)
php-zend-eventmanager 3.14.0-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 904 kB
  • sloc: php: 3,542; xml: 696; makefile: 17
file content (42 lines) | stat: -rw-r--r-- 921 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php

declare(strict_types=1);

namespace LaminasBench\EventManager;

use Laminas\Stdlib\DispatchableInterface;

trait BenchTrait
{
    /** @var int */
    private $numListeners = 50;

    private function generateCallback(): callable
    {
        return function ($e) {
        };
    }

    /** @return non-empty-string[] */
    private function getEventList(): array
    {
        return [
            'dispatch',
            'dispatch.post',
            '*',
        ];
    }

    /** @return class-string[] */
    private function getIdentifierList(): array
    {
        return [
            DispatchableInterface::class,
            'Laminas\Mvc\Controller\AbstractController',
            'Laminas\Mvc\Controller\AbstractActionController',
            'Laminas\Mvc\Controller\AbstractRestfulController',
            'Laminas\ApiTools\Rest\RestController',
            'CustomRestController',
        ];
    }
}