Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet committed Nov 13, 2024
1 parent 672a614 commit c464e4b
Show file tree
Hide file tree
Showing 130 changed files with 173 additions and 163 deletions.
2 changes: 1 addition & 1 deletion src/Action/AppendFormFieldElementAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ final class AppendFormFieldElementAction
public function __construct(
private Environment $twig,
private AdminFetcherInterface $adminFetcher,
private AdminHelper $helper
private AdminHelper $helper,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion src/Action/DashboardAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ final class DashboardAction
public function __construct(
private array $dashboardBlocks,
private TemplateRegistryInterface $templateRegistry,
private Environment $twig
private Environment $twig,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion src/Action/GetShortObjectDescriptionAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ final class GetShortObjectDescriptionAction
{
public function __construct(
private Environment $twig,
private AdminFetcherInterface $adminFetcher
private AdminFetcherInterface $adminFetcher,
) {
}

Expand Down
6 changes: 3 additions & 3 deletions src/Action/RetrieveAutocompleteItemsAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
final class RetrieveAutocompleteItemsAction
{
public function __construct(
private AdminFetcherInterface $adminFetcher
private AdminFetcherInterface $adminFetcher,
) {
}

Expand Down Expand Up @@ -232,7 +232,7 @@ public function __invoke(Request $request): JsonResponse
*/
private function retrieveFilterFieldDescription(
AdminInterface $admin,
string $field
string $field,
): FieldDescriptionInterface {
if (!$admin->hasFilterFieldDescription($field)) {
throw new \RuntimeException(\sprintf('The field "%s" does not exist.', $field));
Expand All @@ -256,7 +256,7 @@ private function retrieveFilterFieldDescription(
*/
private function retrieveFormFieldDescription(
AdminInterface $admin,
string $field
string $field,
): FieldDescriptionInterface {
if (!$admin->hasFormFieldDescription($field)) {
throw new \RuntimeException(\sprintf('The field "%s" does not exist.', $field));
Expand Down
2 changes: 1 addition & 1 deletion src/Action/RetrieveFormFieldElementAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ final class RetrieveFormFieldElementAction
public function __construct(
private Environment $twig,
private AdminFetcherInterface $adminFetcher,
private AdminHelper $helper
private AdminHelper $helper,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion src/Action/SearchAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ final class SearchAction
public function __construct(
private Pool $pool,
private TemplateRegistryInterface $templateRegistry,
private Environment $twig
private Environment $twig,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion src/Action/SetObjectFieldValueAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function __construct(
private ValidatorInterface $validator,
private DataTransformerResolverInterface $resolver,
private PropertyAccessorInterface $propertyAccessor,
?RenderElementRuntime $renderElementRuntime = null
?RenderElementRuntime $renderElementRuntime = null,
) {
// NEXT_MAJOR: Remove the deprecation and restrict param constructor to RenderElementRuntime.
if (null === $renderElementRuntime) {
Expand Down
2 changes: 1 addition & 1 deletion src/Admin/AbstractAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -1370,7 +1370,7 @@ final public function isChild(): bool
/**
* Returns true if the admin has children, false otherwise.
*
* @phpstan-assert-if-true non-empty-array $this->children
* @phpstan-assert-if-true non-empty-array<string, AdminInterface<object>> $this->children
*/
final public function hasChildren(): bool
{
Expand Down
2 changes: 1 addition & 1 deletion src/Admin/AbstractAdminExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public function configureActionButtons(
AdminInterface $admin,
array $list,
string $action,
?object $object = null
?object $object = null,
): array {
return $list;
}
Expand Down
7 changes: 5 additions & 2 deletions src/Admin/AdminExtensionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
*
* @method void preBatchAction(AdminInterface $admin, string $actionName, ProxyQueryInterface $query, array &$idx, bool $allElements)
*
* @phpstan-method void preBatchAction(AdminInterface<T> $admin, string $actionName, ProxyQueryInterface<T> $query, array<mixed> &$idx, bool $allElements)
*
* @phpstan-template T of object
*/
interface AdminExtensionInterface
Expand Down Expand Up @@ -68,7 +70,7 @@ public function configureTabMenu(
AdminInterface $admin,
MenuItemInterface $menu,
string $action,
?AdminInterface $childAdmin = null
?AdminInterface $childAdmin = null,
): void;

/**
Expand Down Expand Up @@ -137,6 +139,7 @@ public function configureBatchActions(AdminInterface $admin, array $actions): ar
// /**
// * @param mixed[] $idx
// * @phpstan-param AdminInterface<T> $admin
// * @phpstan-param ProxyQueryInterface<T> $query
// */
// public function preBatchAction(AdminInterface $admin, string $actionName, ProxyQueryInterface $query, array &$idx, bool $allElements): void;

Expand Down Expand Up @@ -203,7 +206,7 @@ public function configureActionButtons(
AdminInterface $admin,
array $list,
string $action,
?object $object = null
?object $object = null,
): array;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Admin/AdminHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class AdminHelper
private const FORM_FIELD_DELETE = '_delete';

public function __construct(
private PropertyAccessorInterface $propertyAccessor
private PropertyAccessorInterface $propertyAccessor,
) {
}

Expand Down
2 changes: 2 additions & 0 deletions src/Admin/AdminInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* @method bool showInDashboard()
* @method void removeExtension(AdminExtensionInterface $extension)
*
* @phpstan-method void removeExtension(AdminExtensionInterface<T> $extension)
*
* @phpstan-import-type FieldDescriptionOptions from FieldDescriptionInterface
*
* @phpstan-template T of object
Expand Down
4 changes: 2 additions & 2 deletions src/Admin/BreadcrumbsBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function getBreadcrumbs(AdminInterface $admin, string $action): array
public function buildBreadcrumbs(
AdminInterface $admin,
string $action,
?ItemInterface $menu = null
?ItemInterface $menu = null,
): ItemInterface {
if (null === $menu) {
$menu = $admin->getMenuFactory()->createItem('root');
Expand Down Expand Up @@ -161,7 +161,7 @@ private function createMenuItem(
ItemInterface $menu,
string $name,
?string $translationDomain = null,
array $options = []
array $options = [],
): ItemInterface {
$options = array_merge([
'extras' => [
Expand Down
2 changes: 1 addition & 1 deletion src/Admin/Pool.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function __construct(
private ContainerInterface $container,
private array $adminServiceCodes = [],
private array $adminGroups = [],
private array $adminClasses = []
private array $adminClasses = [],
) {
}

Expand Down
2 changes: 1 addition & 1 deletion src/Admin/UrlGeneratorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function generateObjectUrl(
string $name,
object $object,
array $parameters = [],
int $referenceType = RoutingUrlGeneratorInterface::ABSOLUTE_PATH
int $referenceType = RoutingUrlGeneratorInterface::ABSOLUTE_PATH,
): string;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/ArgumentResolver/AdminValueResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
final class AdminValueResolver implements CompatibleValueResolverInterface
{
public function __construct(
private AdminFetcherInterface $adminFetcher
private AdminFetcherInterface $adminFetcher,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion src/Block/AdminListBlockService.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ final class AdminListBlockService extends AbstractBlockService
public function __construct(
Environment $twig,
private Pool $pool,
private TemplateRegistryInterface $templateRegistry
private TemplateRegistryInterface $templateRegistry,
) {
parent::__construct($twig);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Block/AdminPreviewBlockService.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ final class AdminPreviewBlockService extends AbstractBlockService
{
public function __construct(
Environment $twig,
private Pool $pool
private Pool $pool,
) {
parent::__construct($twig);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Block/AdminSearchBlockService.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function __construct(
private SearchHandlerInterface $searchHandler,
private TemplateRegistryInterface $templateRegistry,
private string $emptyBoxesOption,
private string $adminRoute
private string $adminRoute,
) {
parent::__construct($twig);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Block/AdminStatsBlockService.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ final class AdminStatsBlockService extends AbstractBlockService
{
public function __construct(
Environment $twig,
private Pool $pool
private Pool $pool,
) {
parent::__construct($twig);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Bridge/Exporter/AdminExporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
final class AdminExporter
{
public function __construct(
private ExporterInterface $exporter
private ExporterInterface $exporter,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion src/Builder/AbstractFormContractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ final public function getFormBuilder(string $name, array $formOptions = []): For
final public function getDefaultOptions(
?string $type,
FieldDescriptionInterface $fieldDescription,
array $formOptions = []
array $formOptions = [],
): array {
$options = [];
$options['sonata_field_description'] = $fieldDescription;
Expand Down
2 changes: 1 addition & 1 deletion src/Builder/DatagridBuilderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ interface DatagridBuilderInterface extends BuilderInterface
public function addFilter(
DatagridInterface $datagrid,
?string $type,
FieldDescriptionInterface $fieldDescription
FieldDescriptionInterface $fieldDescription,
): void;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Builder/FormContractorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ public function getFormBuilder(string $name, array $formOptions = []): FormBuild
public function getDefaultOptions(
?string $type,
FieldDescriptionInterface $fieldDescription,
array $formOptions = []
array $formOptions = [],
): array;
}
2 changes: 1 addition & 1 deletion src/Builder/ListBuilderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ public function buildField(?string $type, FieldDescriptionInterface $fieldDescri
public function addField(
FieldDescriptionCollection $list,
?string $type,
FieldDescriptionInterface $fieldDescription
FieldDescriptionInterface $fieldDescription,
): void;
}
2 changes: 1 addition & 1 deletion src/Builder/ShowBuilderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ public function getBaseList(array $options = []): FieldDescriptionCollection;
public function addField(
FieldDescriptionCollection $list,
?string $type,
FieldDescriptionInterface $fieldDescription
FieldDescriptionInterface $fieldDescription,
): void;
}
2 changes: 1 addition & 1 deletion src/Command/ExplainAdminCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ final class ExplainAdminCommand extends Command
* @internal This class should only be used through the console
*/
public function __construct(
private Pool $pool
private Pool $pool,
) {
parent::__construct();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Command/GenerateObjectAclCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ final class GenerateObjectAclCommand extends QuestionableCommand
*/
public function __construct(
private Pool $pool,
private array $aclObjectManipulators
private array $aclObjectManipulators,
) {
parent::__construct();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Command/ListAdminCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ final class ListAdminCommand extends Command
* @internal This class should only be used through the console
*/
public function __construct(
private Pool $pool
private Pool $pool,
) {
parent::__construct();
}
Expand Down
4 changes: 2 additions & 2 deletions src/Command/QuestionableCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ final protected function askAndValidate(
OutputInterface $output,
string $questionText,
string $default,
callable $validator
callable $validator,
) {
$questionHelper = $this->getQuestionHelper();

Expand All @@ -49,7 +49,7 @@ final protected function askConfirmation(
InputInterface $input,
OutputInterface $output,
string $questionText,
string $default
string $default,
): bool {
$questionHelper = $this->getQuestionHelper();
$question = new ConfirmationQuestion(
Expand Down
2 changes: 1 addition & 1 deletion src/Command/SetupAclCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ final class SetupAclCommand extends Command
*/
public function __construct(
private Pool $pool,
private AdminAclManipulatorInterface $aclManipulator
private AdminAclManipulatorInterface $aclManipulator,
) {
parent::__construct();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Datagrid/Datagrid.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function __construct(
private FieldDescriptionCollection $columns,
private PagerInterface $pager,
private FormBuilderInterface $formBuilder,
private array $values = []
private array $values = [],
) {
}

Expand Down
4 changes: 2 additions & 2 deletions src/Datagrid/DatagridMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ final class DatagridMapper implements MapperInterface
public function __construct(
private DatagridBuilderInterface $builder,
private DatagridInterface $datagrid,
private AdminInterface $admin
private AdminInterface $admin,
) {
}

Expand All @@ -63,7 +63,7 @@ public function add(
string $name,
?string $type = null,
array $filterOptions = [],
array $fieldDescriptionOptions = []
array $fieldDescriptionOptions = [],
): self {
if (
isset($fieldDescriptionOptions['role'])
Expand Down
2 changes: 1 addition & 1 deletion src/Datagrid/ListMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ final class ListMapper implements MapperInterface
public function __construct(
private ListBuilderInterface $builder,
private FieldDescriptionCollection $list,
private AdminInterface $admin
private AdminInterface $admin,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion src/Datagrid/SimplePager.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ final class SimplePager extends Pager
*/
public function __construct(
int $maxPerPage = 10,
private int $threshold = 1
private int $threshold = 1,
) {
parent::__construct($maxPerPage);
}
Expand Down
2 changes: 1 addition & 1 deletion src/DependencyInjection/AbstractSonataAdminExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ abstract class AbstractSonataAdminExtension extends Extension
protected function fixTemplatesConfiguration(
array $configs,
ContainerBuilder $container,
array $defaultSonataDoctrineConfig = []
array $defaultSonataDoctrineConfig = [],
): array {
$defaultConfig = [
'templates' => [
Expand Down
Loading

0 comments on commit c464e4b

Please sign in to comment.