Skip to content

Commit

Permalink
[BUGFIX] Fix correct configuration paths for phar version
Browse files Browse the repository at this point in the history
  • Loading branch information
sabbelasichon committed Nov 20, 2020
1 parent 7135df5 commit f0021ee
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
4 changes: 0 additions & 4 deletions src/DependencyInjection/PHPStanServicesFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,8 @@ public function __construct()
}
}

$additionalConfigFiles[] = $currentWorkingDirectory . '/vendor/rector/rector/packages/node-type-resolver/config/phpstan/type-extensions.neon';
$additionalConfigFiles[] = __DIR__ . '/../../utils/phpstan/config/extension.neon';

// enable type inferring from constructor
$additionalConfigFiles[] = $currentWorkingDirectory . '/vendor/rector/rector/packages/node-type-resolver/config/phpstan/better-infer.neon';

$this->container = $containerFactory->create(sys_get_temp_dir(), $additionalConfigFiles, []);

// clear bleeding edge fallback
Expand Down
4 changes: 2 additions & 2 deletions src/HttpKernel/Typo3RectorKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ public function getLogDir(): string

public function registerContainerConfiguration(LoaderInterface $loader): void
{
$rectorConfigs = [
$possibleRectorConfigPaths = [
__DIR__ . '/../../vendor/rector/rector/config/config.php',
__DIR__ . '/../../../../rector/rector/config/config.php',
];

foreach ($rectorConfigs as $rectorConfig) {
foreach ($possibleRectorConfigPaths as $rectorConfig) {
if (file_exists($rectorConfig)) {
$loader->load($rectorConfig);
}
Expand Down
20 changes: 14 additions & 6 deletions utils/phpstan/config/extension.neon
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
parameters:
inferPrivatePropertyTypeFromConstructor: true
services:
-
class: Rector\NodeTypeResolver\PHPStan\TypeExtension\StaticContainerGetDynamicMethodReturnTypeExtension
tags: [phpstan.broker.dynamicMethodReturnTypeExtension]
-
class: Rector\NodeTypeResolver\PHPStan\TypeExtension\KernelGetContainerAfterBootReturnTypeExtension
tags: [phpstan.broker.dynamicMethodReturnTypeExtension]
-
class: Rector\Core\PHPStan\Type\ComponentModelDynamicReturnTypeExtension
tags: [phpstan.broker.dynamicMethodReturnTypeExtension]
-
class: Ssch\TYPO3Rector\PHPStan\Type\GeneralUtilityDynamicReturnTypeExtension
tags:
- phpstan.broker.dynamicStaticMethodReturnTypeExtension
tags: [phpstan.broker.dynamicStaticMethodReturnTypeExtension]
-
class: Ssch\TYPO3Rector\PHPStan\Type\ObjectManagerDynamicReturnTypeExtension
tags:
- phpstan.broker.dynamicMethodReturnTypeExtension
tags: [phpstan.broker.dynamicMethodReturnTypeExtension]
-
class: Ssch\TYPO3Rector\PHPStan\Type\ContextGetAspectDynamicReturnTypeExtension
tags:
- phpstan.broker.dynamicMethodReturnTypeExtension
tags: [phpstan.broker.dynamicMethodReturnTypeExtension]

0 comments on commit f0021ee

Please sign in to comment.