Skip to content

Commit 16e189b

Browse files
committed
Bump up phpstan and psalm
1 parent 42c7608 commit 16e189b

File tree

4 files changed

+11
-14
lines changed

4 files changed

+11
-14
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ trim_trailing_whitespace = true
1313

1414
[*.yml]
1515
indent_size = 2
16+
17+
[*.neon]
18+
indent_style = tab

.phive/phars.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phive xmlns="https://phar.io/phive">
3-
<phar name="phpstan" version="1.10.35" installed="1.10.35" location="./tools/phpstan" copy="false"/>
4-
<phar name="psalm" version="5.15.0" installed="5.15.0" location="./tools/psalm" copy="false"/>
3+
<phar name="phpstan" version="1.11.9" installed="1.11.9" location="./tools/phpstan" copy="false"/>
4+
<phar name="psalm" version="5.25.0" installed="5.25.0" location="./tools/psalm" copy="false"/>
55
</phive>

phpstan.neon

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
parameters:
22
level: 8
3-
checkMissingIterableValueType: false
4-
checkGenericClassInNonGenericObjectType: false
53
treatPhpDocTypesAsCertain: false
64
bootstrapFiles:
75
- tests/bootstrap.php
86
paths:
97
- src/
8+
ignoreErrors:
9+
- identifier: missingType.iterableValue

src/Model/Behavior/DuplicatableBehavior.php

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,10 @@ protected function _getFinder(?string $assocPath = null): array
132132
}
133133

134134
$object = $this->_table;
135-
if ($assocPath) {
135+
if ($assocPath !== null) {
136136
$parts = explode('.', $assocPath);
137137
foreach ($parts as $prop) {
138+
/** @var \Cake\ORM\Association $object */
138139
$object = $object->{$prop};
139140
}
140141
}
@@ -231,17 +232,10 @@ protected function _drillDownAssoc(EntityInterface $entity, Table|Association $o
231232
}
232233

233234
if ($associated instanceof EntityInterface) {
234-
if ($parts) {
235-
$this->_drillDownAssoc($associated, $object->{$assocName}, $parts);
236-
}
237-
238-
if (!$associated->isNew()) {
239-
$this->_modifyEntity($associated, $object->{$assocName});
240-
}
241-
242-
return;
235+
$associated = [$associated];
243236
}
244237

238+
/** @var array<\Cake\Datasource\EntityInterface> $associated */
245239
foreach ($associated as $e) {
246240
if ($parts) {
247241
$this->_drillDownAssoc($e, $object->{$assocName}, $parts);

0 commit comments

Comments
 (0)