| @@ 54-64 (lines=11) @@ | ||
| 51 | */ |
|
| 52 | public function apply(AbstractNode $node) |
|
| 53 | { |
|
| 54 | foreach ($node->findChildrenOfType('Variable') as $variable) { |
|
| 55 | if (in_array($variable->getImage(), $this->superglobals)) { |
|
| 56 | $this->addViolation( |
|
| 57 | $node, |
|
| 58 | array( |
|
| 59 | $node->getName(), |
|
| 60 | $variable->getImage() |
|
| 61 | ) |
|
| 62 | ); |
|
| 63 | } |
|
| 64 | } |
|
| 65 | } |
|
| 66 | } |
|
| 67 | ||
| @@ 70-75 (lines=6) @@ | ||
| 67 | ||
| 68 | $exceptions = $this->getExceptionsList(); |
|
| 69 | ||
| 70 | foreach ($this->nodes as $node) { |
|
| 71 | if (in_array(substr($node->getImage(), 1), $exceptions)) { |
|
| 72 | continue; |
|
| 73 | } |
|
| 74 | $this->addViolation($node, array($node->getImage())); |
|
| 75 | } |
|
| 76 | } |
|
| 77 | ||
| 78 | /** |
|