Skip to content

Commit f433386

Browse files
committed
[AssetMapper] Remove ImportMapConfigReader::splitPackageNameAndFilePath()
1 parent 3079218 commit f433386

File tree

4 files changed

+10
-31
lines changed

4 files changed

+10
-31
lines changed

UPGRADE-8.0.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ release process, both versions have the same features, but Symfony 8.0 doesn't i
66
To upgrade, make sure to resolve all deprecation notices.
77
Read more about this in the [Symfony documentation](https://symfony.com/doc/8.0/setup/upgrade_major.html).
88

9+
AssetMapper
10+
-----------
11+
12+
* Remove `ImportMapConfigReader::splitPackageNameAndFilePath()`, use `ImportMapEntry::splitPackageNameAndFilePath()` instead
13+
914
Console
1015
-------
1116

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+
8.0
5+
---
6+
7+
* Remove `ImportMapConfigReader::splitPackageNameAndFilePath()`, use `ImportMapEntry::splitPackageNameAndFilePath()` instead
8+
49
7.3
510
---
611

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

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -174,23 +174,4 @@ private function getRootDirectory(): string
174174
{
175175
return \dirname($this->importMapConfigPath);
176176
}
177-
178-
/**
179-
* @deprecated since Symfony 7.1, use ImportMapEntry::splitPackageNameAndFilePath() instead
180-
*/
181-
public static function splitPackageNameAndFilePath(string $packageName): array
182-
{
183-
trigger_deprecation('symfony/asset-mapper', '7.1', 'The method "%s()" is deprecated and will be removed in 8.0. Use ImportMapEntry::splitPackageNameAndFilePath() instead.', __METHOD__);
184-
185-
$filePath = '';
186-
$i = strpos($packageName, '/');
187-
188-
if ($i && (!str_starts_with($packageName, '@') || $i = strpos($packageName, '/', $i + 1))) {
189-
// @vendor/package/filepath or package/filepath
190-
$filePath = substr($packageName, $i);
191-
$packageName = substr($packageName, 0, $i);
192-
}
193-
194-
return [$packageName, $filePath];
195-
}
196177
}

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

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

1414
use PHPUnit\Framework\TestCase;
15-
use Symfony\Bridge\PhpUnit\ExpectUserDeprecationMessageTrait;
1615
use Symfony\Component\AssetMapper\ImportMap\ImportMapConfigReader;
1716
use Symfony\Component\AssetMapper\ImportMap\ImportMapEntries;
1817
use Symfony\Component\AssetMapper\ImportMap\ImportMapEntry;
@@ -22,8 +21,6 @@
2221

2322
class ImportMapConfigReaderTest extends TestCase
2423
{
25-
use ExpectUserDeprecationMessageTrait;
26-
2724
private Filesystem $filesystem;
2825

2926
protected function setUp(): void
@@ -162,13 +159,4 @@ public function testFindRootImportMapEntry()
162159
$this->assertSame('file2', $entry->importName);
163160
$this->assertSame('file2.js', $entry->path);
164161
}
165-
166-
/**
167-
* @group legacy
168-
*/
169-
public function testDeprecatedMethodTriggerDeprecation()
170-
{
171-
$this->expectUserDeprecationMessage('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.');
172-
ImportMapConfigReader::splitPackageNameAndFilePath('foo');
173-
}
174162
}

0 commit comments

Comments
 (0)