Skip to content

Commit

Permalink
[BCB] Remove options that existed only for performance reasons
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Sep 30, 2024
1 parent c17a736 commit c585610
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 210 deletions.
6 changes: 0 additions & 6 deletions extension.neon
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ parameters:
queryBuilderClass: null
allCollectionsSelectable: true
objectManagerLoader: null
searchOtherMethodsForQueryBuilderBeginning: true
queryBuilderFastAlgorithm: false
literalString: false
featureToggles:
skipCheckGenericClasses:
Expand Down Expand Up @@ -79,8 +77,6 @@ parametersSchema:
queryBuilderClass: schema(string(), nullable())
allCollectionsSelectable: bool()
objectManagerLoader: schema(string(), nullable())
searchOtherMethodsForQueryBuilderBeginning: bool()
queryBuilderFastAlgorithm: bool()
reportDynamicQueryBuilders: bool()
reportUnknownTypes: bool()
allowNullablePropertyForRequiredField: bool()
Expand Down Expand Up @@ -117,7 +113,6 @@ services:
class: PHPStan\Type\Doctrine\QueryBuilder\CreateQueryBuilderDynamicReturnTypeExtension
arguments:
queryBuilderClass: %doctrine.queryBuilderClass%
fasterVersion: %doctrine.queryBuilderFastAlgorithm%
tags:
- phpstan.broker.dynamicMethodReturnTypeExtension
-
Expand Down Expand Up @@ -194,7 +189,6 @@ services:
-
class: PHPStan\Type\Doctrine\QueryBuilder\OtherMethodQueryBuilderParser
arguments:
descendIntoOtherMethods: %doctrine.searchOtherMethodsForQueryBuilderBeginning%
parser: @defaultAnalysisParser

-
Expand Down
2 changes: 0 additions & 2 deletions rules.neon
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ parametersSchema:
queryBuilderClass: schema(string(), nullable())
allCollectionsSelectable: bool()
objectManagerLoader: schema(string(), nullable())
searchOtherMethodsForQueryBuilderBeginning: bool()
queryBuilderFastAlgorithm: bool()
reportDynamicQueryBuilders: bool()
reportUnknownTypes: bool()
allowNullablePropertyForRequiredField: bool()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,11 @@ class CreateQueryBuilderDynamicReturnTypeExtension implements DynamicMethodRetur

private ?string $queryBuilderClass = null;

private bool $fasterVersion;

public function __construct(
?string $queryBuilderClass,
bool $fasterVersion
?string $queryBuilderClass
)
{
$this->queryBuilderClass = $queryBuilderClass;
$this->fasterVersion = $fasterVersion;
}

public function getClass(): string
Expand All @@ -40,12 +36,7 @@ public function getTypeFromMethodCall(
Scope $scope
): Type
{
$class = SimpleQueryBuilderType::class;
if (!$this->fasterVersion) {
$class = BranchingQueryBuilderType::class;
}

return new $class(
return new BranchingQueryBuilderType(
$this->queryBuilderClass ?? 'Doctrine\ORM\QueryBuilder',
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
class OtherMethodQueryBuilderParser
{

private bool $descendIntoOtherMethods;

private Parser $parser;

private Container $container;
Expand All @@ -41,9 +39,8 @@ class OtherMethodQueryBuilderParser
*/
private array $cache = [];

public function __construct(bool $descendIntoOtherMethods, Parser $parser, Container $container)
public function __construct(Parser $parser, Container $container)
{
$this->descendIntoOtherMethods = $descendIntoOtherMethods;
$this->parser = $parser;
$this->container = $container;
}
Expand All @@ -53,10 +50,6 @@ public function __construct(bool $descendIntoOtherMethods, Parser $parser, Conta
*/
public function findQueryBuilderTypesInCalledMethod(Scope $scope, MethodReflection $methodReflection): array
{
if (!$this->descendIntoOtherMethods) {
return [];
}

$methodName = $methodReflection->getName();
$className = $methodReflection->getDeclaringClass()->getName();
$fileName = $methodReflection->getDeclaringClass()->getFileName();
Expand Down
33 changes: 0 additions & 33 deletions src/Type/Doctrine/QueryBuilder/SimpleQueryBuilderType.php

This file was deleted.

147 changes: 0 additions & 147 deletions tests/Rules/Doctrine/ORM/QueryBuilderDqlRuleSlowTest.php

This file was deleted.

3 changes: 0 additions & 3 deletions tests/Rules/Doctrine/ORM/slow.neon

This file was deleted.

0 comments on commit c585610

Please sign in to comment.