Skip to content

Commit

Permalink
stan update
Browse files Browse the repository at this point in the history
  • Loading branch information
LordSimal committed Jan 21, 2024
1 parent 2f7c1b1 commit 79b0d63
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .phive/phars.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="psalm" version="5.15.0" installed="5.15.0" location="./tools/psalm" copy="false"/>
<phar name="psalm" version="5.20.0" installed="5.20.0" location="./tools/psalm" copy="false"/>
</phive>
25 changes: 10 additions & 15 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.15.0@5c774aca4746caf3d239d9c8cadb9f882ca29352">
<files psalm-version="5.20.0@3f284e96c9d9be6fe6b15c79416e1d1903dcfef4">
<file src="src/Cache/Engine/FileEngine.php">
<TooManyTemplateParams>
<code>$iterator</code>
Expand All @@ -24,11 +24,6 @@
<code>int|false</code>
</InvalidReturnType>
</file>
<file src="src/Database/Query.php">
<UnusedPsalmSuppress>
<code>InvalidArrayOffset</code>
</UnusedPsalmSuppress>
</file>
<file src="src/Event/EventDispatcherTrait.php">
<MoreSpecificImplementedParamType>
<code>$subject</code>
Expand Down Expand Up @@ -154,6 +149,11 @@
<code>new AssertionFailedError($message)</code>
</InternalMethod>
</file>
<file src="src/TestSuite/TestCase.php">
<UndefinedVariable>
<code>$previousHandler</code>
</UndefinedVariable>
</file>
<file src="src/Utility/Filesystem.php">
<TooManyTemplateParams>
<code>$iterator</code>
Expand All @@ -176,14 +176,9 @@
<code><![CDATA[array{name: string, file: string, paths: list<string>}]]></code>
</ImplementedReturnTypeMismatch>
</file>
<file src="src/View/HelperRegistry.php">
<UnusedPsalmSuppress>
<code>NoValue</code>
</UnusedPsalmSuppress>
</file>
<file src="src/View/Widget/RadioWidget.php">
<UnusedPsalmSuppress>
<code>TypeDoesNotContainType</code>
</UnusedPsalmSuppress>
<file src="src/View/Helper/PaginatorHelper.php">
<TypeDoesNotContainType>
<code><![CDATA[empty($this->_config['options']['url'])]]></code>
</TypeDoesNotContainType>
</file>
</files>
1 change: 0 additions & 1 deletion src/Command/PluginLoadCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ public function execute(Arguments $args, ConsoleIo $io): ?int
try {
Plugin::getCollection()->findPath($plugin);
} catch (MissingPluginException $e) {
/** @psalm-suppress InvalidArgument */
if (empty($options['optional'])) {
$io->err($e->getMessage());
$io->err('Ensure you have the correct spelling and casing.');
Expand Down
1 change: 0 additions & 1 deletion src/Database/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,6 @@ protected function _makeJoin(

/**
* @var string $alias
* @psalm-suppress InvalidArrayOffset
*/
return [
$alias => [
Expand Down
2 changes: 1 addition & 1 deletion src/Log/Engine/BaseLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function __construct(array $config = [])
$this->_config['levels'] = (array)$this->_config['types'];
}

/** @var \Cake\Log\Formatter\AbstractFormatter|class-string<\Cake\Log\Formatter\AbstractFormatter> $formatter */
/** @var \Cake\Log\Formatter\AbstractFormatter|array|class-string<\Cake\Log\Formatter\AbstractFormatter> $formatter */
$formatter = $this->_config['formatter'] ?? DefaultFormatter::class;
if (!is_object($formatter)) {
if (is_array($formatter)) {
Expand Down
1 change: 1 addition & 0 deletions src/ORM/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -2337,6 +2337,7 @@ protected function _saveMany(
}
};

/** @var \Cake\Datasource\EntityInterface|null $failed */
$failed = null;
try {
$this->getConnection()
Expand Down
8 changes: 4 additions & 4 deletions src/Validation/ValidationSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,13 @@ public function offsetGet(mixed $index): ValidationRule
/**
* Sets or replace a validation rule
*
* @param string $index name of the rule
* @param \Cake\Validation\ValidationRule|array $rule Rule to add to $index
* @param string $offset name of the rule
* @param \Cake\Validation\ValidationRule|array $value Rule to add to $index
* @return void
*/
public function offsetSet(mixed $index, mixed $rule): void
public function offsetSet(mixed $offset, mixed $value): void
{
$this->add($index, $rule);
$this->add($offset, $value);
}

/**
Expand Down
14 changes: 7 additions & 7 deletions src/Validation/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -404,20 +404,20 @@ public function offsetGet(mixed $field): ValidationSet
/**
* Sets the rule set for a field
*
* @param string $field name of the field to set
* @param \Cake\Validation\ValidationSet|array $rules set of rules to apply to field
* @param string $offset name of the field to set
* @param \Cake\Validation\ValidationSet|array $value set of rules to apply to field
* @return void
*/
public function offsetSet(mixed $field, mixed $rules): void
public function offsetSet(mixed $offset, mixed $value): void
{
if (!$rules instanceof ValidationSet) {
if (!$value instanceof ValidationSet) {
$set = new ValidationSet();
foreach ($rules as $name => $rule) {
foreach ($value as $name => $rule) {
$set->add($name, $rule);
}
$rules = $set;
$value = $set;
}
$this->_fields[$field] = $rules;
$this->_fields[$offset] = $value;
}

/**
Expand Down
1 change: 0 additions & 1 deletion src/View/HelperRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ public function __isset(string $helper): bool
public function __get(string $name): ?Helper
{
// This calls __isset() and loading the named helper if it isn't already loaded.
/** @psalm-suppress NoValue */
if (isset($this->{$name})) {
return $this->_loaded[$name];
}
Expand Down
1 change: 0 additions & 1 deletion src/View/Widget/RadioWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ protected function _isDisabled(array $radio, array|string|bool|null $disabled):
}
$isNumeric = is_numeric($radio['value']);

/** @psalm-suppress TypeDoesNotContainType */
return !is_array($disabled) || in_array((string)$radio['value'], $disabled, !$isNumeric);
}

Expand Down

0 comments on commit 79b0d63

Please sign in to comment.