Completed
Push — master ( 6c566f...878a3a )
by Michal
03:44
created
src/Webrouse/AssetMacro/AssetMacro.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -46,9 +46,9 @@  discard block
 block discarded – undo
46 46
 			'::appendVersion(' .
47 47
 			'%node.word, ' .
48 48
 			'$template->global->' . self::VERSIONS_PROVIDER . ', ' .
49
-			'$template->global->' . self::WWW_DIR_PROVIDER  .
49
+			'$template->global->' . self::WWW_DIR_PROVIDER .
50 50
 			')';
51
-		return $writer->write('echo $basePath . "/" . %escape(' . $content .')');
51
+		return $writer->write('echo $basePath . "/" . %escape(' . $content . ')');
52 52
 	}
53 53
 
54 54
 
@@ -76,15 +76,15 @@  discard block
 block discarded – undo
76 76
 			$versions = self::autodetectVersionsFile($absolutePath, $normalizedWwwDir);
77 77
 		}
78 78
 
79
-		if ( ! is_array($versions)) {
80
-			if ( ! file_exists($versions)) {
79
+		if (!is_array($versions)) {
80
+			if (!file_exists($versions)) {
81 81
 				throw new FileNotFoundException(sprintf("Asset versions file not found: '%s'.", $versions));
82 82
 			}
83 83
 			$versions = Json::decode(file_get_contents($versions), Json::FORCE_ARRAY);
84 84
 		}
85 85
 
86
-		$assetHash =  'unknown';
87
-		foreach($versions as $path => $hash) {
86
+		$assetHash = 'unknown';
87
+		foreach ($versions as $path => $hash) {
88 88
 			// Test if path from version file (may be relative) is in asset path
89 89
 			if (Strings::endsWith($absolutePath, $path)) {
90 90
 				$assetHash = $hash;
@@ -117,8 +117,8 @@  discard block
 block discarded – undo
117 117
 
118 118
 		// Iterate over parent directories (stop in www dir)
119 119
 		$dir = dirname($absolutePath);
120
-		while(Strings::startsWith($dir, $wwwDir)) {
121
-			foreach(self::VERSIONS_AUTODETECT_PATHS as $path) {
120
+		while (Strings::startsWith($dir, $wwwDir)) {
121
+			foreach (self::VERSIONS_AUTODETECT_PATHS as $path) {
122 122
 				$path = $dir . DIRECTORY_SEPARATOR . $path;
123 123
 				if (file_exists($path)) {
124 124
 					return $path;
Please login to merge, or discard this patch.