@@ -73,8 +73,7 @@ discard block |
||
73 | 73 | |
74 | 74 | // Get asset version |
75 | 75 | $versions = $config['versions'] === self::VERSIONS_AUTODETECT ? |
76 | - self::autodetectVersions($absolutePath, $wwwDir, $config['autodetectPaths']) : |
|
77 | - $config['versions']; |
|
76 | + self::autodetectVersions($absolutePath, $wwwDir, $config['autodetectPaths']) : $config['versions']; |
|
78 | 77 | $version = self::getAssetVersion($versions, $absolutePath, $config); |
79 | 78 | |
80 | 79 | return self::formatOutput($format, $basePath, $relativePath, $version); |
@@ -93,7 +92,7 @@ discard block |
||
93 | 92 | { |
94 | 93 | return Strings::replace($format, |
95 | 94 | '/%([^%]+)%/', |
96 | - function ($matches) use ($basePath, $format, $relativePath, $version) { |
|
95 | + function($matches) use ($basePath, $format, $relativePath, $version) { |
|
97 | 96 | switch ($matches[1]) { |
98 | 97 | case 'url': |
99 | 98 | return sprintf("%s/%s?v=%s", $basePath, $relativePath, $version); |
@@ -126,23 +125,23 @@ discard block |
||
126 | 125 | private static function processArguments($path, array $args) |
127 | 126 | { |
128 | 127 | $relativePath = $path; |
129 | - $format = isset($args['format']) ? $args['format'] : (isset($args[0]) ? $args[0] : '%url%'); |
|
130 | - $needed = isset($args['needed']) ? $args['needed'] : (isset($args[1]) ? $args[1] : TRUE); |
|
128 | + $format = isset($args['format']) ? $args['format'] : (isset($args[0]) ? $args[0] : '%url%'); |
|
129 | + $needed = isset($args['needed']) ? $args['needed'] : (isset($args[1]) ? $args[1] : TRUE); |
|
131 | 130 | |
132 | 131 | // Validate arguments |
133 | - if ( ! is_string($relativePath)) { |
|
132 | + if (!is_string($relativePath)) { |
|
134 | 133 | throw new InvalidArgumentException(sprintf( |
135 | 134 | "Asset macro: Invalid type of the path argument. Required string. Given %s.", |
136 | 135 | gettype($relativePath) |
137 | 136 | )); |
138 | 137 | } |
139 | - if ( ! is_string($format)) { |
|
138 | + if (!is_string($format)) { |
|
140 | 139 | throw new InvalidArgumentException(sprintf( |
141 | 140 | "Asset macro: Invalid type of the format argument. Required string. Given %s.", |
142 | 141 | gettype($format) |
143 | 142 | )); |
144 | 143 | } |
145 | - if ( ! is_bool($needed)) { |
|
144 | + if (!is_bool($needed)) { |
|
146 | 145 | throw new InvalidArgumentException(sprintf( |
147 | 146 | "Asset macro: Invalid type of the needed argument. Required boolean. Given %s.", |
148 | 147 | gettype($needed) |
@@ -191,8 +190,8 @@ discard block |
||
191 | 190 | private static function getAssetVersion($assetsVersions, $absolutePath, array $config) |
192 | 191 | { |
193 | 192 | // Versions can be array or path to JSON file |
194 | - if ( ! is_array($assetsVersions)) { |
|
195 | - if ( ! file_exists($assetsVersions)) { |
|
193 | + if (!is_array($assetsVersions)) { |
|
194 | + if (!file_exists($assetsVersions)) { |
|
196 | 195 | throw new FileNotFoundException(sprintf("Asset versions file not found: '%s'.", $assetsVersions)); |
197 | 196 | } |
198 | 197 | $assetsVersions = Json::decode(file_get_contents($assetsVersions), Json::FORCE_ARRAY); |