Skip to content

Commit

Permalink
Fix PhpStan error.
Browse files Browse the repository at this point in the history
  • Loading branch information
janbarasek committed Mar 13, 2022
1 parent 3aea0a9 commit 6b4e9b4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/Functions/GeoDistanceFunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Baraja\Doctrine;


use Doctrine\ORM\Query\AST\ArithmeticTerm;
use Doctrine\ORM\Query\AST\Functions\FunctionNode;
use Doctrine\ORM\Query\AST\SimpleArithmeticExpression;
use Doctrine\ORM\Query\Lexer;
Expand All @@ -13,13 +14,13 @@

class GeoDistanceFunction extends FunctionNode
{
private SimpleArithmeticExpression $lat1;
private SimpleArithmeticExpression|ArithmeticTerm $lat1;

private SimpleArithmeticExpression $lng1;
private SimpleArithmeticExpression|ArithmeticTerm $lng1;

private SimpleArithmeticExpression $lat2;
private SimpleArithmeticExpression|ArithmeticTerm $lat2;

private SimpleArithmeticExpression $lng2;
private SimpleArithmeticExpression|ArithmeticTerm $lng2;


public function getSql(SqlWalker $sqlWalker): string
Expand Down
2 changes: 1 addition & 1 deletion src/Orm/DI/OrmAnnotationsExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public function beforeCompile(): void
public function afterCompile(ClassType $classType): void
{
$initialize = $classType->getMethod('initialize');
$original = (string) $initialize->getBody();
$original = $initialize->getBody();
$initialize->setBody('?::registerUniqueLoader(\'class_exists\');' . "\n", [new PhpLiteral(AnnotationRegistry::class)]);
$initialize->addBody($original);
}
Expand Down

0 comments on commit 6b4e9b4

Please sign in to comment.