Skip to content

Commit 3bc382e

Browse files
committed
Fix QA
1 parent acb5e92 commit 3bc382e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Loader/AbstractWebpackLoader.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ protected static function isModule(string $fileName): bool
149149
{
150150
// TODO replace it with `str_ends_with` once dropping support for php 7.4
151151
$str_ends_with = function (string $haystack, string $needle): bool {
152-
return 0 === substr_compare($haystack, $needle, - strlen($needle));
152+
return substr_compare($haystack, $needle, -strlen($needle)) === 0;
153153
};
154154
return $str_ends_with($fileName, '.module.js') || $str_ends_with($fileName, '.mjs');
155155
}
@@ -180,13 +180,13 @@ protected function sanitizeFileName(string $file): string
180180
* Internal function to sanitize the handle based on the file
181181
* by taking into consideration that @vendor can be present.
182182
*
183-
* @example /path/to/script.js -> script
184-
* @example @vendor/script.module.js -> @vendor/script.module
185-
* @example /path/to/@vendor/script.module.js -> @vendor/script.module
186-
*
187183
* @param string $file
188184
*
189185
* @return string
186+
* @example /path/to/@vendor/script.module.js -> @vendor/script.module
187+
*
188+
* @example /path/to/script.js -> script
189+
* @example @vendor/script.module.js -> @vendor/script.module
190190
*/
191191
protected function sanitizeHandle(string $file): string
192192
{

0 commit comments

Comments
 (0)