Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit dd0ad20

Browse filesBrowse files
committed
fabbot
1 parent 6200219 commit dd0ad20
Copy full SHA for dd0ad20
Expand file treeCollapse file tree

9 files changed

+39
-15
lines changed

‎src/Symfony/Component/Asset/Pipeline/Compiler/AssetCompilerPathResolverTrait.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Asset/Pipeline/Compiler/AssetCompilerPathResolverTrait.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use Symfony\Component\Asset\Exception\RuntimeException;
1515

1616
/**
17-
* Helps resolve "../" and "./" in paths
17+
* Helps resolve "../" and "./" in paths.
1818
*
1919
* @internal
2020
*/
@@ -27,7 +27,7 @@ private function resolvePath(string $directory, string $filename): string
2727

2828
foreach ($pathParts as $part) {
2929
if ('..' === $part) {
30-
if (0 === count($output)) {
30+
if (0 === \count($output)) {
3131
throw new RuntimeException(sprintf('Cannot import the file "%s": it is outside the current "%s" directory.', $filename, $directory));
3232
}
3333

‎src/Symfony/Component/Asset/Pipeline/Compiler/CssAssetUrlCompiler.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Asset/Pipeline/Compiler/CssAssetUrlCompiler.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function compile(string $logicalPath, string $contents, AssetPipeline $pi
3232
$directory = '';
3333
}
3434

35-
return preg_replace_callback(self::ASSET_URL_PATTERN, function ($matches) use ($logicalPath, $pipeline, $directory) {
35+
return preg_replace_callback(self::ASSET_URL_PATTERN, function ($matches) use ($pipeline, $directory) {
3636
$resolvedPath = $this->resolvePath($directory, $matches[1]);
3737
$asset = $pipeline->getAsset($resolvedPath);
3838

‎src/Symfony/Component/Asset/Pipeline/Compiler/JavaScriptImportPathCompiler.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Asset/Pipeline/Compiler/JavaScriptImportPathCompiler.php
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ public function compile(string $logicalPath, string $contents, AssetPipeline $pi
4646
}
4747

4848
return str_replace($matches[1], $asset->getPublicPath(), $matches[0]);
49-
5049
}, $contents);
5150
}
5251

‎src/Symfony/Component/Asset/Tests/Pipeline/AssetPipelineCompilerTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Asset/Tests/Pipeline/AssetPipelineCompilerTest.php
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function testCompile()
2323
$compiler1 = new class() implements AssetCompilerInterface {
2424
public function supports(string $mimeType): bool
2525
{
26-
return $mimeType === 'text/css';
26+
return 'text/css' === $mimeType;
2727
}
2828

2929
public function compile(string $logicalPath, string $contents, AssetPipeline $pipeline): string
@@ -35,24 +35,24 @@ public function compile(string $logicalPath, string $contents, AssetPipeline $pi
3535
$compiler2 = new class() implements AssetCompilerInterface {
3636
public function supports(string $mimeType): bool
3737
{
38-
return $mimeType === 'application/javascript';
38+
return 'application/javascript' === $mimeType;
3939
}
4040

4141
public function compile(string $logicalPath, string $contents, AssetPipeline $pipeline): string
4242
{
43-
return $contents . ' compiler2 called';
43+
return $contents.' compiler2 called';
4444
}
4545
};
4646

4747
$compiler3 = new class() implements AssetCompilerInterface {
4848
public function supports(string $mimeType): bool
4949
{
50-
return $mimeType === 'application/javascript';
50+
return 'application/javascript' === $mimeType;
5151
}
5252

5353
public function compile(string $logicalPath, string $contents, AssetPipeline $pipeline): string
5454
{
55-
return $contents . ' compiler3 called';
55+
return $contents.' compiler3 called';
5656
}
5757
};
5858

‎src/Symfony/Component/Asset/Tests/Pipeline/AssetPipelineTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Asset/Tests/Pipeline/AssetPipelineTest.php
+11-2Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace Symfony\Component\Asset\Tests\Pipeline;
413

514
use Symfony\Bundle\TwigBundle\Tests\TestCase;
@@ -116,8 +125,8 @@ public function supports(string $mimeType): bool
116125

117126
public function compile(string $logicalPath, string $contents, AssetPipeline $pipeline): string
118127
{
119-
if ($logicalPath === 'subdir/file5.js') {
120-
return $contents . '/* compiled */';
128+
if ('subdir/file5.js' === $logicalPath) {
129+
return $contents.'/* compiled */';
121130
}
122131

123132
return $contents;

‎src/Symfony/Component/Asset/Tests/Pipeline/Compiler/JavaScriptImportPathCompilerTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Asset/Tests/Pipeline/Compiler/JavaScriptImportPathCompilerTest.php
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Component\Asset\Tests\Pipeline\Compiler;
1313

1414
use PHPUnit\Framework\TestCase;
15-
use Symfony\Component\Asset\Exception\RuntimeException;
1615
use Symfony\Component\Asset\Pipeline\AssetPipeline;
1716
use Symfony\Component\Asset\Pipeline\Compiler\JavaScriptImportPathCompiler;
1817
use Symfony\Component\Asset\Pipeline\PipelinedAsset;

‎src/Symfony/Component/Asset/Tests/Pipeline/Compiler/SourceMappingUrlsCompilerTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Asset/Tests/Pipeline/Compiler/SourceMappingUrlsCompilerTest.php
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
use PHPUnit\Framework\TestCase;
1515
use Symfony\Component\Asset\Pipeline\AssetPipeline;
16-
use Symfony\Component\Asset\Pipeline\Compiler\CssAssetUrlCompiler;
1716
use Symfony\Component\Asset\Pipeline\Compiler\SourceMappingUrlsCompiler;
1817
use Symfony\Component\Asset\Pipeline\PipelinedAsset;
1918

‎src/Symfony/Component/Asset/Tests/Pipeline/PipelineAwareAssetPackageIntegrationTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Asset/Tests/Pipeline/PipelineAwareAssetPackageIntegrationTest.php
+10-1Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace Symfony\Component\Asset\Tests\Pipeline;
413

514
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
@@ -14,7 +23,7 @@ public function testDefaultAssetPackageIsDecorated(): void
1423
$kernel->boot();
1524

1625
$packages = $kernel->getContainer()->get('public.assets.packages');
17-
assert($packages instanceof Packages);
26+
\assert($packages instanceof Packages);
1827
$this->assertSame('/assets/file1-b3445cb7a86a0795a7af7f2004498aef.css', $packages->getUrl('file1.css'));
1928
$this->assertSame('/non-existent.css', $packages->getUrl('non-existent.css'));
2029
}

‎src/Symfony/Component/Asset/Tests/fixtures/pipeline/PipelineTestAppKernel.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Asset/Tests/fixtures/pipeline/PipelineTestAppKernel.php
+10-1Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace Symfony\Component\Asset\Tests\fixtures\pipeline;
413

514
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
@@ -30,7 +39,7 @@ public function registerContainerConfiguration(LoaderInterface $loader): void
3039
'assets' => [
3140
'pipeline' => [
3241
'paths' => ['dir1', 'dir2'],
33-
]
42+
],
3443
],
3544
'test' => true,
3645
]);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.