These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | /* @description Transformation Style Sheets - Revolutionising PHP templating * |
||
3 | * @author Tom Butler [email protected] * |
||
4 | * @copyright 2017 Tom Butler <[email protected]> | https://r.je/ * |
||
5 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License * |
||
6 | * @version 1.2 */ |
||
7 | namespace Transphporm\Property\ContentPseudo; |
||
8 | class BeforeAfter implements \Transphporm\Property\ContentPseudo { |
||
9 | private $insertLocation; |
||
10 | private $content; |
||
11 | |||
12 | public function __construct($insertLocation, \Transphporm\Property\Content $content) { |
||
13 | $this->insertLocation = $insertLocation; |
||
14 | $this->content = $content; |
||
15 | } |
||
16 | |||
17 | public function run($value, $pseudoArgs, $element, \Transphporm\Hook\PseudoMatcher $pseudoMatcher) { |
||
18 | $currentFirst = $element->firstChild; |
||
19 | |||
20 | foreach ($this->content->getNode($value, $element->ownerDocument) as $node) { |
||
21 | $this->{$this->insertLocation}($node, $element, $currentFirst); |
||
22 | } |
||
23 | } |
||
24 | |||
25 | private function before($node, $element, $currentFirst) { |
||
26 | $element->insertBefore($node, $currentFirst); |
||
27 | } |
||
28 | |||
29 | private function after($node, $element, $currentFirst) { |
||
0 ignored issues
–
show
|
|||
30 | $element->appendChild($node); |
||
31 | } |
||
32 | } |
||
33 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.