Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,4 @@ jobs:

- name: Run phpstan
if: success() || failure()
run: phpstan analyse src
run: phpstan
6 changes: 6 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
parameters:
level: 8
checkMissingIterableValueType: false
treatPhpDocTypesAsCertain: false
paths:
- src/
11 changes: 7 additions & 4 deletions src/Model/Behavior/SequenceBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class SequenceBehavior extends Behavior
/**
* Default settings.
*
* @var array
* @var array<string, mixed>
*/
protected $_defaultConfig = [
'sequenceField' => 'position',
Expand Down Expand Up @@ -109,7 +109,7 @@ public function initialize(array $config): void
*
* @param \Cake\Event\EventInterface $event The beforeFind event that was fired.
* @param \Cake\ORM\Query $query The query object.
* @param \ArrayObject $options The options passed to the find method.
* @param \ArrayObject<string, mixed> $options The options passed to the find method.
* @return void
*/
public function beforeFind(EventInterface $event, Query $query, ArrayObject $options): void
Expand All @@ -124,7 +124,7 @@ public function beforeFind(EventInterface $event, Query $query, ArrayObject $opt
*
* @param \Cake\Event\EventInterface $event The beforeSave event that was fired.
* @param \Cake\Datasource\EntityInterface $entity The entity that is going to be saved.
* @param \ArrayObject $options The options passed to the save method.
* @param \ArrayObject<string, mixed> $options The options passed to the save method.
* @return void
*/
public function beforeSave(EventInterface $event, EntityInterface $entity, ArrayObject $options): void
Expand Down Expand Up @@ -446,7 +446,10 @@ protected function _getOldValues(EntityInterface $entity): array
}

if (count($fields) != count($values)) {
/** @psalm-suppress PossiblyInvalidArgument */
/**
* @psalm-suppress PossiblyInvalidArgument
* @phpstan-ignore-next-line
*/
$primaryKey = $entity->get($this->_table->getPrimaryKey());
$entity = $this->_table->get($primaryKey, ['fields' => $fields]);
$values = $entity->extract($fields);
Expand Down