@@ -13,8 +13,14 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | private $label; |
| 15 | 15 | |
| 16 | + /** |
|
| 17 | + * @param string $name |
|
| 18 | + */ |
|
| 16 | 19 | abstract public function get($name); |
| 17 | 20 | |
| 21 | + /** |
|
| 22 | + * @param string $key |
|
| 23 | + */ |
|
| 18 | 24 | abstract public function setAttribute($key, $value = true, $sep = false); |
| 19 | 25 | |
| 20 | 26 | /** |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | if (is_array($found)) { |
| 92 | 92 | return in_array($value, $found); |
| 93 | 93 | } |
| 94 | - return (string)$value === (string)$found; |
|
| 94 | + return (string) $value === (string) $found; |
|
| 95 | 95 | } |
| 96 | 96 | return true; |
| 97 | 97 | } |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | ? true |
| 150 | 150 | : (string) $inputs; |
| 151 | 151 | } |
| 152 | - foreach($levels as $key => $next) { |
|
| 152 | + foreach ($levels as $key => $next) { |
|
| 153 | 153 | if (Accessor::has($inputs, $key)) { |
| 154 | 154 | return $this->recurseGet($next, Accessor::get($inputs, $key)); |
| 155 | 155 | } |
@@ -12,9 +12,9 @@ discard block |
||
| 12 | 12 | $prop = (string) $element->getAttribute(); |
| 13 | 13 | $tag = $element->getTagName(); |
| 14 | 14 | if ($element->isClosed() || $element->hasContents()) { |
| 15 | - $html = '<' . $tag . $prop . ' >' . $element->getContents() . "</{$tag}>" . "\n"; |
|
| 15 | + $html = '<'.$tag.$prop.' >'.$element->getContents()."</{$tag}>"."\n"; |
|
| 16 | 16 | } else { |
| 17 | - $html = '<' . $tag . $prop . ' >' . "\n"; |
|
| 17 | + $html = '<'.$tag.$prop.' >'."\n"; |
|
| 18 | 18 | } |
| 19 | 19 | $html = rtrim($html); |
| 20 | 20 | return $html; |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | } |
| 39 | 39 | $property[] = "{$key}=\"{$val}\""; |
| 40 | 40 | } |
| 41 | - return ' ' . implode(' ', $property); |
|
| 41 | + return ' '.implode(' ', $property); |
|
| 42 | 42 | } |
| 43 | 43 | return ''; |
| 44 | 44 | } |
@@ -29,8 +29,12 @@ |
||
| 29 | 29 | if ($attributes = $element->getAttribute()) { |
| 30 | 30 | $property = []; |
| 31 | 31 | foreach ($attributes as $key => $val) { |
| 32 | - if ($val === false) continue; |
|
| 33 | - if ($key === 'value' && '' === (string) $val) continue; |
|
| 32 | + if ($val === false) { |
|
| 33 | + continue; |
|
| 34 | + } |
|
| 35 | + if ($key === 'value' && '' === (string) $val) { |
|
| 36 | + continue; |
|
| 37 | + } |
|
| 34 | 38 | if (is_numeric($key)) { |
| 35 | 39 | $key = $val; |
| 36 | 40 | } elseif ($val === true) { |