Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[AssetMapper] Remove ImportMapConfigReader::splitPackageNameAndFilePath() #60878

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions UPGRADE-8.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ release process, both versions have the same features, but Symfony 8.0 doesn't i
To upgrade, make sure to resolve all deprecation notices.
Read more about this in the [Symfony documentation](https://symfony.com/doc/8.0/setup/upgrade_major.html).

AssetMapper
-----------

* Remove `ImportMapConfigReader::splitPackageNameAndFilePath()`, use `ImportMapEntry::splitPackageNameAndFilePath()` instead

Console
-------

Expand Down
5 changes: 5 additions & 0 deletions src/Symfony/Component/AssetMapper/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
CHANGELOG
=========

8.0
---

* Remove `ImportMapConfigReader::splitPackageNameAndFilePath()`, use `ImportMapEntry::splitPackageNameAndFilePath()` instead

7.3
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,23 +174,4 @@ private function getRootDirectory(): string
{
return \dirname($this->importMapConfigPath);
}

/**
* @deprecated since Symfony 7.1, use ImportMapEntry::splitPackageNameAndFilePath() instead
*/
public static function splitPackageNameAndFilePath(string $packageName): array
{
trigger_deprecation('symfony/asset-mapper', '7.1', 'The method "%s()" is deprecated and will be removed in 8.0. Use ImportMapEntry::splitPackageNameAndFilePath() instead.', __METHOD__);

$filePath = '';
$i = strpos($packageName, '/');

if ($i && (!str_starts_with($packageName, '@') || $i = strpos($packageName, '/', $i + 1))) {
// @vendor/package/filepath or package/filepath
$filePath = substr($packageName, $i);
$packageName = substr($packageName, 0, $i);
}

return [$packageName, $filePath];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Component\AssetMapper\Tests\ImportMap;

use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ExpectUserDeprecationMessageTrait;
use Symfony\Component\AssetMapper\ImportMap\ImportMapConfigReader;
use Symfony\Component\AssetMapper\ImportMap\ImportMapEntries;
use Symfony\Component\AssetMapper\ImportMap\ImportMapEntry;
Expand All @@ -22,8 +21,6 @@

class ImportMapConfigReaderTest extends TestCase
{
use ExpectUserDeprecationMessageTrait;

private Filesystem $filesystem;

protected function setUp(): void
Expand Down Expand Up @@ -162,13 +159,4 @@ public function testFindRootImportMapEntry()
$this->assertSame('file2', $entry->importName);
$this->assertSame('file2.js', $entry->path);
}

/**
* @group legacy
*/
public function testDeprecatedMethodTriggerDeprecation()
{
$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.');
ImportMapConfigReader::splitPackageNameAndFilePath('foo');
}
}
Loading