1 | <?php |
||
23 | class TimeProfilerSubscriber implements EventSubscriberInterface |
||
24 | { |
||
25 | /** @var float */ |
||
26 | private $startTime = -1; |
||
27 | /** @var float */ |
||
28 | private $profiledTime = -1; |
||
29 | |||
30 | /** |
||
31 | * Returns an array of event names this subscriber wants to listen to. |
||
32 | * |
||
33 | * The array keys are event names and the value can be: |
||
34 | * |
||
35 | * * The method name to call (priority defaults to 0) |
||
36 | * * An array composed of the method name to call and the priority |
||
37 | * * An array of arrays composed of the method names to call and respective |
||
38 | * priorities, or 0 if unset |
||
39 | * |
||
40 | * For instance: |
||
41 | * |
||
42 | * * array('eventName' => 'methodName') |
||
43 | * * array('eventName' => array('methodName', $priority)) |
||
44 | * * array('eventName' => array(array('methodName1', $priority), array('methodName2'))) |
||
45 | * |
||
46 | * @return array The event names to listen to |
||
47 | */ |
||
48 | public static function getSubscribedEvents() |
||
55 | |||
56 | public function start(BeforeExecuteEvent $event) |
||
60 | |||
61 | public function stop(AfterExecuteEvent $event) |
||
65 | |||
66 | public function getProfiledTimestamp() |
||
73 | } |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.