Skip to content

Conversation

@staabm
Copy link
Contributor

@staabm staabm commented Dec 12, 2024

..work in progress...

@staabm
Copy link
Contributor Author

staabm commented Dec 13, 2024

btw: I am currently puzzled how we can re-work this code to make it PHPStan 2.x compatible:

$extendedMethodReflection = $classReflection->getConstructor();
$parametersAcceptorWithPhpDocs = ParametersAcceptorSelector::selectSingle(
$extendedMethodReflection->getVariants()
);
$totaDependencyTreeComplexity = $this->astCognitiveComplexityAnalyzer->analyzeClassLike($originalClassLike);
foreach ($parametersAcceptorWithPhpDocs->getParameters() as $parameterReflectionWithPhpDoc) {
$dependencyClass = $this->resolveParameterTypeClass($parameterReflectionWithPhpDoc);
if (! $dependencyClass instanceof Class_) {
continue;
}
$dependencyComplexity = $this->astCognitiveComplexityAnalyzer->analyzeClassLike($dependencyClass);
$totaDependencyTreeComplexity += $dependencyComplexity;
}

@staabm staabm marked this pull request as ready for review December 13, 2024 09:42
@staabm
Copy link
Contributor Author

staabm commented Dec 13, 2024

btw: I am currently puzzled how we can re-work this code to make it PHPStan 2.x compatible:

not really sure its a good solution, but at least it works for the current test-suite: de7bd6c

@staabm
Copy link
Contributor Author

staabm commented Dec 13, 2024

should be good to go

@TomasVotruba
Copy link
Owner

Thanks 👍 I'll merge and release new version

@TomasVotruba TomasVotruba merged commit d73a34a into TomasVotruba:main Dec 13, 2024
5 of 6 checks passed
@staabm staabm deleted the stan2 branch December 13, 2024 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants