Completed
Push — master ( 69eb71...121335 )
by Michal
02:13
created
src/Webrouse/AssetMacro/DI/Extension.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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'],
Please login to merge, or discard this patch.
src/Webrouse/AssetMacro/AssetMacro.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -74,19 +74,19 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.