@@ -29,9 +29,9 @@ discard block |
||
29 | 29 | 'rev-manifest.json', |
30 | 30 | ], |
31 | 31 | // Error handling |
32 | - 'missingAsset' => 'notice', // exception, notice, or ignore |
|
32 | + 'missingAsset' => 'notice', // exception, notice, or ignore |
|
33 | 33 | 'missingManifest' => 'notice', // exception, notice, or ignore |
34 | - 'missingRevision' => 'ignore', // exception, notice, or ignore |
|
34 | + 'missingRevision' => 'ignore', // exception, notice, or ignore |
|
35 | 35 | ]; |
36 | 36 | |
37 | 37 | |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | */ |
66 | 66 | private function validateChoices($key, array $choices) |
67 | 67 | { |
68 | - if ( ! in_array($this->config[$key], $choices)) { |
|
68 | + if (!in_array($this->config[$key], $choices)) { |
|
69 | 69 | throw new UnexpectedValueException(sprintf( |
70 | 70 | "Unexpected value '%s' of '%s' configuration key. Allowed values: %s.", |
71 | 71 | $this->config[$key], |
@@ -38,8 +38,8 @@ |
||
38 | 38 | |
39 | 39 | public function beforeCompile() |
40 | 40 | { |
41 | - $builder = $this->getContainerBuilder(); |
|
42 | - $config = Helpers::expand($this->validateConfig($this->defaults), $builder->parameters); |
|
41 | + $builder = $this->getContainerBuilder(); |
|
42 | + $config = Helpers::expand($this->validateConfig($this->defaults), $builder->parameters); |
|
43 | 43 | |
44 | 44 | // Validate configuration |
45 | 45 | Validators::assertField($config, 'wwwDir', 'string'); |
@@ -69,14 +69,13 @@ discard block |
||
69 | 69 | $revision = $manifest === NULL ? NULL : self::resolveRevision($manifest, $path, $need, $config); |
70 | 70 | |
71 | 71 | // Is revision only version (query parameter) or full path to asset? |
72 | - $revisionIsVersion = $revision === NULL || ! Strings::match($revision, '/[.\/]/'); |
|
72 | + $revisionIsVersion = $revision === NULL || !Strings::match($revision, '/[.\/]/'); |
|
73 | 73 | |
74 | 74 | // Check if asset exists |
75 | 75 | $ds = DIRECTORY_SEPARATOR; |
76 | 76 | $filePath = $revisionIsVersion ? |
77 | - ($wwwDir . $ds . $path) : |
|
78 | - ($wwwDir . $ds . Utils::normalizePath($revision)); |
|
79 | - if ( ! file_exists($filePath)) { |
|
77 | + ($wwwDir . $ds . $path) : ($wwwDir . $ds . Utils::normalizePath($revision)); |
|
78 | + if (!file_exists($filePath)) { |
|
80 | 79 | Utils::throwError( |
81 | 80 | new AssetNotFoundException(sprintf("Asset '%s' not found.", $filePath)), |
82 | 81 | $config['missingAsset'], |
@@ -105,7 +104,7 @@ discard block |
||
105 | 104 | |
106 | 105 | return Strings::replace($format, |
107 | 106 | '/%([^%]+)%/', |
108 | - function ($matches) use ($basePath, $format, $path, $revision, $revisionIsVersion) { |
|
107 | + function($matches) use ($basePath, $format, $path, $revision, $revisionIsVersion) { |
|
109 | 108 | switch ($matches[1]) { |
110 | 109 | case 'raw': |
111 | 110 | return $revision; |
@@ -115,8 +114,7 @@ discard block |
||
115 | 114 | return $path; |
116 | 115 | case 'url': |
117 | 116 | return $revisionIsVersion ? |
118 | - sprintf("%s/%s?v=%s", $basePath, $path, $revision) : |
|
119 | - sprintf("%s/%s", $basePath, $path); |
|
117 | + sprintf("%s/%s?v=%s", $basePath, $path, $revision) : sprintf("%s/%s", $basePath, $path); |
|
120 | 118 | default: |
121 | 119 | $msg = sprintf( |
122 | 120 | "Asset macro: Invalid variable '%s' in format '%s'. " . |
@@ -168,7 +166,7 @@ discard block |
||
168 | 166 | |
169 | 167 | // Path to JSON manifest |
170 | 168 | if (is_string($manifest)) { |
171 | - if ( ! file_exists($manifest)) { |
|
169 | + if (!file_exists($manifest)) { |
|
172 | 170 | Utils::throwError( |
173 | 171 | new ManifestNotFoundException(sprintf("Manifest file not found: '%s'.", $manifest)), |
174 | 172 | $config['missingManifest'], |