Skip to content

Commit 9a49833

Browse files
Adjusting the phpstan.neon configuration
1 parent 8a105e1 commit 9a49833

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

phpstan.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ parameters:
1010
identifier: missingType.generics
1111

1212
-
13-
message: "#^Parameter \\#1 \\$field of method Cake\\\\Datasource\\\\EntityInterface\\:\\:get\\(\\) expects string, array\\<int, string\\>\\|string given\\.$#"
13+
message: '#^Parameter \#1 \$field of method Cake\\Datasource\\EntityInterface\:\:get\(\) expects string, array\<string\>\|string given\.$#'
1414
count: 1
1515
path: src/File/Path/DefaultProcessor.php
1616

src/Model/Behavior/UploadBehavior.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,14 @@ public function beforeSave(EventInterface $event, EntityInterface $entity, Array
113113
continue;
114114
}
115115

116-
$data = $entity->get((string)$field);
116+
$data = $entity->get($field);
117117
if (!$data instanceof UploadedFileInterface) {
118118
continue;
119119
}
120120

121-
if ($entity->get((string)$field)->getError() !== UPLOAD_ERR_OK) {
121+
if ($entity->get($field)->getError() !== UPLOAD_ERR_OK) {
122122
if (Hash::get($settings, 'restoreValueOnFailure', true)) {
123-
$entity->set($field, $entity->getOriginal((string)$field));
123+
$entity->set($field, $entity->getOriginal($field));
124124
$entity->setDirty($field, false);
125125
}
126126
continue;
@@ -166,7 +166,7 @@ public function afterDelete(EventInterface $event, EntityInterface $entity, Arra
166166
if (
167167
in_array($field, $this->protectedFieldNames)
168168
|| Hash::get($settings, 'keepFilesOnDelete', true)
169-
|| $entity->get((string)$field) === null
169+
|| $entity->get($field) === null
170170
) {
171171
continue;
172172
}
@@ -175,14 +175,14 @@ public function afterDelete(EventInterface $event, EntityInterface $entity, Arra
175175
if ($entity->has($dirField)) {
176176
$path = $entity->get($dirField);
177177
} else {
178-
$path = $this->getPathProcessor($entity, $entity->get((string)$field), $field, $settings)->basepath();
178+
$path = $this->getPathProcessor($entity, $entity->get($field), $field, $settings)->basepath();
179179
}
180180

181181
$callback = Hash::get($settings, 'deleteCallback');
182182
if ($callback && is_callable($callback)) {
183183
$files = $callback($path, $entity, $field, $settings);
184184
} else {
185-
$files = [$path . $entity->get((string)$field)];
185+
$files = [$path . $entity->get($field)];
186186
}
187187

188188
$writer = $this->getWriter($entity, null, $field, $settings);

0 commit comments

Comments
 (0)