Conditions | 4 |
Paths | 5 |
Total Lines | 22 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
1 | <? |
||
16 | public function __invoke(QuerySequence $querySequence) { |
||
17 | |||
18 | $name = $querySequence->strict(T_STRING); |
||
19 | $querySequence->possible(T_WHITESPACE); |
||
20 | $arguments = $querySequence->section('(', ')'); |
||
21 | |||
22 | if (!$querySequence->isValid()) { |
||
23 | return null; |
||
24 | } |
||
25 | |||
26 | $querySequence->moveToToken($name); |
||
27 | $before = $querySequence->move(-1); |
||
28 | if ($before->getType() === T_WHITESPACE) { |
||
29 | $before = $querySequence->move(-1); |
||
30 | } |
||
31 | |||
32 | if (in_array($before->getValue(), ['::', 'function'])) { |
||
33 | return null; |
||
34 | } |
||
35 | |||
36 | return $querySequence->getCollection()->extractByTokens($name, $arguments->getLast()); |
||
37 | } |
||
38 | |||
39 | } |
Short opening tags are disabled in PHP’s default configuration. In such a case, all content of this file is output verbatim to the browser without being parsed, or executed.
As a precaution to avoid these problems better use the long opening tag
<?php
.