Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ExplainCommand #8061

Merged
merged 3 commits into from
May 6, 2023
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 src/Bridge/Exporter/AdminExporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function getExportFilename(AdminInterface $admin, string $format): string
return sprintf(
'export_%s_%s.%s',
strtolower(false !== $namespaceSeparatorPos ? substr($class, $namespaceSeparatorPos + 1) : $class),
date('Y_m_d_H_i_s', strtotime('now')),
date('Y_m_d_H_i_s', time()),
$format
);
}
Expand Down
3 changes: 3 additions & 0 deletions src/Command/ExplainAdminCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ public function execute(InputInterface $input, OutputInterface $output): int
{
$admin = $this->pool->getInstance($input->getArgument('admin'));

// Some admin methods might require a subject.
$admin->setSubject($admin->getNewInstance());

$output->writeln('<comment>AdminBundle Information</comment>');
$output->writeln(sprintf('<info>% -20s</info> : %s', 'id', $admin->getCode()));
$output->writeln(sprintf('<info>% -20s</info> : %s', 'Admin', $admin::class));
Expand Down
1 change: 0 additions & 1 deletion src/Datagrid/ListMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ public function add(string $name, ?string $type = null, array $fieldDescriptionO
));
}

/** @psalm-suppress ArgumentTypeCoercion https://github.com/vimeo/psalm/issues/9500 */
$fieldDescription = $this->getAdmin()->createFieldDescription(
$name,
$fieldDescriptionOptions
Expand Down
1 change: 0 additions & 1 deletion src/FieldDescription/BaseFieldDescription.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ final public function setOptions(array $options): void
unset($options['template']);
}

/** @psalm-suppress PropertyTypeCoercion https://github.com/vimeo/psalm/issues/9500 */
$this->options = $options;
}

Expand Down
1 change: 0 additions & 1 deletion src/Form/FormMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ public function add(string $name, ?string $type = null, array $options = [], arr
$fieldDescriptionOptions['translation_domain'] = $group['translation_domain'] ?? null;
}

/** @psalm-suppress ArgumentTypeCoercion https://github.com/vimeo/psalm/issues/9500 */
$fieldDescription = $this->getAdmin()->createFieldDescription(
$name,
$fieldDescriptionOptions
Expand Down
2 changes: 0 additions & 2 deletions tests/Filter/Model/FilterDataTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ final class FilterDataTest extends TestCase
{
/**
* @dataProvider getInvalidTypes
*
* @psalm-suppress InvalidArgument
*/
public function testTypeMustBeNumericOrNull(mixed $type): void
{
Expand Down
Loading