Skip to content

Commit

Permalink
Bump psalm to v5 for intersection types support.
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Sep 2, 2022
1 parent 04dda7f commit 93a28da
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
9 changes: 3 additions & 6 deletions ObjectRegistry.php
Expand Up @@ -40,14 +40,15 @@
* @see \Cake\View\HelperRegistry
* @see \Cake\Console\TaskRegistry
* @template TObject
* @template-implements \IteratorAggregate<string, TObject>
*/
abstract class ObjectRegistry implements Countable, IteratorAggregate
{
/**
* Map of loaded objects.
*
* @var array<object>
* @psalm-var array<array-key, TObject>
* @var array<string, object>
* @psalm-var array<string, TObject>
*/
protected array $_loaded = [];

Expand Down Expand Up @@ -335,7 +336,6 @@ public function reset()
* @param object $object instance to store in the registry
* @return $this
* @psalm-param TObject $object
* @psalm-suppress MoreSpecificReturnType
*/
public function set(string $name, object $object)
{
Expand All @@ -350,7 +350,6 @@ public function set(string $name, object $object)
}
$this->_loaded[$objName] = $object;

/** @psalm-suppress LessSpecificReturnStatement */
return $this;
}

Expand All @@ -361,7 +360,6 @@ public function set(string $name, object $object)
*
* @param string $name The name of the object to remove from the registry.
* @return $this
* @psalm-suppress MoreSpecificReturnType
*/
public function unload(string $name)
{
Expand All @@ -376,7 +374,6 @@ public function unload(string $name)
}
unset($this->_loaded[$name]);

/** @psalm-suppress LessSpecificReturnStatement */
return $this;
}

Expand Down
2 changes: 2 additions & 0 deletions PluginCollection.php
Expand Up @@ -35,6 +35,8 @@
*
* While its implementation supported nested iteration it does not
* support using `continue` or `break` inside loops.
*
* @template-implements \Iterator<string, \Cake\Core\PluginInterface>
*/
class PluginCollection implements Iterator, Countable
{
Expand Down
3 changes: 1 addition & 2 deletions StaticConfigTrait.php
Expand Up @@ -90,7 +90,6 @@ public static function setConfig(array|string $key, object|array|null $config =
}

if (isset(static::$_config[$key])) {
/** @psalm-suppress PossiblyInvalidArgument */
throw new BadMethodCallException(sprintf('Cannot reconfigure existing key "%s"', $key));
}

Expand All @@ -108,7 +107,7 @@ public static function setConfig(array|string $key, object|array|null $config =
$config['className'] = $config['engine'];
unset($config['engine']);
}
/** @psalm-suppress InvalidPropertyAssignmentValue */

static::$_config[$key] = $config;
}

Expand Down

0 comments on commit 93a28da

Please sign in to comment.