@@ -23,8 +23,8 @@ discard block |
||
| 23 | 23 | const PURPOSE_BADGE = "badge"; |
| 24 | 24 | const PURPOSE_ANY = "any"; |
| 25 | 25 | |
| 26 | - private $purpose = [ ]; |
|
| 27 | - private $sizes = [ ]; |
|
| 26 | + private $purpose = []; |
|
| 27 | + private $sizes = []; |
|
| 28 | 28 | private $src; |
| 29 | 29 | private $type; |
| 30 | 30 | |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | public function addSize($width, $height) |
| 77 | 77 | { |
| 78 | - $this->sizes[] = [ (int)$width, (int)$height ]; |
|
| 78 | + $this->sizes[] = [(int)$width, (int)$height]; |
|
| 79 | 79 | return $this; |
| 80 | 80 | } |
| 81 | 81 | |
@@ -51,12 +51,12 @@ |
||
| 51 | 51 | private $description; |
| 52 | 52 | private $direction; |
| 53 | 53 | private $display; |
| 54 | - private $icons = [ ]; |
|
| 54 | + private $icons = []; |
|
| 55 | 55 | private $language; |
| 56 | 56 | private $name; |
| 57 | 57 | private $orientation; |
| 58 | 58 | private $scope; |
| 59 | - private $screenshots = [ ]; |
|
| 59 | + private $screenshots = []; |
|
| 60 | 60 | private $shortName; |
| 61 | 61 | private $startUrl; |
| 62 | 62 | private $themeColor; |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | */ |
| 33 | 33 | public function get(AppConfiguration $configuration) |
| 34 | 34 | { |
| 35 | - $manifest = [ ]; |
|
| 35 | + $manifest = []; |
|
| 36 | 36 | |
| 37 | 37 | if (($backgroundColor = $configuration->getBackgroundColor()) !== null) { |
| 38 | 38 | $manifest["background_color"] = $backgroundColor; |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | if (count($icons = $configuration->getIcons()) > 0) { |
| 54 | - $manifest["icons"] = [ ]; |
|
| 54 | + $manifest["icons"] = []; |
|
| 55 | 55 | |
| 56 | 56 | foreach ($icons as $icon) { |
| 57 | 57 | $manifest["icons"][] = $this->getImageData($icon); |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | if (count($screenshots = $configuration->getScreenshots()) > 0) { |
| 78 | - $manifest["screenshots"] = [ ]; |
|
| 78 | + $manifest["screenshots"] = []; |
|
| 79 | 79 | |
| 80 | 80 | foreach ($screenshots as $screenshot) { |
| 81 | 81 | $manifest["screenshots"][] = $this->getImageData($screenshot); |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | $data["sizes"] = implode( |
| 120 | 120 | " ", |
| 121 | 121 | array_map( |
| 122 | - function (array $size) { |
|
| 122 | + function(array $size) { |
|
| 123 | 123 | return "{$size[0]}x{$size[1]}"; |
| 124 | 124 | }, |
| 125 | 125 | $sizes |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | return implode( |
| 47 | 47 | "\n", |
| 48 | 48 | array_map( |
| 49 | - function (array $tag) { |
|
| 49 | + function(array $tag) { |
|
| 50 | 50 | return $this->renderTag($tag); |
| 51 | 51 | }, |
| 52 | 52 | $this->getData($configuration, $standardTags, $legacyTags, $appleTags, $microsoftTags) |
@@ -114,16 +114,16 @@ discard block |
||
| 114 | 114 | private function getData(AppConfiguration $configuration, $standardTags, $legacyTags, $appleTags, $microsoftTags) |
| 115 | 115 | { |
| 116 | 116 | return array_merge( |
| 117 | - $standardTags ? $this->getStandardTags($configuration) : [ ], |
|
| 118 | - $legacyTags ? $this->getLegacyTags($configuration) : [ ], |
|
| 119 | - $appleTags ? $this->getAppleTags($configuration) : [ ], |
|
| 120 | - $microsoftTags ? $this->getMicrosoftTags($configuration) : [ ] |
|
| 117 | + $standardTags ? $this->getStandardTags($configuration) : [], |
|
| 118 | + $legacyTags ? $this->getLegacyTags($configuration) : [], |
|
| 119 | + $appleTags ? $this->getAppleTags($configuration) : [], |
|
| 120 | + $microsoftTags ? $this->getMicrosoftTags($configuration) : [] |
|
| 121 | 121 | ); |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | private function getStandardTags(AppConfiguration $configuration) |
| 125 | 125 | { |
| 126 | - $tags = [ ]; |
|
| 126 | + $tags = []; |
|
| 127 | 127 | |
| 128 | 128 | // Manifest |
| 129 | 129 | // https://www.w3.org/TR/appmanifest/#using-a-link-element-to-link-to-a-manifest |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | |
| 139 | 139 | private function getLegacyTags(AppConfiguration $configuration) |
| 140 | 140 | { |
| 141 | - $tags = [ ]; |
|
| 141 | + $tags = []; |
|
| 142 | 142 | |
| 143 | 143 | // Application name |
| 144 | 144 | // https://html.spec.whatwg.org/multipage/semantics.html#meta-application-name |
@@ -163,9 +163,9 @@ discard block |
||
| 163 | 163 | // Icons |
| 164 | 164 | // https://html.spec.whatwg.org/multipage/semantics.html#rel-icon |
| 165 | 165 | foreach ($configuration->getIcons() as $icon) { |
| 166 | - if (in_array($icon->getPlatform(), [ null, AppConfiguration::PLATFORM_WEB ])) { |
|
| 166 | + if (in_array($icon->getPlatform(), [null, AppConfiguration::PLATFORM_WEB])) { |
|
| 167 | 167 | $sizes = array_map( |
| 168 | - function (array $size) { |
|
| 168 | + function(array $size) { |
|
| 169 | 169 | return "{$size[0]}x{$size[1]}"; |
| 170 | 170 | }, |
| 171 | 171 | $icon->getSizes() |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | |
| 186 | 186 | private function getAppleTags(AppConfiguration $configuration) |
| 187 | 187 | { |
| 188 | - $tags = [ ]; |
|
| 188 | + $tags = []; |
|
| 189 | 189 | |
| 190 | 190 | // format-detection |
| 191 | 191 | // https://developer.apple.com/library/content/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html#//apple_ref/doc/uid/TP40008193-SW5 |
@@ -207,9 +207,9 @@ discard block |
||
| 207 | 207 | // Icons |
| 208 | 208 | // https://developer.apple.com/library/content/documentation/AppleApplications/Reference/SafariWebContent/ConfiguringWebApplications/ConfiguringWebApplications.html#//apple_ref/doc/uid/TP40002051-CH3-SW4 |
| 209 | 209 | foreach ($configuration->getIcons() as $icon) { |
| 210 | - if (in_array($icon->getPlatform(), [ null, AppConfiguration::PLATFORM_IOS ])) { |
|
| 210 | + if (in_array($icon->getPlatform(), [null, AppConfiguration::PLATFORM_IOS])) { |
|
| 211 | 211 | $sizes = array_map( |
| 212 | - function (array $size) { |
|
| 212 | + function(array $size) { |
|
| 213 | 213 | return "{$size[0]}x{$size[1]}"; |
| 214 | 214 | }, |
| 215 | 215 | $icon->getSizes() |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | |
| 249 | 249 | private function getMicrosoftTags(AppConfiguration $configuration) |
| 250 | 250 | { |
| 251 | - $tags = [ ]; |
|
| 251 | + $tags = []; |
|
| 252 | 252 | |
| 253 | 253 | // Start URL |
| 254 | 254 | // https://msdn.microsoft.com/en-us/library/gg491732(v=vs.85).aspx#msapplication-starturl |