Skip to content

Commit ec69e60

Browse files
minor #61178 [AssetMapper] Make argument $projectDir of ImportMapRequireCommand mandatory (nicolas-grekas)
This PR was merged into the 8.0 branch. Discussion ---------- [AssetMapper] Make argument `$projectDir` of `ImportMapRequireCommand` mandatory | Q | A | ------------- | --- | Branch? | 8.0 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | - | License | MIT Commits ------- 02e28c4 [AssetMapper] Make argument `$projectDir` of `ImportMapRequireCommand` mandatory
2 parents 419f671 + 02e28c4 commit ec69e60

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

src/Symfony/Component/AssetMapper/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ CHANGELOG
55
---
66

77
* Remove `ImportMapConfigReader::splitPackageNameAndFilePath()`, use `ImportMapEntry::splitPackageNameAndFilePath()` instead
8+
* Make argument `$projectDir` of `ImportMapRequireCommand` mandatory
89

910
7.3
1011
---

src/Symfony/Component/AssetMapper/Command/ImportMapRequireCommand.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,8 @@ final class ImportMapRequireCommand extends Command
3636
public function __construct(
3737
private readonly ImportMapManager $importMapManager,
3838
private readonly ImportMapVersionChecker $importMapVersionChecker,
39-
private readonly ?string $projectDir = null,
39+
private readonly string $projectDir,
4040
) {
41-
if (null === $projectDir) {
42-
trigger_deprecation('symfony/asset-mapper', '7.3', 'The "%s()" method will have a new `string $projectDir` argument in version 8.0, not defining it is deprecated.', __METHOD__);
43-
}
44-
4541
parent::__construct();
4642
}
4743

@@ -149,9 +145,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
149145
array_map(fn (ImportMapEntry $package): array => [
150146
$package->importName,
151147
$package->version ?? '-',
152-
// BC layer for AssetMapper < 7.3
153-
// When `projectDir` is not null, we use the absolute path of the package
154-
null !== $this->projectDir ? Path::makeRelative($package->path, $this->projectDir) : $package->path,
148+
Path::makeRelative($package->path, $this->projectDir),
155149
], $newPackages),
156150
);
157151
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy