Completed
Push — master ( 68b8eb...1548d7 )
by Michal
02:11
created
src/Webrouse/AssetMacro/AssetMacro.php 1 patch
Spacing   +7 added lines, -8 removed lines patch added patch discarded remove patch
@@ -80,8 +80,7 @@  discard block
 block discarded – undo
80 80
 		// Get asset version
81 81
 		$version = self::getAssetVersion(
82 82
 			$config['versions'] === self::VERSIONS_AUTODETECT ?
83
-				self::autodetectVersions($absolutePath, $wwwDir, $config['autodetectPaths']) :
84
-				$config['versions'],
83
+				self::autodetectVersions($absolutePath, $wwwDir, $config['autodetectPaths']) : $config['versions'],
85 84
 			$absolutePath,
86 85
 			$config
87 86
 		);
@@ -89,7 +88,7 @@  discard block
 block discarded – undo
89 88
 		// Generate output according format argument
90 89
 		return Strings::replace($format,
91 90
 			'/%([^%]+)%/',
92
-			function ($matches) use ($basePath, $format, $relativePath, $version) {
91
+			function($matches) use ($basePath, $format, $relativePath, $version) {
93 92
 				switch ($matches[1]) {
94 93
 					case 'url':
95 94
 						return sprintf("%s/%s?v=%s", $basePath, $relativePath, $version);
@@ -142,19 +141,19 @@  discard block
 block discarded – undo
142 141
 		}
143 142
 
144 143
 		// Validate arguments
145
-		if ( ! is_string($relativePath)) {
144
+		if (!is_string($relativePath)) {
146 145
 			throw new InvalidArgumentException(sprintf(
147 146
 				"Asset macro: Invalid type of the path argument. Required string. Given %s.",
148 147
 				gettype($relativePath)
149 148
 			));
150 149
 		}
151
-		if ( ! is_string($format)) {
150
+		if (!is_string($format)) {
152 151
 			throw new InvalidArgumentException(sprintf(
153 152
 				"Asset macro: Invalid type of the format argument. Required string. Given %s.",
154 153
 				gettype($format)
155 154
 			));
156 155
 		}
157
-		if ( ! is_bool($needed)) {
156
+		if (!is_bool($needed)) {
158 157
 			throw new InvalidArgumentException(sprintf(
159 158
 				"Asset macro: Invalid type of the needed argument. Required boolean. Given %s.",
160 159
 				gettype($needed)
@@ -203,8 +202,8 @@  discard block
 block discarded – undo
203 202
 	private static function getAssetVersion($assetsVersions, $absolutePath, array $config)
204 203
 	{
205 204
 		// Versions can be array or path to JSON file
206
-		if ( ! is_array($assetsVersions)) {
207
-			if ( ! file_exists($assetsVersions)) {
205
+		if (!is_array($assetsVersions)) {
206
+			if (!file_exists($assetsVersions)) {
208 207
 				throw new FileNotFoundException(sprintf("Asset versions file not found: '%s'.", $assetsVersions));
209 208
 			}
210 209
 			$assetsVersions = Json::decode(file_get_contents($assetsVersions), Json::FORCE_ARRAY);
Please login to merge, or discard this patch.