Add AssetManager::getUrl()
(#150)
#599
Annotations
11 warnings
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
|
Run roave infection.:
src/AssetLoader.php#L111
Escaped Mutant for Mutator "UnwrapArrayMerge":
--- Original
+++ New
@@ @@
$bundle->sourcePath = $bundle->sourcePath === null ? null : $this->aliases->get($bundle->sourcePath);
$bundle->cssOptions = array_merge($bundle->cssOptions, $this->cssDefaultOptions);
$bundle->cssPosition ??= $this->cssDefaultPosition;
- $bundle->jsOptions = array_merge($bundle->jsOptions, $this->jsDefaultOptions);
+ $bundle->jsOptions = $bundle->jsOptions;
$bundle->jsPosition ??= $this->jsDefaultPosition;
return $bundle;
}
|
Run roave infection.:
src/AssetManager.php#L391
Escaped Mutant for Mutator "GreaterThan":
--- Original
+++ New
@@ @@
if ($cssPosition !== null) {
if ($bundle->cssPosition === null) {
$bundle->cssPosition = $cssPosition;
- } elseif ($bundle->cssPosition > $cssPosition) {
+ } elseif ($bundle->cssPosition >= $cssPosition) {
throw new RuntimeException("An asset bundle that depends on \"{$name}\" has a higher CSS file " . "position configured than \"{$name}\".");
}
}
|
Run roave infection.:
src/AssetManager.php#L457
Escaped Mutant for Mutator "AssignCoalesce":
--- Original
+++ New
@@ @@
/** @psalm-suppress RedundantConditionGivenDocblockType */
if ($this->customizedBundles[$name] === false) {
/** @psalm-suppress MixedArgumentTypeCoercion */
- return $this->dummyBundles[$name] ??= $this->loader->loadBundle($name, (array) new AssetBundle());
+ return $this->dummyBundles[$name] = $this->loader->loadBundle($name, (array) new AssetBundle());
}
throw new InvalidConfigException("Invalid configuration of the \"{$name}\" asset bundle.");
}
|
Run roave infection.:
src/AssetManager.php#L489
Escaped Mutant for Mutator "PublicVisibility":
--- Original
+++ New
@@ @@
* @throws InvalidConfigException For invalid asset bundle configuration.
* @throws RuntimeException If The asset bundle name is not allowed.
*/
- public function checkAllowedBundleName(string $name) : void
+ protected function checkAllowedBundleName(string $name) : void
{
if (isset($this->loadedBundles[$name]) || in_array($name, $this->allowedBundleNames, true)) {
return;
|
Run roave infection.:
src/AssetPublisher.php#L244
Escaped Mutant for Mutator "Concat":
--- Original
+++ New
@@ @@
$dirname = is_file($path) ? dirname($path) : $path;
$iterator = new RecursiveDirectoryIterator($dirname, RecursiveDirectoryIterator::SKIP_DOTS);
$path = $dirname . (string) FileHelper::lastModifiedTime($iterator) . iterator_count($iterator);
- return sprintf('%x', crc32($path . '|' . $this->linkAssets));
+ return sprintf('%x', crc32($path . $this->linkAssets . '|'));
}
/**
* Publishes a bundle directory.
|
Run roave infection.:
src/AssetPublisher.php#L244
Escaped Mutant for Mutator "ConcatOperandRemoval":
--- Original
+++ New
@@ @@
$dirname = is_file($path) ? dirname($path) : $path;
$iterator = new RecursiveDirectoryIterator($dirname, RecursiveDirectoryIterator::SKIP_DOTS);
$path = $dirname . (string) FileHelper::lastModifiedTime($iterator) . iterator_count($iterator);
- return sprintf('%x', crc32($path . '|' . $this->linkAssets));
+ return sprintf('%x', crc32($path . '|'));
}
/**
* Publishes a bundle directory.
|
Run roave infection.:
src/AssetPublisher.php#L280
Escaped Mutant for Mutator "ArrayItemRemoval":
--- Original
+++ New
@@ @@
}
}
} elseif (!empty($bundle->publishOptions['forceCopy']) || $this->forceCopy && !isset($bundle->publishOptions['forceCopy']) || !is_dir($dstDir)) {
- $publishOptions = ['dirMode' => $this->dirMode, 'fileMode' => $this->fileMode, 'copyEmptyDirectories' => false];
+ $publishOptions = ['fileMode' => $this->fileMode, 'copyEmptyDirectories' => false];
foreach (['afterCopy', 'beforeCopy', 'filter', 'recursive'] as $key) {
if (array_key_exists($key, $bundle->publishOptions)) {
$publishOptions[$key] = $bundle->publishOptions[$key];
|
Run roave infection.:
src/AssetPublisher.php#L285
Escaped Mutant for Mutator "ArrayItemRemoval":
--- Original
+++ New
@@ @@
}
} elseif (!empty($bundle->publishOptions['forceCopy']) || $this->forceCopy && !isset($bundle->publishOptions['forceCopy']) || !is_dir($dstDir)) {
$publishOptions = ['dirMode' => $this->dirMode, 'fileMode' => $this->fileMode, 'copyEmptyDirectories' => false];
- foreach (['afterCopy', 'beforeCopy', 'filter', 'recursive'] as $key) {
+ foreach (['beforeCopy', 'filter', 'recursive'] as $key) {
if (array_key_exists($key, $bundle->publishOptions)) {
$publishOptions[$key] = $bundle->publishOptions[$key];
}
|
Run roave infection.:
src/AssetRegistrar.php#L119
Escaped Mutant for Mutator "CloneRemoval":
--- Original
+++ New
@@ @@
*/
public function withConverter(AssetConverterInterface $converter) : self
{
- $new = clone $this;
+ $new = $this;
$new->converter = $converter;
return $new;
}
|
Run roave infection.:
src/AssetRegistrar.php#L129
Escaped Mutant for Mutator "CloneRemoval":
--- Original
+++ New
@@ @@
*/
public function withLoader(AssetLoaderInterface $loader) : self
{
- $new = clone $this;
+ $new = $this;
$new->loader = $loader;
return $new;
}
|
Loading