Skip to content

Commit d00470f

Browse files
authored
Merge pull request #283 from hostep/fixes-issue-282
Adds PHP 8.2 / Magento 2.4.6 support
2 parents d50c840 + ec58d06 commit d00470f

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"require": {
2323
"php": "^7.2.0 || ^8.1.0",
2424
"ext-dom": "*",
25-
"laminas/laminas-code": "~3.3.0 || ~3.4.1 || ~3.5.1 || ~4.5.0 || ~4.5.2",
25+
"laminas/laminas-code": "~3.3.0 || ~3.4.1 || ~3.5.1 || ^4.5",
2626
"phpstan/phpstan": "~1.9.2",
2727
"symfony/finder": "^3.0 || ^4.0 || ^5.0 || ^6.0"
2828
},

src/bitExpert/PHPStan/Magento/Autoload/DataProvider/ExtensionAttributeDataProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function getAttributesForInterface(string $sourceInterface): array
5050
foreach ($this->getExtensionAttributesXmlDocs() as $doc) {
5151
$xpath = new DOMXPath($doc);
5252
$attrs = $xpath->query(
53-
"//extension_attributes[@for=\"${sourceInterface}\"]/attribute",
53+
sprintf('//extension_attributes[@for="%s"]/attribute', $sourceInterface),
5454
$doc->documentElement
5555
);
5656

src/bitExpert/PHPStan/Magento/Autoload/ExtensionInterfaceAutoloader.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ public function getFileContents(string $interfaceName): string
9090

9191
// Magento only creates extension attribute interfaces for existing interfaces; retain that logic
9292
if (!$this->classLoaderProvider->exists($sourceInterface)) {
93-
throw new \InvalidArgumentException("${sourceInterface} does not exist and has no extension interface");
93+
throw new \InvalidArgumentException(
94+
sprintf('%s does not exist and has no extension interface', $sourceInterface)
95+
);
9496
}
9597

9698
$generator = new InterfaceGenerator();

tests/bitExpert/PHPStan/Magento/Autoload/ExtensionInterfaceAutoloaderUnitTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ public function autoloaderUsesCachedFileWhenFound(): void
9696
public function autoloadDoesNotGenerateInterfaceWhenNoAttributesExist(): void
9797
{
9898
$this->expectException(InvalidArgumentException::class);
99+
$this->expectExceptionMessage('NonExistentInterface does not exist and has no extension interface');
99100

100101
$interfaceName = 'NonExistentExtensionInterface';
101102

0 commit comments

Comments
 (0)