Переглянути джерело

add phpstan-deprecation-rules and fix

Olivier Massot 9 місяців тому
батько
коміт
985f99ae04

+ 1 - 0
composer.json

@@ -86,6 +86,7 @@
     "justinrainbow/json-schema": "^5.2",
     "phpstan/extension-installer": "^1.4",
     "phpstan/phpstan": "^1.10",
+    "phpstan/phpstan-deprecation-rules": "^1.2",
     "phpstan/phpstan-doctrine": "^1.3",
     "phpstan/phpstan-phpunit": "^1.3",
     "phpstan/phpstan-symfony": "^1.3",

+ 7 - 6
src/Doctrine/ORM/AST/SphericalDistance.php

@@ -11,6 +11,7 @@ use Doctrine\ORM\Query\Lexer;
 use Doctrine\ORM\Query\Parser;
 use Doctrine\ORM\Query\QueryException;
 use Doctrine\ORM\Query\SqlWalker;
+use Doctrine\ORM\Query\TokenType;
 
 /**
  * SphericalDistanceFunction ::= "SPHERICAL_DISTANCE" "(" ArithmeticPrimary "," ArithmeticPrimary "," ArithmeticPrimary "," ArithmeticPrimary ")".
@@ -42,16 +43,16 @@ class SphericalDistance extends FunctionNode
      */
     public function parse(Parser $parser): void
     {
-        $parser->match(Lexer::T_IDENTIFIER);
-        $parser->match(Lexer::T_OPEN_PARENTHESIS);
+        $parser->match(TokenType::T_IDENTIFIER);
+        $parser->match(TokenType::T_OPEN_PARENTHESIS);
         $this->latitude1 = $parser->ArithmeticPrimary();
-        $parser->match(Lexer::T_COMMA);
+        $parser->match(TokenType::T_COMMA);
         $this->longitude1 = $parser->ArithmeticPrimary();
-        $parser->match(Lexer::T_COMMA);
+        $parser->match(TokenType::T_COMMA);
         $this->latitude2 = $parser->ArithmeticPrimary();
-        $parser->match(Lexer::T_COMMA);
+        $parser->match(TokenType::T_COMMA);
         $this->longitude2 = $parser->ArithmeticPrimary();
-        $parser->match(Lexer::T_CLOSE_PARENTHESIS);
+        $parser->match(TokenType::T_CLOSE_PARENTHESIS);
     }
 
     /**

+ 1 - 3
src/Entity/Core/File.php

@@ -367,9 +367,7 @@ class File
     }
 
     /**
-     * A priori inutilisé.
-     *
-     * @deprecated
+     * TODO: voir si utilisé?
      */
     public function getAccessRoles(): Collection
     {

+ 0 - 2
src/Security/Voter/EntityVoter/Core/FileVoter.php

@@ -136,8 +136,6 @@ class FileVoter extends AbstractEntityVoter
     /**
      * Is the given user the owner of the file, or does he belong to the organization that owns it, and does the user
      * have any of the required role to access this file?
-     *
-     * @deprecated
      */
     protected function isInFileOwningGroupWithRole(File $file, Access $user): bool
     {