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
8 changes: 7 additions & 1 deletion src/Configurator/CrudControllerConfigurator.php
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,13 @@ private function configureRoutes(OptionsResolver $resolver): void
/** @var string $parentRouteParam */
$parentRouteParam = $options['parent_route_param'];

return \array_replace($value, $parent ? [$parentRouteParam => $parent->getId()] : []); // @phpstan-ignore method.notFound
if (null === $parent) {
return $value;
}
/** @var string|\Stringable $parentId */
$parentId = $parent->getId(); // @phpstan-ignore method.notFound

return \array_replace($value, [$parentRouteParam => (string) $parentId]);
});
}

Expand Down
8 changes: 6 additions & 2 deletions src/Controller/AbstractCrudController.php
Original file line number Diff line number Diff line change
Expand Up @@ -715,13 +715,15 @@ public function createNavigation(?object $entity = null, array $options = []): ?
if ($parentUpdate && isset($parentUpdate['route'])) {
/** @var array<string, mixed> $parentUpdateRouteParams */
$parentUpdateRouteParams = $parentUpdate['route_params'];
/** @var string|\Stringable $parentId */
$parentId = $parent->getId(); // @phpstan-ignore method.notFound
$root->add('common.nav.parent', [
'label' => $this->translator->trans('common.nav.parent', [
'type' => $parentOptions['title'],
'label' => $this->getEntityLabel($parent, $parentOptions),
], 'cms'),
'route' => $parentUpdate['route'],
'route_params' => $parentUpdateRouteParams + ['id' => $parent->getId()], // @phpstan-ignore method.notFound
'route_params' => $parentUpdateRouteParams + ['id' => (string) $parentId],
]);
}
}
Expand All @@ -732,7 +734,9 @@ public function createNavigation(?object $entity = null, array $options = []): ?
/** @var array<string, mixed> $params */
$params = $prefixOptions['route_params'];
if (null !== $entity) {
$params['id'] = $entity->getId(); // @phpstan-ignore method.notFound
/** @var string|\Stringable $entityId */
$entityId = $entity->getId(); // @phpstan-ignore method.notFound
$params['id'] = (string) $entityId;
}

/** @var string $transId */
Expand Down
2 changes: 1 addition & 1 deletion src/Form/Type/FileType.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function configureOptions(OptionsResolver $resolver): void
'multiple' => false,
'mime_types' => [],
'attr' => static fn (Options $options): array => [
'accept' => \implode(',', (array) $options['mime_types']),
'accept' => \implode(',', (array) $options['mime_types']), // @phpstan-ignore argument.type
],
'constraints' => static function (Options $options): array {
/** @var array<string> $mimeTypes */
Expand Down
2 changes: 1 addition & 1 deletion src/PropertyAccessor/ReflectionPropertyAccessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function __construct(private readonly PropertyAccessorInterface $decorate
*/
public function setValue(object|array &$objectOrArray, string|PropertyPathInterface $propertyPath, mixed $value): void
{
try { // @phpstan-ignore paramOut.type
try {
$this->decorated->setValue($objectOrArray, $propertyPath, $value); // @phpstan-ignore paramOut.type
} catch (NoSuchPropertyException $exception) {
if (!\is_object($objectOrArray)) {
Expand Down