summaryrefslogtreecommitdiff
path: root/archlinuxaba/bareos/fix-headlink.patch
blob: 6830228d03d25d4337617eb610cd669618982372 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
--- a/webui/vendor/zendframework/zend-view/src/Helper/HeadLink.php	2021-04-16 20:54:47.655312342 +0300
+++ b/webui/vendor/zendframework/zend-view/src/Helper/HeadLink.php	2021-04-16 23:17:00.000000000 +0300
@@ -13,21 +13,23 @@
 use Zend\View;
 use Zend\View\Exception;
 
+// @codingStandardsIgnoreStart
 /**
  * Zend_Layout_View_Helper_HeadLink
  *
  * @see http://www.w3.org/TR/xhtml1/dtds.html
  *
  * Creates the following virtual methods:
- * @method HeadLink appendStylesheet($href, $media = 'screen', $conditionalStylesheet = '', $extras = array())
- * @method HeadLink offsetSetStylesheet($index, $href, $media = 'screen', $conditionalStylesheet = '', $extras = array())
- * @method HeadLink prependStylesheet($href, $media = 'screen', $conditionalStylesheet = '', $extras = array())
- * @method HeadLink setStylesheet($href, $media = 'screen', $conditionalStylesheet = '', $extras = array())
- * @method HeadLink appendAlternate($href, $type, $title, $extras = array())
- * @method HeadLink offsetSetAlternate($index, $href, $type, $title, $extras = array())
- * @method HeadLink prependAlternate($href, $type, $title, $extras = array())
- * @method HeadLink setAlternate($href, $type, $title, $extras = array())
+ * @method HeadLink appendStylesheet($href, $media = 'screen', $conditionalStylesheet = '', $extras = [])
+ * @method HeadLink offsetSetStylesheet($index, $href, $media = 'screen', $conditionalStylesheet = '', $extras = [])
+ * @method HeadLink prependStylesheet($href, $media = 'screen', $conditionalStylesheet = '', $extras = [])
+ * @method HeadLink setStylesheet($href, $media = 'screen', $conditionalStylesheet = '', $extras = [])
+ * @method HeadLink appendAlternate($href, $type, $title, $extras = [])
+ * @method HeadLink offsetSetAlternate($index, $href, $type, $title, $extras = [])
+ * @method HeadLink prependAlternate($href, $type, $title, $extras = [])
+ * @method HeadLink setAlternate($href, $type, $title, $extras = [])
  */
+// @codingStandardsIgnoreEnd
 class HeadLink extends Placeholder\Container\AbstractStandalone
 {
     /**
@@ -35,7 +37,7 @@
      *
      * @var string[]
      */
-    protected $itemKeys = array(
+    protected $itemKeys = [
         'charset',
         'href',
         'hreflang',
@@ -46,8 +48,12 @@
         'sizes',
         'type',
         'title',
-        'extras'
-    );
+        'extras',
+        'itemprop',
+        'crossorigin',
+        'integrity',
+        'as',
+    ];
 
     /**
      * Registry key for placeholder
@@ -80,7 +86,7 @@
      */
     public function headLink(array $attributes = null, $placement = Placeholder\Container\AbstractContainer::APPEND)
     {
-        return call_user_func_array(array($this, '__invoke'), func_get_args());
+        return call_user_func_array([$this, '__invoke'], func_get_args());
     }
 
     /**
@@ -142,7 +148,11 @@
      */
     public function __call($method, $args)
     {
-        if (preg_match('/^(?P<action>set|(ap|pre)pend|offsetSet)(?P<type>Stylesheet|Alternate|Prev|Next)$/', $method, $matches)) {
+        if (preg_match(
+            '/^(?P<action>set|(ap|pre)pend|offsetSet)(?P<type>Stylesheet|Alternate|Prev|Next)$/',
+            $method,
+            $matches
+        )) {
             $argc   = count($args);
             $action = $matches['action'];
             $type   = $matches['type'];
@@ -190,7 +200,7 @@
      */
     protected function isValid($value)
     {
-        if (!$value instanceof stdClass) {
+        if (! $value instanceof stdClass) {
             return false;
         }
 
@@ -213,7 +223,7 @@
      */
     public function append($value)
     {
-        if (!$this->isValid($value)) {
+        if (! $this->isValid($value)) {
             throw new Exception\InvalidArgumentException(
                 'append() expects a data token; please use one of the custom append*() methods'
             );
@@ -232,7 +242,7 @@
      */
     public function offsetSet($index, $value)
     {
-        if (!$this->isValid($value)) {
+        if (! $this->isValid($value)) {
             throw new Exception\InvalidArgumentException(
                 'offsetSet() expects a data token; please use one of the custom offsetSet*() methods'
             );
@@ -250,7 +260,7 @@
      */
     public function prepend($value)
     {
-        if (!$this->isValid($value)) {
+        if (! $this->isValid($value)) {
             throw new Exception\InvalidArgumentException(
                 'prepend() expects a data token; please use one of the custom prepend*() methods'
             );
@@ -268,7 +278,7 @@
      */
     public function set($value)
     {
-        if (!$this->isValid($value)) {
+        if (! $this->isValid($value)) {
             throw new Exception\InvalidArgumentException(
                 'set() expects a data token; please use one of the custom set*() methods'
             );
@@ -315,7 +325,7 @@
         }
 
         if (isset($attributes['conditionalStylesheet'])
-            && !empty($attributes['conditionalStylesheet'])
+            && ! empty($attributes['conditionalStylesheet'])
             && is_string($attributes['conditionalStylesheet'])
         ) {
             // inner wrap with comment end and start if !IE
@@ -340,7 +350,7 @@
                 ? $this->getWhitespace($indent)
                 : $this->getIndent();
 
-        $items = array();
+        $items = [];
         $this->getContainer()->ksort();
         foreach ($this as $item) {
             $items[] = $this->itemToString($item);
@@ -378,7 +388,7 @@
             return false;
         }
 
-        if (0 < count($args)) {
+        if ($args) {
             $media = array_shift($args);
             if (is_array($media)) {
                 $media = implode(',', $media);
@@ -386,18 +396,20 @@
                 $media = (string) $media;
             }
         }
-        if (0 < count($args)) {
+        if ($args) {
             $conditionalStylesheet = array_shift($args);
-            if (!empty($conditionalStylesheet) && is_string($conditionalStylesheet)) {
+            if (! empty($conditionalStylesheet) && is_string($conditionalStylesheet)) {
                 $conditionalStylesheet = (string) $conditionalStylesheet;
             } else {
                 $conditionalStylesheet = null;
             }
         }
 
-        if (0 < count($args) && is_array($args[0])) {
+        if ($args && is_array($args[0])) {
             $extras = array_shift($args);
             $extras = (array) $extras;
+        } else {
+            $extras = array();
         }
 
         $attributes = compact('rel', 'type', 'href', 'media', 'conditionalStylesheet', 'extras');
@@ -443,13 +455,15 @@
         $type  = array_shift($args);
         $title = array_shift($args);
 
-        if (0 < count($args) && is_array($args[0])) {
+        if ($args && is_array($args[0])) {
             $extras = array_shift($args);
             $extras = (array) $extras;
 
             if (isset($extras['media']) && is_array($extras['media'])) {
                 $extras['media'] = implode(',', $extras['media']);
             }
+        } else {
+            $extras = array();
         }
 
         $href  = (string) $href;