Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| VarLinksMap | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
20 | |
0.00% |
0 / 1 |
| __toString | n/a |
0 / 0 |
n/a |
0 / 0 |
2 | |||||
| __clone | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
6 | |||
| 1 | <?php declare( strict_types=1 ); |
| 2 | |
| 3 | namespace SecurityCheckPlugin; |
| 4 | |
| 5 | use Phan\Language\Element\TypedElementInterface; |
| 6 | use SplObjectStorage; |
| 7 | |
| 8 | /** |
| 9 | * Convenience class for better type inference. |
| 10 | * |
| 11 | * @extends SplObjectStorage<TypedElementInterface,PreservedTaintedness> |
| 12 | * @method PreservedTaintedness offsetGet( TypedElementInterface $object ) |
| 13 | * @method TypedElementInterface current() |
| 14 | * XXX: the above `@method` annotations are needed for PHPStorm... |
| 15 | */ |
| 16 | class VarLinksMap extends SplObjectStorage { |
| 17 | /** |
| 18 | * @codeCoverageIgnore |
| 19 | */ |
| 20 | public function __toString(): string { |
| 21 | $children = []; |
| 22 | foreach ( $this as $var ) { |
| 23 | $children[] = $var->getName() . ': ' . $this[$var]->toShortString(); |
| 24 | } |
| 25 | return '[' . implode( ',', $children ) . ']'; |
| 26 | } |
| 27 | |
| 28 | public function __clone() { |
| 29 | foreach ( $this as $var ) { |
| 30 | $this[$var] = clone $this[$var]; |
| 31 | } |
| 32 | } |
| 33 | } |