Browse Source

Remove unneeded inline annotations. Fix self to static.

mscherer 6 years ago
parent
commit
e834c40941

+ 0 - 3
phpstan.neon

@@ -49,9 +49,6 @@ parameters:
             message: '#Result of && is always false#'
             path: 'src/Routing/Route/EntityRoute.php'
         -
-            message: '#Call to an undefined method Cake\\ORM\\Association::junction\(\).#'
-            path: 'src/View/Form/EntityContext.php'
-        -
             message: '#Parameter \#1 \$var_array of function extract is passed by reference, so it expects variables only#'
             path: 'src/Command/I18nExtractCommand.php'
         -

+ 1 - 1
psalm-baseline.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<files psalm-version="3.5.2@648dda67ed7aca1d4ea243258f0ee7f2844ac60a">
+<files psalm-version="3.6.1@7857b07f91bed5afae98574243fed7ec4088d623">
   <file src="src/Command/CompletionCommand.php">
     <DeprecatedClass occurrences="1">
       <code>\Cake\Console\Shell</code>

+ 0 - 1
src/Collection/Iterator/ExtractIterator.php

@@ -101,7 +101,6 @@ class ExtractIterator extends Collection
         $callback = $this->_extractor;
         $res = [];
 
-        /** @var \ArrayObject $iterator */
         foreach ($iterator->getArrayCopy() as $k => $v) {
             $res[$k] = $callback($v);
         }

+ 0 - 1
src/Controller/Component/RequestHandlerComponent.php

@@ -391,7 +391,6 @@ class RequestHandlerComponent extends Component
     {
         $controller = $this->getController();
 
-        /** @var array $acceptRaw */
         $acceptRaw = $controller->getRequest()->parseAccept();
         if (empty($acceptRaw)) {
             return $type ? $type === $this->ext : $this->ext;

+ 0 - 1
src/Controller/Component/SecurityComponent.php

@@ -344,7 +344,6 @@ class SecurityComponent extends Component
             )
         );
 
-        /** @var (string|int)[] $fieldList */
         foreach ($fieldList as $i => $key) {
             $isLocked = in_array($key, $locked, true);
 

+ 0 - 1
src/Database/Expression/QueryExpression.php

@@ -658,7 +658,6 @@ class QueryExpression implements ExpressionInterface, Countable
             $numericKey = is_numeric($k);
 
             if ($c instanceof Closure) {
-                /** @var \Cake\Database\Expression\QueryExpression $expr */
                 $expr = new static([], $typeMap);
                 $c = $c($expr, $this);
             }

+ 0 - 1
src/Database/Query.php

@@ -637,7 +637,6 @@ class Query implements ExpressionInterface, IteratorAggregate
 
         $joins = [];
         $i = count($this->_parts['join']);
-        /** @var array $tables */
         foreach ($tables as $alias => $t) {
             if (!is_array($t)) {
                 $t = ['table' => $t, 'conditions' => $this->newExpr()];

+ 0 - 1
src/Database/Schema/Collection.php

@@ -95,7 +95,6 @@ class Collection implements CollectionInterface
         if (strpos($name, '.')) {
             [$config['schema'], $name] = explode('.', $name);
         }
-        /** @var \Cake\Database\Schema\TableSchema $table */
         $table = $this->_connection->getDriver()->newTableSchema($name);
 
         $this->_reflect('Column', $name, $config, $table);

+ 1 - 1
src/Mailer/Email.php

@@ -496,7 +496,7 @@ class Email implements JsonSerializable, Serializable
         $config = 'default',
         bool $send = true
     ) {
-        $class = self::class;
+        $class = static::class;
 
         if (is_array($config) && !isset($config['transport'])) {
             $config['transport'] = 'default';

+ 0 - 1
src/ORM/LazyEagerLoader.php

@@ -78,7 +78,6 @@ class LazyEagerLoader
             return $entity->{$method}($primaryKey);
         });
 
-        /** @var \Cake\ORM\Query $query */
         $query = $source
             ->find()
             ->select((array)$primaryKey)

+ 0 - 2
src/View/Form/EntityContext.php

@@ -637,7 +637,6 @@ class EntityContext implements ContextInterface
             $normalized = array_slice($normalized, 1);
         }
 
-        /** @var \Cake\ORM\Table $table */
         $table = $this->_tables[$this->_rootName];
         /** @var \Cake\ORM\Association\BelongsToMany|null $assoc */
         $assoc = null;
@@ -649,7 +648,6 @@ class EntityContext implements ContextInterface
                     continue;
                 }
             } else {
-                /** @var \Cake\ORM\AssociationCollection $associationCollection */
                 $associationCollection = $table->associations();
                 $assoc = $associationCollection->getByProperty($part);
             }