@@ -47,9 +47,9 @@ discard block |
||
47 | 47 | '::appendVersion(' . |
48 | 48 | '%node.word, ' . |
49 | 49 | '$template->global->' . self::VERSIONS_PROVIDER . ', ' . |
50 | - '$template->global->' . self::WWW_DIR_PROVIDER . |
|
50 | + '$template->global->' . self::WWW_DIR_PROVIDER . |
|
51 | 51 | ')'; |
52 | - return $writer->write('echo $basePath . "/" . %escape(' . $content .')'); |
|
52 | + return $writer->write('echo $basePath . "/" . %escape(' . $content . ')'); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | |
@@ -91,14 +91,14 @@ discard block |
||
91 | 91 | private static function getAssetVersion($assetsVersions, $absolutePath) |
92 | 92 | { |
93 | 93 | // Versions can be array or path to JSON file |
94 | - if ( ! is_array($assetsVersions)) { |
|
95 | - if ( ! file_exists($assetsVersions)) { |
|
94 | + if (!is_array($assetsVersions)) { |
|
95 | + if (!file_exists($assetsVersions)) { |
|
96 | 96 | throw new FileNotFoundException(sprintf("Asset versions file not found: '%s'.", $assetsVersions)); |
97 | 97 | } |
98 | 98 | $assetsVersions = Json::decode(file_get_contents($assetsVersions), Json::FORCE_ARRAY); |
99 | 99 | } |
100 | 100 | |
101 | - foreach($assetsVersions as $path => $hash) { |
|
101 | + foreach ($assetsVersions as $path => $hash) { |
|
102 | 102 | // Test if path from version file (may be relative) is in asset path |
103 | 103 | if (Strings::endsWith($absolutePath, $path)) { |
104 | 104 | return $hash; |
@@ -130,8 +130,8 @@ discard block |
||
130 | 130 | |
131 | 131 | // Iterate over parent directories (stop in www dir) |
132 | 132 | $dir = dirname($absolutePath); |
133 | - while(Strings::startsWith($dir, $wwwDir)) { |
|
134 | - foreach(self::VERSIONS_AUTODETECT_PATHS as $path) { |
|
133 | + while (Strings::startsWith($dir, $wwwDir)) { |
|
134 | + foreach (self::VERSIONS_AUTODETECT_PATHS as $path) { |
|
135 | 135 | $path = $dir . DIRECTORY_SEPARATOR . $path; |
136 | 136 | if (file_exists($path)) { |
137 | 137 | return $path; |