Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit31a9b35

Browse files
committed
feature#54125 [AssetMapper] Deprecate unused methodsplitPackageNameAndFilePath (smnandre)
This PR was squashed before being merged into the 7.1 branch.Discussion----------[AssetMapper] Deprecate unused method `splitPackageNameAndFilePath`| Q | A| ------------- | ---| Branch? | 7.1| Bug fix? | no| New feature? | no| Deprecations? | yes| Issues |Fix#54123| License | MITThis method is not used in the codebase, and duplicates` ImportMapEntry::splitPackageNameAndFilePath()`Commits-------9af1f34 [AssetMapper] Deprecate unused method `splitPackageNameAndFilePath`
2 parents9482c97 +9af1f34 commit31a9b35

File tree

5 files changed

+28
-0
lines changed

5 files changed

+28
-0
lines changed

‎UPGRADE-7.1.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
UPGRADE FROM 7.0 to 7.1
22
=======================
33

4+
AssetMapper
5+
-----------
6+
7+
* Deprecate`ImportMapConfigReader::splitPackageNameAndFilePath()`, use`ImportMapEntry::splitPackageNameAndFilePath()` instead
8+
49
Cache
510
-----
611

‎src/Symfony/Component/AssetMapper/CHANGELOG.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
=========
33

4+
7.1
5+
---
6+
7+
* Deprecate`ImportMapConfigReader::splitPackageNameAndFilePath()`, use`ImportMapEntry::splitPackageNameAndFilePath()` instead
8+
49
6.4
510
---
611

‎src/Symfony/Component/AssetMapper/ImportMap/ImportMapConfigReader.php‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,13 @@ private function getRootDirectory(): string
172172
return\dirname($this->importMapConfigPath);
173173
}
174174

175+
/**
176+
* @deprecated since Symfony 7.1, use ImportMapEntry::splitPackageNameAndFilePath() instead
177+
*/
175178
publicstaticfunctionsplitPackageNameAndFilePath(string$packageName):array
176179
{
180+
trigger_deprecation('symfony/asset-mapper','7.1','The method "%s()" is deprecated and will be removed in 8.0. Use ImportMapEntry::splitPackageNameAndFilePath() instead.',__METHOD__);
181+
177182
$filePath ='';
178183
$i =strpos($packageName,'/');
179184

‎src/Symfony/Component/AssetMapper/Tests/ImportMap/ImportMapConfigReaderTest.php‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespaceSymfony\Component\AssetMapper\Tests\ImportMap;
1313

1414
usePHPUnit\Framework\TestCase;
15+
useSymfony\Bridge\PhpUnit\ExpectDeprecationTrait;
1516
useSymfony\Component\AssetMapper\ImportMap\ImportMapConfigReader;
1617
useSymfony\Component\AssetMapper\ImportMap\ImportMapEntries;
1718
useSymfony\Component\AssetMapper\ImportMap\ImportMapEntry;
@@ -21,6 +22,8 @@
2122

2223
class ImportMapConfigReaderTestextends TestCase
2324
{
25+
use ExpectDeprecationTrait;
26+
2427
privateFilesystem$filesystem;
2528

2629
protectedfunctionsetUp():void
@@ -162,4 +165,13 @@ public function testFindRootImportMapEntry()
162165
$this->assertSame('file2',$entry->importName);
163166
$this->assertSame('file2.js',$entry->path);
164167
}
168+
169+
/**
170+
* @group legacy
171+
*/
172+
publicfunctiontestDeprecatedMethodTriggerDeprecation()
173+
{
174+
$this->expectDeprecation('Since symfony/asset-mapper 7.1: The method "Symfony\Component\AssetMapper\ImportMap\ImportMapConfigReader::splitPackageNameAndFilePath()" is deprecated and will be removed in 8.0. Use ImportMapEntry::splitPackageNameAndFilePath() instead.');
175+
ImportMapConfigReader::splitPackageNameAndFilePath('foo');
176+
}
165177
}

‎src/Symfony/Component/AssetMapper/composer.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"require": {
1919
"php":">=8.2",
2020
"composer/semver":"^3.0",
21+
"symfony/deprecation-contracts":"^2.1|^3",
2122
"symfony/filesystem":"^6.4|^7.0",
2223
"symfony/http-client":"^6.4|^7.0"
2324
},

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp