@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | 'rev-manifest.json', |
24 | 24 | ], |
25 | 25 | 'missingAsset' => 'exception', // exception, notice, or ignore |
26 | - 'missingVersion' => 'ignore', // exception, notice, or ignore |
|
26 | + 'missingVersion' => 'ignore', // exception, notice, or ignore |
|
27 | 27 | ]; |
28 | 28 | |
29 | 29 | |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | $config = $this->getContainerBuilder()->expand($this->validateConfig($this->defaults)); |
33 | 33 | |
34 | 34 | $errorHandling = ['exception', 'notice', 'ignore']; |
35 | - if ( ! in_array($config['missingAsset'], $errorHandling)) { |
|
35 | + if (!in_array($config['missingAsset'], $errorHandling)) { |
|
36 | 36 | throw new UnexpectedValueException(sprintf( |
37 | 37 | "Unexpected value '%s' of '%s' configuration key. Allowed values: %s.", |
38 | 38 | $config['missingAsset'], |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | implode(', ', $errorHandling) |
41 | 41 | )); |
42 | 42 | } |
43 | - if ( ! in_array($config['missingVersion'], $errorHandling)) { |
|
43 | + if (!in_array($config['missingVersion'], $errorHandling)) { |
|
44 | 44 | throw new UnexpectedValueException(sprintf( |
45 | 45 | "Unexpected value '%s' of '%s' configuration key. Allowed values: %s.", |
46 | 46 | $config['missingVersion'], |
@@ -74,19 +74,19 @@ discard block |
||
74 | 74 | $needed = isset($args[2]) ? $args[2] : TRUE; |
75 | 75 | |
76 | 76 | // Validate arguments |
77 | - if ( ! is_string($relativePath)) { |
|
77 | + if (!is_string($relativePath)) { |
|
78 | 78 | throw new InvalidArgumentException(sprintf( |
79 | 79 | "Asset macro: Invalid type of the first argument. Required string. Given %s.", |
80 | 80 | gettype($relativePath) |
81 | 81 | )); |
82 | 82 | } |
83 | - if ( ! is_string($format)) { |
|
83 | + if (!is_string($format)) { |
|
84 | 84 | throw new InvalidArgumentException(sprintf( |
85 | 85 | "Asset macro: Invalid type of the second argument. Required string. Given %s.", |
86 | 86 | gettype($format) |
87 | 87 | )); |
88 | 88 | } |
89 | - if ( ! is_bool($needed)) { |
|
89 | + if (!is_bool($needed)) { |
|
90 | 90 | throw new InvalidArgumentException(sprintf( |
91 | 91 | "Asset macro: Invalid type of the third argument. Required boolean. Given %s.", |
92 | 92 | gettype($needed) |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | // Generate output according format argument |
122 | 122 | return Strings::replace($format, |
123 | 123 | '/%([^%]+)%/', |
124 | - function ($matches) use ($basePath, $format, $relativePath, $version) { |
|
124 | + function($matches) use ($basePath, $format, $relativePath, $version) { |
|
125 | 125 | switch ($matches[1]) { |
126 | 126 | case 'url': |
127 | 127 | return sprintf("%s/%s?v=%s", $basePath, $relativePath, $version); |
@@ -155,8 +155,8 @@ discard block |
||
155 | 155 | private static function getAssetVersion($assetsVersions, $absolutePath, array $config) |
156 | 156 | { |
157 | 157 | // Versions can be array or path to JSON file |
158 | - if ( ! is_array($assetsVersions)) { |
|
159 | - if ( ! file_exists($assetsVersions)) { |
|
158 | + if (!is_array($assetsVersions)) { |
|
159 | + if (!file_exists($assetsVersions)) { |
|
160 | 160 | throw new FileNotFoundException(sprintf("Asset versions file not found: '%s'.", $assetsVersions)); |
161 | 161 | } |
162 | 162 | $assetsVersions = Json::decode(file_get_contents($assetsVersions), Json::FORCE_ARRAY); |