@@ -74,11 +74,10 @@ discard block |
||
| 74 | 74 | |
| 75 | 75 | // Get asset version |
| 76 | 76 | try { |
| 77 | - $versions = $config['revManifest'] ?: |
|
| 78 | - self::autodetectVersions($absolutePath, $wwwDir, $config['autodetect']); |
|
| 77 | + $versions = $config['revManifest'] ?: self::autodetectVersions($absolutePath, $wwwDir, $config['autodetect']); |
|
| 79 | 78 | $version = self::getAssetVersion($versions, $absolutePath, $needed, $config); |
| 80 | 79 | |
| 81 | - } catch(ManifestNotFoundException $e) { |
|
| 80 | + } catch (ManifestNotFoundException $e) { |
|
| 82 | 81 | self::throwError($e, $config['missingManifest'], $needed); |
| 83 | 82 | $version = 'unknown'; |
| 84 | 83 | } |
@@ -99,7 +98,7 @@ discard block |
||
| 99 | 98 | { |
| 100 | 99 | return Strings::replace($format, |
| 101 | 100 | '/%([^%]+)%/', |
| 102 | - function ($matches) use ($basePath, $format, $relativePath, $version) { |
|
| 101 | + function($matches) use ($basePath, $format, $relativePath, $version) { |
|
| 103 | 102 | switch ($matches[1]) { |
| 104 | 103 | case 'url': |
| 105 | 104 | return sprintf("%s/%s?v=%s", $basePath, $relativePath, $version); |
@@ -176,8 +175,8 @@ discard block |
||
| 176 | 175 | private static function getAssetVersion($assetsVersions, $absolutePath, $needed, array $config) |
| 177 | 176 | { |
| 178 | 177 | // Versions can be array or path to JSON file |
| 179 | - if ( ! is_array($assetsVersions)) { |
|
| 180 | - if ( ! file_exists($assetsVersions)) { |
|
| 178 | + if (!is_array($assetsVersions)) { |
|
| 179 | + if (!file_exists($assetsVersions)) { |
|
| 181 | 180 | throw new ManifestNotFoundException(sprintf("Revision manifest file not found: '%s'.", $assetsVersions)); |
| 182 | 181 | } |
| 183 | 182 | $assetsVersions = Json::decode(file_get_contents($assetsVersions), Json::FORCE_ARRAY); |
@@ -22,9 +22,9 @@ discard block |
||
| 22 | 22 | 'versions.json', |
| 23 | 23 | 'rev-manifest.json', |
| 24 | 24 | ], |
| 25 | - 'missingAsset' => 'notice', // exception, notice, or ignore |
|
| 25 | + 'missingAsset' => 'notice', // exception, notice, or ignore |
|
| 26 | 26 | 'missingManifest' => 'notice', // exception, notice, or ignore |
| 27 | - 'missingVersion' => 'ignore', // exception, notice, or ignore |
|
| 27 | + 'missingVersion' => 'ignore', // exception, notice, or ignore |
|
| 28 | 28 | ]; |
| 29 | 29 | |
| 30 | 30 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | */ |
| 54 | 54 | private function validateChoices($key, array $choices) |
| 55 | 55 | { |
| 56 | - if ( ! in_array($this->config[$key], $choices)) { |
|
| 56 | + if (!in_array($this->config[$key], $choices)) { |
|
| 57 | 57 | throw new UnexpectedValueException(sprintf( |
| 58 | 58 | "Unexpected value '%s' of '%s' configuration key. Allowed values: %s.", |
| 59 | 59 | $this->config[$key], |