@@ -14,15 +14,15 @@ discard block |
||
14 | 14 | public function render() |
15 | 15 | { |
16 | 16 | $field = new FieldRenderer(); |
17 | - $field->setType( 'select' ); |
|
18 | - $field->setName( $this->field->getName() ); |
|
19 | - $field->setLabel( $this->getLabel() ); |
|
17 | + $field->setType('select'); |
|
18 | + $field->setName($this->field->getName()); |
|
19 | + $field->setLabel($this->getLabel()); |
|
20 | 20 | |
21 | 21 | $input = $this->getSelectInput(); |
22 | 22 | |
23 | - $field->setValue( [ $input, $this->getIconSelectElement() ] ); |
|
23 | + $field->setValue([ $input, $this->getIconSelectElement() ]); |
|
24 | 24 | |
25 | - return $field->render()->addClass( 'type-icon-picker' ); |
|
25 | + return $field->render()->addClass('type-icon-picker'); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | /** |
@@ -32,11 +32,11 @@ discard block |
||
32 | 32 | { |
33 | 33 | /** @var SpriteIcon $field */ |
34 | 34 | $field = $this->field; |
35 | - $items = Html::ul()->addClass( 'items' ); |
|
35 | + $items = Html::ul()->addClass('items'); |
|
36 | 36 | |
37 | - foreach( $field->getOptions() as $option ) |
|
37 | + foreach ($field->getOptions() as $option) |
|
38 | 38 | { |
39 | - $items->append( Html::li( $this->getSvgIconElement( $option ) ) ); |
|
39 | + $items->append(Html::li($this->getSvgIconElement($option))); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | return Html::div([ |
@@ -51,20 +51,20 @@ discard block |
||
51 | 51 | * @param string $id |
52 | 52 | * @return Element |
53 | 53 | */ |
54 | - protected function getSvgIconElement( $id ) |
|
54 | + protected function getSvgIconElement($id) |
|
55 | 55 | { |
56 | - if( !$id ) |
|
56 | + if (!$id) |
|
57 | 57 | { |
58 | 58 | return Html::svg(); |
59 | 59 | } |
60 | 60 | |
61 | 61 | /** @var SpriteIcon $field */ |
62 | 62 | $field = $this->field; |
63 | - $iconNode = $field->getIconContent( $id ); |
|
63 | + $iconNode = $field->getIconContent($id); |
|
64 | 64 | |
65 | - if ( !$iconNode ) |
|
65 | + if (!$iconNode) |
|
66 | 66 | { |
67 | - return Html::div()->addClass( 'element' ); |
|
67 | + return Html::div()->addClass('element'); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | $content = $iconNode->path->asXML(); |
@@ -73,14 +73,14 @@ discard block |
||
73 | 73 | $width = (int) $attributes->width; |
74 | 74 | $height = (int) $attributes->height; |
75 | 75 | |
76 | - $icon = Html::span( Html::svg( $content ) |
|
77 | - ->addAttributes( [ |
|
76 | + $icon = Html::span(Html::svg($content) |
|
77 | + ->addAttributes([ |
|
78 | 78 | 'width' => $width, |
79 | 79 | 'height' => $height, |
80 | - 'viewBox' => sprintf( '0 0 %d %d', $width, $height ), |
|
80 | + 'viewBox' => sprintf('0 0 %d %d', $width, $height), |
|
81 | 81 | 'role' => 'presentation', |
82 | - ] ) )->addClass( 'icon' ); |
|
82 | + ]))->addClass('icon'); |
|
83 | 83 | |
84 | - return Html::div( [ $icon, Html::span( $id ) ] )->addClass( 'element' ); |
|
84 | + return Html::div([ $icon, Html::span($id) ])->addClass('element'); |
|
85 | 85 | } |
86 | 86 | } |