From dfcffd3cb158dd87f2713f02e9526c818e7cdd4c Mon Sep 17 00:00:00 2001 From: Michael Bessolov Date: Wed, 29 Jan 2025 18:45:25 -0800 Subject: [PATCH] BAP-22912: Fix PHP 8.4 deprecation messages --- .../ButtonProviderExtensionInterface.php | 2 +- .../ActionBundle/Helper/ContextHelper.php | 6 ++--- .../Bundle/ActionBundle/Model/ActionGroup.php | 4 ++-- .../Model/ActionGroup/ParametersResolver.php | 2 +- .../Model/ActionGroupInterface.php | 4 ++-- .../Bundle/ActionBundle/Model/Operation.php | 10 ++++---- .../Tests/Unit/Action/CreateDateTest.php | 2 +- .../Command/AbstractDebugCommandTestCase.php | 4 ++-- .../DeleteMassActionExtensionTest.php | 2 +- .../DatagridActionButtonProviderTest.php | 6 ++--- .../Unit/Form/Type/OperationTypeTest.php | 4 ++-- .../Tests/Unit/Helper/ContextHelperTest.php | 8 +++---- .../Tests/Unit/Model/AbstractGuesserTest.php | 4 ++-- .../ActionGroup/ParametersResolverTest.php | 2 +- .../Tests/Unit/Model/AttributeGuesserTest.php | 2 +- .../Unit/Model/OperationRegistryTest.php | 2 +- .../Tests/Unit/Stub/TestTarget.php | 2 +- .../Entity/ActivityList.php | 10 ++++---- .../Entity/ActivityOwner.php | 6 ++--- .../Model/Accessor/ActivityAccessorTest.php | 2 +- .../ActivityListChainProviderTest.php | 2 +- .../Tests/Unit/Entity/AbstractAddressTest.php | 2 +- .../Tests/Unit/Entity/AbstractEmailTest.php | 2 +- .../Tests/Unit/Entity/AbstractPhoneTest.php | 2 +- .../FixAddressesTypesSubscriberTest.php | 2 +- .../ApiBundle/Config/FilterFieldConfig.php | 4 ++-- .../Bundle/ApiBundle/Config/FiltersConfig.php | 2 +- .../ApiBundle/Config/SorterFieldConfig.php | 4 ++-- .../Bundle/ApiBundle/Config/SortersConfig.php | 2 +- .../Bundle/ApiBundle/Filter/FilterValue.php | 2 +- .../Form/NamedValidationConstraint.php | 2 +- .../Batch/Async/AsyncOperationManagerTest.php | 4 ++-- .../JsonApiIncludeAccessorTest.php | 2 +- .../Batch/Processor/Update/FlushDataTest.php | 2 +- .../Definition/EntityConfigurationTest.php | 2 +- .../Unit/Filter/NestedTreeFilterTest.php | 2 +- .../DateTimeToStringTransformerTest.php | 6 ++--- .../EntityToIdTransformerTest.php | 4 ++-- .../Form/Guesser/MetadataTypeGuesserTest.php | 4 ++-- .../ByConfigObjectNormalizerTest.php | 2 +- .../CustomizeFormDataContextTest.php | 2 +- .../FlushDataHandlerTest.php | 6 ++--- .../CompleteDefinitionHelperTestCase.php | 4 ++-- .../GetConfig/ConfigProcessorTestCase.php | 2 +- .../GetConfig/ExpandRelatedEntitiesTest.php | 2 +- .../GetMetadata/Loader/LoaderTestCase.php | 2 +- .../GetMetadata/MetadataProcessorTestCase.php | 2 +- .../GetMetadata/NormalizeMetadataTest.php | 10 ++++---- .../OptimizedProcessorIteratorTest.php | 2 +- .../Shared/SetHttpResponseStatusCodeTest.php | 2 +- .../Shared/CollectFormErrorsTest.php | 2 +- .../UpdateList/StartAsyncOperationTest.php | 2 +- .../ExceptionTextExtractorDebugModeTest.php | 2 +- ...ExceptionTextExtractorNotDebugModeTest.php | 2 +- .../Bundle/AttachmentBundle/Entity/File.php | 2 +- .../Unit/Provider/ExternalUrlProviderTest.php | 2 +- .../Unit/Provider/FileUrlProviderTest.php | 2 +- .../Compiler/PushBatchLogHandlerPassTest.php | 2 +- .../ORM/Query/QueryCountCalculatorTest.php | 4 ++-- .../CountQueryBuilderOptimizerTest.php | 2 +- .../Entity/BaseCart.php | 4 ++-- .../Entity/BaseOrder.php | 4 ++-- .../Entity/BasePerson.php | 2 +- .../CommentBundle/Entity/BaseComment.php | 6 ++--- .../CommentLifecycleListenerTest.php | 6 ++--- .../Entity/ScheduleIntervalInterface.php | 4 ++-- .../Entity/ScheduleIntervalTrait.php | 4 ++-- .../Form/Type/ScheduleIntervalTypeTest.php | 2 +- .../UpdatePriceByValueAndCurrencyTest.php | 2 +- .../Unit/Api/Stub/PriceAwareEntityStub.php | 2 +- .../DashboardBundle/Helper/DateHelper.php | 8 +++---- .../Entity/AbstractGridView.php | 4 ++-- .../Bundle/DataGridBundle/Entity/GridView.php | 2 +- .../Provider/SystemAwareResolver.php | 2 +- .../Common/DatagridConfigurationTest.php | 2 +- .../DatasourceBindParametersListenerTest.php | 2 +- .../Extension/Action/ActionExtensionTest.php | 6 ++--- .../GridViews/GridViewsExtensionTest.php | 2 +- .../MassAction/MassActionDispatcherTest.php | 6 ++--- .../Routing/AbstractLoader.php | 4 ++-- .../DraftableFilterListenerTest.php | 2 +- .../Tests/Unit/Voter/AclVoterTest.php | 2 +- .../EmailBundle/Entity/EmailAddress.php | 2 +- .../EmailBundle/Entity/EmailAttachment.php | 2 +- .../Bundle/EmailBundle/Entity/EmailOrigin.php | 4 ++-- .../EmailBundle/Entity/EmailTemplate.php | 2 +- .../Bundle/EmailBundle/Entity/EmailUser.php | 4 ++-- .../Model/EmailRecipientsProviderArgs.php | 2 +- .../Bundle/EmailBundle/Model/Recipient.php | 2 +- .../Sync/AbstractEmailSynchronizer.php | 8 +++---- .../Sync/EmailSynchronizerInterface.php | 2 +- ...ecalculateEmailVisibilityProcessorTest.php | 4 ++-- ...sibilitiesForOrganizationProcessorTest.php | 2 +- .../Manager/EmailActivityManagerTest.php | 2 +- .../Unit/Entity/TestFixtures/EmailAddress.php | 2 +- .../Unit/Fixtures/Entity/EmailAddress.php | 2 +- .../Checker/SmtpSettingsCheckerTest.php | 2 +- .../TranslatedEmailTemplateProviderTest.php | 2 +- .../Tests/Unit/Sender/EmailFactoryTest.php | 2 +- .../Tests/Unit/Stub/AddressStub.php | 2 +- .../Tests/Unit/Stub/CustomerStub.php | 2 +- .../CreatedAtAwareInterface.php | 2 +- .../EntityProperty/CreatedAtAwareTrait.php | 2 +- .../UpdatedAtAwareInterface.php | 2 +- .../EntityProperty/UpdatedAtAwareTrait.php | 2 +- .../UpdatedByAwareInterface.php | 2 +- .../EntityBundle/Helper/FieldHelper.php | 2 +- .../EntityConfigBundle/Config/Config.php | 2 +- .../Config/ConfigInterface.php | 2 +- .../Entity/EntityConfigModel.php | 2 +- .../Serializer/EntityFieldNormalizer.php | 8 +++---- .../Provider/ConfigProvider.php | 18 +++++++-------- .../Tests/Unit/Config/ConfigManagerTest.php | 6 ++--- .../EventListener/ConfigSubscriberTest.php | 4 ++-- .../AttributeConfigExtensionTest.php | 2 +- .../Unit/Form/Type/AttributeGroupTypeTest.php | 4 ++-- .../Unit/Form/Util/ConfigTypeHelperTest.php | 6 ++--- .../EntityFieldFixtureTest.php | 2 +- .../Metadata/Factory/MetadataFactoryTest.php | 4 ++-- .../AttributeFamilyEntityNameProviderTest.php | 2 +- .../Tests/Unit/Stub/AttributeGroupStub.php | 2 +- .../ConfigTranslationHelperTest.php | 2 +- .../Decorator/OroPropertyAccessorBuilder.php | 2 +- .../PropertyAccessorWithDotArraySyntax.php | 6 ++--- .../Extend/ReflectionExtractor.php | 8 +++---- .../EntityExtendBundle/PropertyAccess.php | 4 ++-- .../EventListener/DoctrineListenerTest.php | 4 ++-- .../NonTraversableArrayObject.php | 2 +- .../PropertyAccess/TraversableArrayObject.php | 2 +- .../Form/Type/AbstractEnumTypeTestCase.php | 23 ++++++++++--------- .../Form/Type/AssociationChoiceTypeTest.php | 2 +- .../EntityExtendBundle/Tools/ExtendHelper.php | 2 +- .../Metadata/FieldMetadata.php | 2 +- .../EntityMergeBundle/Metadata/Metadata.php | 2 +- .../Metadata/MetadataInterface.php | 2 +- .../Entity/AbstractLocalizedFallbackValue.php | 2 +- .../LocaleBundle/Entity/Localization.php | 2 +- .../Entity/BusinessUnit.php | 2 +- .../SecurityBundle/AccessRule/Expr/Path.php | 2 +- src/Oro/Bundle/UIBundle/Twig/UiExtension.php | 4 ++-- .../Bundle/UserBundle/Entity/AbstractUser.php | 8 +++---- .../Entity/Ownership/UserAwareTrait.php | 2 +- .../Entity/PasswordRecoveryInterface.php | 4 ++-- src/Oro/Bundle/UserBundle/Entity/User.php | 8 +++---- .../UserBundle/Tests/Unit/Stub/UserStub.php | 2 +- .../Action/Action/ActionFactoryInterface.php | 2 +- .../Exception/ExecutionFailedException.php | 6 ++--- .../Component/Config/Common/ConfigObject.php | 6 ++--- .../ConfigExpression/AbstractExpression.php | 2 +- .../ConfigExpression/ExpressionInterface.php | 2 +- .../EntityConfigInterface.php | 2 +- .../EntitySerializer/FieldConfigInterface.php | 4 ++-- .../Testing/Command/CommandTestingTrait.php | 4 ++-- .../Component/Testing/Unit/EntityTrait.php | 2 +- .../Testing/Unit/ORM/OrmTestCase.php | 2 +- .../Testing/Unit/PreloadedExtension.php | 2 +- 156 files changed, 266 insertions(+), 265 deletions(-) diff --git a/src/Oro/Bundle/ActionBundle/Extension/ButtonProviderExtensionInterface.php b/src/Oro/Bundle/ActionBundle/Extension/ButtonProviderExtensionInterface.php index 2f2194d6443..414a7148208 100644 --- a/src/Oro/Bundle/ActionBundle/Extension/ButtonProviderExtensionInterface.php +++ b/src/Oro/Bundle/ActionBundle/Extension/ButtonProviderExtensionInterface.php @@ -25,7 +25,7 @@ public function find(ButtonSearchContext $buttonSearchContext); public function isAvailable( ButtonInterface $button, ButtonSearchContext $buttonSearchContext, - Collection $errors = null + ?Collection $errors = null ); /** diff --git a/src/Oro/Bundle/ActionBundle/Helper/ContextHelper.php b/src/Oro/Bundle/ActionBundle/Helper/ContextHelper.php index 6895f19b8a6..1feab871355 100644 --- a/src/Oro/Bundle/ActionBundle/Helper/ContextHelper.php +++ b/src/Oro/Bundle/ActionBundle/Helper/ContextHelper.php @@ -36,7 +36,7 @@ class ContextHelper public function __construct( DoctrineHelper $doctrineHelper, PropertyAccessorInterface $propertyAccessor, - RequestStack $requestStack = null + ?RequestStack $requestStack = null ) { $this->doctrineHelper = $doctrineHelper; $this->propertyAccessor = $propertyAccessor; @@ -47,7 +47,7 @@ public function __construct( * @param array|null $context * @return array */ - public function getContext(array $context = null) + public function getContext(?array $context = null) { if (null === $context) { $route = $this->getRequestParameter(self::ROUTE_PARAM) ?: $this->getRequestParameter('_route'); @@ -102,7 +102,7 @@ public function getActionParameters(array $context) * @param array|null $context * @return ActionData */ - public function getActionData(array $context = null) + public function getActionData(?array $context = null) { $context = $this->getContext($context); diff --git a/src/Oro/Bundle/ActionBundle/Model/ActionGroup.php b/src/Oro/Bundle/ActionBundle/Model/ActionGroup.php index 23888b2a95d..b6015f4f074 100644 --- a/src/Oro/Bundle/ActionBundle/Model/ActionGroup.php +++ b/src/Oro/Bundle/ActionBundle/Model/ActionGroup.php @@ -48,7 +48,7 @@ public function __construct( } #[\Override] - public function execute(ActionData $data, Collection $errors = null): ActionData + public function execute(ActionData $data, ?Collection $errors = null): ActionData { $this->parametersResolver->resolve($data, $this, $errors); @@ -76,7 +76,7 @@ public function getDefinition(): ActionGroupDefinition } #[\Override] - public function isAllowed(ActionData $data, Collection $errors = null): bool + public function isAllowed(ActionData $data, ?Collection $errors = null): bool { $guardEvent = new ActionGroupGuardEvent($data, $this->getDefinition(), $errors); $this->eventDispatcher->dispatch($guardEvent); diff --git a/src/Oro/Bundle/ActionBundle/Model/ActionGroup/ParametersResolver.php b/src/Oro/Bundle/ActionBundle/Model/ActionGroup/ParametersResolver.php index 29f95aa81f2..7bf939b0758 100644 --- a/src/Oro/Bundle/ActionBundle/Model/ActionGroup/ParametersResolver.php +++ b/src/Oro/Bundle/ActionBundle/Model/ActionGroup/ParametersResolver.php @@ -26,7 +26,7 @@ class ParametersResolver public function resolve( ActionData $data, ActionGroupInterface $actionGroup, - Collection $errors = null, + ?Collection $errors = null, bool $checkSnakeCase = false ) { $violations = []; diff --git a/src/Oro/Bundle/ActionBundle/Model/ActionGroupInterface.php b/src/Oro/Bundle/ActionBundle/Model/ActionGroupInterface.php index 3fb82974e01..eb82e56993c 100644 --- a/src/Oro/Bundle/ActionBundle/Model/ActionGroupInterface.php +++ b/src/Oro/Bundle/ActionBundle/Model/ActionGroupInterface.php @@ -16,7 +16,7 @@ interface ActionGroupInterface * @return ActionData * @throws ForbiddenActionGroupException */ - public function execute(ActionData $data, Collection $errors = null): ActionData; + public function execute(ActionData $data, ?Collection $errors = null): ActionData; /** * @return ActionGroupDefinition @@ -30,7 +30,7 @@ public function getDefinition(): ActionGroupDefinition; * @param Collection|null $errors * @return bool */ - public function isAllowed(ActionData $data, Collection $errors = null): bool; + public function isAllowed(ActionData $data, ?Collection $errors = null): bool; /** * @return array|Parameter[] diff --git a/src/Oro/Bundle/ActionBundle/Model/Operation.php b/src/Oro/Bundle/ActionBundle/Model/Operation.php index 066418f1c8b..0bbc3248cc2 100644 --- a/src/Oro/Bundle/ActionBundle/Model/Operation.php +++ b/src/Oro/Bundle/ActionBundle/Model/Operation.php @@ -115,7 +115,7 @@ public function init(ActionData $data) * @param Collection $errors * @throws ForbiddenOperationException */ - public function execute(ActionData $data, Collection $errors = null) + public function execute(ActionData $data, ?Collection $errors = null) { if (!$this->isAllowed($data, $errors)) { throw new ForbiddenOperationException(sprintf('Operation "%s" is not allowed.', $this->getName())); @@ -152,14 +152,14 @@ public function isAvailable(ActionData $data) * @param Collection|null $errors * @return bool */ - public function isAllowed(ActionData $data, Collection $errors = null) + public function isAllowed(ActionData $data, ?Collection $errors = null) { return $this->isPreConditionAllowed($data, $errors) && $this->getDefinition()->getEnabled() && $this->isConditionAllowed($data, $errors); } - private function isConditionAllowed(ActionData $data, Collection $errors = null): bool + private function isConditionAllowed(ActionData $data, ?Collection $errors = null): bool { $guardEvent = new OperationGuardEvent($data, $this->getDefinition(), $errors); $this->eventDispatcher->dispatch($guardEvent); @@ -179,7 +179,7 @@ private function isConditionAllowed(ActionData $data, Collection $errors = null) * @param Collection|null $errors * @return bool */ - protected function isPreConditionAllowed(ActionData $data, Collection $errors = null) + protected function isPreConditionAllowed(ActionData $data, ?Collection $errors = null) { $announceEvent = new OperationAnnounceEvent($data, $this->getDefinition(), $errors); $this->eventDispatcher->dispatch($announceEvent); @@ -267,7 +267,7 @@ protected function executeActions(ActionData $data, $name) * @param Collection|null $errors * @return boolean */ - protected function evaluateConditions(ActionData $data, $name, Collection $errors = null) + protected function evaluateConditions(ActionData $data, $name, ?Collection $errors = null) { if (!array_key_exists($name, $this->conditions)) { $this->conditions[$name] = false; diff --git a/src/Oro/Bundle/ActionBundle/Tests/Unit/Action/CreateDateTest.php b/src/Oro/Bundle/ActionBundle/Tests/Unit/Action/CreateDateTest.php index 983b48c8a83..a7ec1acaa77 100644 --- a/src/Oro/Bundle/ActionBundle/Tests/Unit/Action/CreateDateTest.php +++ b/src/Oro/Bundle/ActionBundle/Tests/Unit/Action/CreateDateTest.php @@ -40,7 +40,7 @@ public function testInitializeExceptionInvalidTime() /** * @dataProvider executeDataProvider */ - public function testExecute(array $options, \DateTime $expectedResult = null) + public function testExecute(array $options, ?\DateTime $expectedResult = null) { $context = new ItemStub([]); $attributeName = (string)$options['attribute']; diff --git a/src/Oro/Bundle/ActionBundle/Tests/Unit/Command/AbstractDebugCommandTestCase.php b/src/Oro/Bundle/ActionBundle/Tests/Unit/Command/AbstractDebugCommandTestCase.php index db9b71fcf82..b5769a210d2 100644 --- a/src/Oro/Bundle/ActionBundle/Tests/Unit/Command/AbstractDebugCommandTestCase.php +++ b/src/Oro/Bundle/ActionBundle/Tests/Unit/Command/AbstractDebugCommandTestCase.php @@ -43,8 +43,8 @@ protected function setUp(): void public function testExecute( array $types, array $expected, - string $argument = null, - \Throwable $exception = null + ?string $argument = null, + ?\Throwable $exception = null ): void { $this->input->expects($this->once()) ->method('getArgument') diff --git a/src/Oro/Bundle/ActionBundle/Tests/Unit/Datagrid/Extension/DeleteMassActionExtensionTest.php b/src/Oro/Bundle/ActionBundle/Tests/Unit/Datagrid/Extension/DeleteMassActionExtensionTest.php index 590802d994e..ad279308684 100644 --- a/src/Oro/Bundle/ActionBundle/Tests/Unit/Datagrid/Extension/DeleteMassActionExtensionTest.php +++ b/src/Oro/Bundle/ActionBundle/Tests/Unit/Datagrid/Extension/DeleteMassActionExtensionTest.php @@ -62,7 +62,7 @@ public function testSetGroups() /** * @dataProvider isApplicableDataProvider */ - public function testIsApplicable(ActionData $actionData, Operation $operation = null, bool $expected = false) + public function testIsApplicable(ActionData $actionData, ?Operation $operation = null, bool $expected = false) { $this->registry->expects($this->once()) ->method('findByName') diff --git a/src/Oro/Bundle/ActionBundle/Tests/Unit/Datagrid/Provider/DatagridActionButtonProviderTest.php b/src/Oro/Bundle/ActionBundle/Tests/Unit/Datagrid/Provider/DatagridActionButtonProviderTest.php index eae6aaccb9e..ecbb35c937e 100644 --- a/src/Oro/Bundle/ActionBundle/Tests/Unit/Datagrid/Provider/DatagridActionButtonProviderTest.php +++ b/src/Oro/Bundle/ActionBundle/Tests/Unit/Datagrid/Provider/DatagridActionButtonProviderTest.php @@ -144,7 +144,7 @@ public function testGetRowConfiguration( ResultRecord $record, ButtonsCollection $buttonsCollection, array $expectedActions, - array $groups = null + ?array $groups = null ): void { $this->buttonProvider->expects($this->any()) ->method('match') @@ -501,7 +501,7 @@ public function testOnConfigureActionsWithFewDatagrids(): void ); } - private function getRowActionConfig(string $label = null, array $data = []): array + private function getRowActionConfig(?string $label = null, array $data = []): array { return array_merge([ 'type' => 'button-widget', @@ -535,7 +535,7 @@ private function createOperationButton( string $name, bool $isAvailable, array $datagridOptions = [], - string $label = null + ?string $label = null ): ButtonInterface { $definition = $this->createMock(OperationDefinition::class); $definition->expects($this->any()) diff --git a/src/Oro/Bundle/ActionBundle/Tests/Unit/Form/Type/OperationTypeTest.php b/src/Oro/Bundle/ActionBundle/Tests/Unit/Form/Type/OperationTypeTest.php index 777d8fa16b5..7434519b3a7 100644 --- a/src/Oro/Bundle/ActionBundle/Tests/Unit/Form/Type/OperationTypeTest.php +++ b/src/Oro/Bundle/ActionBundle/Tests/Unit/Form/Type/OperationTypeTest.php @@ -49,7 +49,7 @@ public function testSubmit( array $submittedData, ActionData $expectedData, array $expectedChildrenOptions = [], - ActionData $expectedDefaultData = null + ?ActionData $expectedDefaultData = null ) { $form = $this->factory->create(OperationType::class, $defaultData, $inputOptions); @@ -224,7 +224,7 @@ public function submitDataProvider(): array /** * @dataProvider exceptionDataProvider */ - public function testException(array $options, string $exception, string $message, ActionData $data = null) + public function testException(array $options, string $exception, string $message, ?ActionData $data = null) { $this->expectException($exception); $this->expectExceptionMessage($message); diff --git a/src/Oro/Bundle/ActionBundle/Tests/Unit/Helper/ContextHelperTest.php b/src/Oro/Bundle/ActionBundle/Tests/Unit/Helper/ContextHelperTest.php index 1c857108770..39c322aef2c 100644 --- a/src/Oro/Bundle/ActionBundle/Tests/Unit/Helper/ContextHelperTest.php +++ b/src/Oro/Bundle/ActionBundle/Tests/Unit/Helper/ContextHelperTest.php @@ -216,7 +216,7 @@ public function testGetActionData( ?Request $request, int $requestStackCalls, ActionData $expected, - array $context = null + ?array $context = null ) { $entity = new \stdClass(); $entity->id = 42; @@ -393,7 +393,7 @@ public function testGetActionDataWithCache() $this->assertEquals($actionData, $this->helper->getActionData($context2)); } - private function getEntity(int $id = null): object + private function getEntity(?int $id = null): object { $entity = new \stdClass(); $entity->id = $id; @@ -402,9 +402,9 @@ private function getEntity(int $id = null): object } private function generateOperationToken( - string $entityClass = null, + ?string $entityClass = null, mixed $entityId = null, - string $datagrid = null + ?string $datagrid = null ): string { $array = []; diff --git a/src/Oro/Bundle/ActionBundle/Tests/Unit/Model/AbstractGuesserTest.php b/src/Oro/Bundle/ActionBundle/Tests/Unit/Model/AbstractGuesserTest.php index 012eec2bd45..0d858a1d060 100644 --- a/src/Oro/Bundle/ActionBundle/Tests/Unit/Model/AbstractGuesserTest.php +++ b/src/Oro/Bundle/ActionBundle/Tests/Unit/Model/AbstractGuesserTest.php @@ -434,8 +434,8 @@ private function setEntityConfigProvider( string $field, bool $multiple = false, bool $hasConfig = true, - string $label = null, - string $fieldType = null + ?string $label = null, + ?string $fieldType = null ): void { $labelOption = $multiple ? 'plural_label' : 'label'; diff --git a/src/Oro/Bundle/ActionBundle/Tests/Unit/Model/ActionGroup/ParametersResolverTest.php b/src/Oro/Bundle/ActionBundle/Tests/Unit/Model/ActionGroup/ParametersResolverTest.php index c73252d3d74..2f3296be653 100644 --- a/src/Oro/Bundle/ActionBundle/Tests/Unit/Model/ActionGroup/ParametersResolverTest.php +++ b/src/Oro/Bundle/ActionBundle/Tests/Unit/Model/ActionGroup/ParametersResolverTest.php @@ -213,7 +213,7 @@ private function violationTypeProviderArgs( string $type, string $gotType, string $gotValue, - string $customMessage = null + ?string $customMessage = null ): array { $typedParam = new Parameter($paramName); $typedParam->setType($type); diff --git a/src/Oro/Bundle/ActionBundle/Tests/Unit/Model/AttributeGuesserTest.php b/src/Oro/Bundle/ActionBundle/Tests/Unit/Model/AttributeGuesserTest.php index f14876d727d..9ec63f3bad0 100644 --- a/src/Oro/Bundle/ActionBundle/Tests/Unit/Model/AttributeGuesserTest.php +++ b/src/Oro/Bundle/ActionBundle/Tests/Unit/Model/AttributeGuesserTest.php @@ -174,7 +174,7 @@ public function guessClassAttributeFormDataProvider(): array ]; } - private function createAttribute(string $type, string $propertyPath = null, array $options = []): Attribute + private function createAttribute(string $type, ?string $propertyPath = null, array $options = []): Attribute { $attribute = new Attribute(); $attribute->setType($type) diff --git a/src/Oro/Bundle/ActionBundle/Tests/Unit/Model/OperationRegistryTest.php b/src/Oro/Bundle/ActionBundle/Tests/Unit/Model/OperationRegistryTest.php index 8a9b1b7a094..3f8dd0fb090 100644 --- a/src/Oro/Bundle/ActionBundle/Tests/Unit/Model/OperationRegistryTest.php +++ b/src/Oro/Bundle/ActionBundle/Tests/Unit/Model/OperationRegistryTest.php @@ -263,7 +263,7 @@ public function findDataProvider(): array public function testFindByName( string $operationName, ?string $expected, - OperationFindCriteria $criteria = null, + ?OperationFindCriteria $criteria = null, array $filterResult = [] ) { $this->configurationProvider->expects($this->once()) diff --git a/src/Oro/Bundle/ActivityBundle/Tests/Unit/Stub/TestTarget.php b/src/Oro/Bundle/ActivityBundle/Tests/Unit/Stub/TestTarget.php index 2316e87bc5f..8433a932c97 100644 --- a/src/Oro/Bundle/ActivityBundle/Tests/Unit/Stub/TestTarget.php +++ b/src/Oro/Bundle/ActivityBundle/Tests/Unit/Stub/TestTarget.php @@ -6,7 +6,7 @@ class TestTarget { private ?int $id; - public function __construct(int $id = null) + public function __construct(?int $id = null) { $this->id = $id; } diff --git a/src/Oro/Bundle/ActivityListBundle/Entity/ActivityList.php b/src/Oro/Bundle/ActivityListBundle/Entity/ActivityList.php index 9ad1036cfc4..1d25c7421c6 100644 --- a/src/Oro/Bundle/ActivityListBundle/Entity/ActivityList.php +++ b/src/Oro/Bundle/ActivityListBundle/Entity/ActivityList.php @@ -305,7 +305,7 @@ public function getOrganization() * * @return self */ - public function setOrganization(Organization $organization = null) + public function setOrganization(?Organization $organization = null) { $this->organization = $organization; @@ -317,7 +317,7 @@ public function setOrganization(Organization $organization = null) * * @return self */ - public function setOwner(User $owner = null) + public function setOwner(?User $owner = null) { $this->owner = $owner; @@ -346,7 +346,7 @@ public function getRelatedActivityClass() * @return self */ #[\Override] - public function setUpdatedBy(User $updatedBy = null) + public function setUpdatedBy(?User $updatedBy = null) { $this->updatedBySet = false; if ($updatedBy !== null) { @@ -422,7 +422,7 @@ public function getCreatedAt() * @return $this */ #[\Override] - public function setCreatedAt(\DateTimeInterface $createdAt = null) + public function setCreatedAt(?\DateTimeInterface $createdAt = null) { $this->createdAt = $createdAt; @@ -444,7 +444,7 @@ public function getUpdatedAt() * @return $this */ #[\Override] - public function setUpdatedAt(\DateTimeInterface $updatedAt = null) + public function setUpdatedAt(?\DateTimeInterface $updatedAt = null) { $this->updatedAtSet = false; if ($updatedAt !== null) { diff --git a/src/Oro/Bundle/ActivityListBundle/Entity/ActivityOwner.php b/src/Oro/Bundle/ActivityListBundle/Entity/ActivityOwner.php index fab952c62e5..76533105d50 100644 --- a/src/Oro/Bundle/ActivityListBundle/Entity/ActivityOwner.php +++ b/src/Oro/Bundle/ActivityListBundle/Entity/ActivityOwner.php @@ -60,7 +60,7 @@ public function getOrganization() * * @return self */ - public function setOrganization(Organization $organization = null) + public function setOrganization(?Organization $organization = null) { $this->organization = $organization; @@ -84,7 +84,7 @@ public function getActivity() * * @return self */ - public function setActivity(ActivityList $activity = null) + public function setActivity(?ActivityList $activity = null) { $this->activity = $activity; @@ -96,7 +96,7 @@ public function setActivity(ActivityList $activity = null) * * @return self */ - public function setUser(User $user = null) + public function setUser(?User $user = null) { $this->user = $user; diff --git a/src/Oro/Bundle/ActivityListBundle/Tests/Unit/Model/Accessor/ActivityAccessorTest.php b/src/Oro/Bundle/ActivityListBundle/Tests/Unit/Model/Accessor/ActivityAccessorTest.php index 861265d47c6..0cfa27bda4f 100644 --- a/src/Oro/Bundle/ActivityListBundle/Tests/Unit/Model/Accessor/ActivityAccessorTest.php +++ b/src/Oro/Bundle/ActivityListBundle/Tests/Unit/Model/Accessor/ActivityAccessorTest.php @@ -65,7 +65,7 @@ public function getValueDataProvider(): array ]; } - private function getFieldMetadata(string $fieldName = null, array $options = []): FieldMetadata + private function getFieldMetadata(?string $fieldName = null, array $options = []): FieldMetadata { $result = $this->createMock(FieldMetadata::class); $result->expects($this->any()) diff --git a/src/Oro/Bundle/ActivityListBundle/Tests/Unit/Provider/ActivityListChainProviderTest.php b/src/Oro/Bundle/ActivityListBundle/Tests/Unit/Provider/ActivityListChainProviderTest.php index 6eb11cdf090..93fd22565c8 100644 --- a/src/Oro/Bundle/ActivityListBundle/Tests/Unit/Provider/ActivityListChainProviderTest.php +++ b/src/Oro/Bundle/ActivityListBundle/Tests/Unit/Provider/ActivityListChainProviderTest.php @@ -62,7 +62,7 @@ protected function setUp(): void $this->testActivityProvider = new TestActivityProvider(); } - private function getActivityListChainProvider(string $testActivityAclClass = null): ActivityListChainProvider + private function getActivityListChainProvider(?string $testActivityAclClass = null): ActivityListChainProvider { $activityAclClasses = []; if ($testActivityAclClass) { diff --git a/src/Oro/Bundle/AddressBundle/Tests/Unit/Entity/AbstractAddressTest.php b/src/Oro/Bundle/AddressBundle/Tests/Unit/Entity/AbstractAddressTest.php index fc8c4fe6822..6556ece5333 100644 --- a/src/Oro/Bundle/AddressBundle/Tests/Unit/Entity/AbstractAddressTest.php +++ b/src/Oro/Bundle/AddressBundle/Tests/Unit/Entity/AbstractAddressTest.php @@ -295,7 +295,7 @@ public function isEqualDataProvider(): array ]; } - private function createAddress(int $id = null): AbstractAddress + private function createAddress(?int $id = null): AbstractAddress { $address = $this->getMockForAbstractClass(AbstractAddress::class); if (null !== $id) { diff --git a/src/Oro/Bundle/AddressBundle/Tests/Unit/Entity/AbstractEmailTest.php b/src/Oro/Bundle/AddressBundle/Tests/Unit/Entity/AbstractEmailTest.php index 56640fad4bb..543769f75b1 100644 --- a/src/Oro/Bundle/AddressBundle/Tests/Unit/Entity/AbstractEmailTest.php +++ b/src/Oro/Bundle/AddressBundle/Tests/Unit/Entity/AbstractEmailTest.php @@ -79,7 +79,7 @@ public function isEqualDataProvider(): array ]; } - private function createEmail(string $email = null, int $id = null): AbstractEmail + private function createEmail(?string $email = null, ?int $id = null): AbstractEmail { $arguments = []; if ($email) { diff --git a/src/Oro/Bundle/AddressBundle/Tests/Unit/Entity/AbstractPhoneTest.php b/src/Oro/Bundle/AddressBundle/Tests/Unit/Entity/AbstractPhoneTest.php index 5521f5653ce..52d67ce0deb 100644 --- a/src/Oro/Bundle/AddressBundle/Tests/Unit/Entity/AbstractPhoneTest.php +++ b/src/Oro/Bundle/AddressBundle/Tests/Unit/Entity/AbstractPhoneTest.php @@ -79,7 +79,7 @@ public function isEqualDataProvider(): array ]; } - private function createPhone(string $phone = null, int $id = null): AbstractPhone + private function createPhone(?string $phone = null, ?int $id = null): AbstractPhone { $arguments = []; if ($phone) { diff --git a/src/Oro/Bundle/AddressBundle/Tests/Unit/Form/EventListener/FixAddressesTypesSubscriberTest.php b/src/Oro/Bundle/AddressBundle/Tests/Unit/Form/EventListener/FixAddressesTypesSubscriberTest.php index 83f84aea243..a39636270cb 100644 --- a/src/Oro/Bundle/AddressBundle/Tests/Unit/Form/EventListener/FixAddressesTypesSubscriberTest.php +++ b/src/Oro/Bundle/AddressBundle/Tests/Unit/Form/EventListener/FixAddressesTypesSubscriberTest.php @@ -21,7 +21,7 @@ protected function setUp(): void $this->subscriber = new FixAddressesTypesSubscriber('owner.addresses'); } - private function createAddress(AddressType $type = null): TypedAddress + private function createAddress(?AddressType $type = null): TypedAddress { $address = new TypedAddress(); if (null !== $type) { diff --git a/src/Oro/Bundle/ApiBundle/Config/FilterFieldConfig.php b/src/Oro/Bundle/ApiBundle/Config/FilterFieldConfig.php index 7ac1fe86282..610615ea633 100644 --- a/src/Oro/Bundle/ApiBundle/Config/FilterFieldConfig.php +++ b/src/Oro/Bundle/ApiBundle/Config/FilterFieldConfig.php @@ -170,7 +170,7 @@ public function hasPropertyPath(): bool * Gets the path of the field value. */ #[\Override] - public function getPropertyPath(string $defaultValue = null): ?string + public function getPropertyPath(?string $defaultValue = null): ?string { if (empty($this->items[ConfigUtil::PROPERTY_PATH])) { return $defaultValue; @@ -183,7 +183,7 @@ public function getPropertyPath(string $defaultValue = null): ?string * Sets the path of the field value. */ #[\Override] - public function setPropertyPath(string $propertyPath = null): void + public function setPropertyPath(?string $propertyPath = null): void { if ($propertyPath) { $this->items[ConfigUtil::PROPERTY_PATH] = $propertyPath; diff --git a/src/Oro/Bundle/ApiBundle/Config/FiltersConfig.php b/src/Oro/Bundle/ApiBundle/Config/FiltersConfig.php index 58abea0aec6..c3fb11c7868 100644 --- a/src/Oro/Bundle/ApiBundle/Config/FiltersConfig.php +++ b/src/Oro/Bundle/ApiBundle/Config/FiltersConfig.php @@ -129,7 +129,7 @@ public function getOrAddField(string $fieldName): FilterFieldConfig * Adds the configuration of the filter. */ #[\Override] - public function addField(string $fieldName, FieldConfigInterface $field = null): FilterFieldConfig + public function addField(string $fieldName, ?FieldConfigInterface $field = null): FilterFieldConfig { if (null === $field) { $field = new FilterFieldConfig(); diff --git a/src/Oro/Bundle/ApiBundle/Config/SorterFieldConfig.php b/src/Oro/Bundle/ApiBundle/Config/SorterFieldConfig.php index a02cbf8e903..58f97e00dc4 100644 --- a/src/Oro/Bundle/ApiBundle/Config/SorterFieldConfig.php +++ b/src/Oro/Bundle/ApiBundle/Config/SorterFieldConfig.php @@ -126,7 +126,7 @@ public function hasPropertyPath(): bool * Gets the path of the field value. */ #[\Override] - public function getPropertyPath(string $defaultValue = null): ?string + public function getPropertyPath(?string $defaultValue = null): ?string { if (empty($this->items[ConfigUtil::PROPERTY_PATH])) { return $defaultValue; @@ -139,7 +139,7 @@ public function getPropertyPath(string $defaultValue = null): ?string * Sets the path of the field value. */ #[\Override] - public function setPropertyPath(string $propertyPath = null): void + public function setPropertyPath(?string $propertyPath = null): void { if ($propertyPath) { $this->items[ConfigUtil::PROPERTY_PATH] = $propertyPath; diff --git a/src/Oro/Bundle/ApiBundle/Config/SortersConfig.php b/src/Oro/Bundle/ApiBundle/Config/SortersConfig.php index 91228dc0d1c..6d1d0c15e5a 100644 --- a/src/Oro/Bundle/ApiBundle/Config/SortersConfig.php +++ b/src/Oro/Bundle/ApiBundle/Config/SortersConfig.php @@ -129,7 +129,7 @@ public function getOrAddField(string $fieldName): SorterFieldConfig * Adds the configuration of the sorter. */ #[\Override] - public function addField(string $fieldName, FieldConfigInterface $field = null): SorterFieldConfig + public function addField(string $fieldName, ?FieldConfigInterface $field = null): SorterFieldConfig { if (null === $field) { $field = new SorterFieldConfig(); diff --git a/src/Oro/Bundle/ApiBundle/Filter/FilterValue.php b/src/Oro/Bundle/ApiBundle/Filter/FilterValue.php index d2a2ba29455..c1dedfd3c01 100644 --- a/src/Oro/Bundle/ApiBundle/Filter/FilterValue.php +++ b/src/Oro/Bundle/ApiBundle/Filter/FilterValue.php @@ -24,7 +24,7 @@ public static function createFromSource( string $sourceKey, string $path, string $value, - string $operator = null + ?string $operator = null ): self { $filterValue = new FilterValue($path, $value, $operator); $filterValue->sourceKey = $sourceKey; diff --git a/src/Oro/Bundle/ApiBundle/Form/NamedValidationConstraint.php b/src/Oro/Bundle/ApiBundle/Form/NamedValidationConstraint.php index 6a943b1ceba..bb9c47ec526 100644 --- a/src/Oro/Bundle/ApiBundle/Form/NamedValidationConstraint.php +++ b/src/Oro/Bundle/ApiBundle/Form/NamedValidationConstraint.php @@ -25,7 +25,7 @@ class NamedValidationConstraint extends Constraint implements ConstraintWithStat * * a human readable constraint type, e.g. "not blank" or "not_blank" * @param int|null $statusCode HTTP status code that should be returned if the constraint is not satisfied */ - public function __construct(string $constraintType, int $statusCode = null) + public function __construct(string $constraintType, ?int $statusCode = null) { parent::__construct([]); $this->constraintType = $constraintType; diff --git a/src/Oro/Bundle/ApiBundle/Tests/Unit/Batch/Async/AsyncOperationManagerTest.php b/src/Oro/Bundle/ApiBundle/Tests/Unit/Batch/Async/AsyncOperationManagerTest.php index 4420c9ca562..988767e5c56 100644 --- a/src/Oro/Bundle/ApiBundle/Tests/Unit/Batch/Async/AsyncOperationManagerTest.php +++ b/src/Oro/Bundle/ApiBundle/Tests/Unit/Batch/Async/AsyncOperationManagerTest.php @@ -53,7 +53,7 @@ protected function setUp(): void ); } - private function expectMarkAsRunningQuery(int $operationId, int $affectedRows, \Exception $exception = null): void + private function expectMarkAsRunningQuery(int $operationId, int $affectedRows, ?\Exception $exception = null): void { $qb = $this->createMock(QueryBuilder::class); $query = $this->createMock(AbstractQuery::class); @@ -116,7 +116,7 @@ private function expectMarkAsRunningQuery(int $operationId, int $affectedRows, \ } } - private function expectMarkAsFailedQuery(int $operationId, int $affectedRows, \Exception $exception = null): void + private function expectMarkAsFailedQuery(int $operationId, int $affectedRows, ?\Exception $exception = null): void { $qb = $this->createMock(QueryBuilder::class); $query = $this->createMock(AbstractQuery::class); diff --git a/src/Oro/Bundle/ApiBundle/Tests/Unit/Batch/IncludeAccessor/JsonApiIncludeAccessorTest.php b/src/Oro/Bundle/ApiBundle/Tests/Unit/Batch/IncludeAccessor/JsonApiIncludeAccessorTest.php index 04d53a9d9a4..9922f48bccd 100644 --- a/src/Oro/Bundle/ApiBundle/Tests/Unit/Batch/IncludeAccessor/JsonApiIncludeAccessorTest.php +++ b/src/Oro/Bundle/ApiBundle/Tests/Unit/Batch/IncludeAccessor/JsonApiIncludeAccessorTest.php @@ -201,7 +201,7 @@ public function getRelationshipsProvider(): array /** * @dataProvider updateRelationshipsProvider */ - public function testUpdateRelationships(array $item, array $expectedResult = null) + public function testUpdateRelationships(array $item, ?array $expectedResult = null) { if (null === $expectedResult) { $expectedResult = $item; diff --git a/src/Oro/Bundle/ApiBundle/Tests/Unit/Batch/Processor/Update/FlushDataTest.php b/src/Oro/Bundle/ApiBundle/Tests/Unit/Batch/Processor/Update/FlushDataTest.php index d1ddded4d8b..b225c61b5cc 100644 --- a/src/Oro/Bundle/ApiBundle/Tests/Unit/Batch/Processor/Update/FlushDataTest.php +++ b/src/Oro/Bundle/ApiBundle/Tests/Unit/Batch/Processor/Update/FlushDataTest.php @@ -75,7 +75,7 @@ private function expectFlushData( BatchFlushDataHandlerInterface|\PHPUnit\Framework\MockObject\MockObject $flushDataHandler, array $items, bool $flushDataCall = true, - \Exception $flushDataError = null + ?\Exception $flushDataError = null ): void { $finished = null; diff --git a/src/Oro/Bundle/ApiBundle/Tests/Unit/Config/Definition/EntityConfigurationTest.php b/src/Oro/Bundle/ApiBundle/Tests/Unit/Config/Definition/EntityConfigurationTest.php index 46e5e6b18e0..926d04379d8 100644 --- a/src/Oro/Bundle/ApiBundle/Tests/Unit/Config/Definition/EntityConfigurationTest.php +++ b/src/Oro/Bundle/ApiBundle/Tests/Unit/Config/Definition/EntityConfigurationTest.php @@ -23,7 +23,7 @@ class EntityConfigurationTest extends \PHPUnit\Framework\TestCase /** * @dataProvider loadConfigurationDataProvider */ - public function testLoadConfiguration(array $config, array $expected, string $error = null) + public function testLoadConfiguration(array $config, array $expected, ?string $error = null) { if (null !== $error) { $this->expectException(InvalidConfigurationException::class); diff --git a/src/Oro/Bundle/ApiBundle/Tests/Unit/Filter/NestedTreeFilterTest.php b/src/Oro/Bundle/ApiBundle/Tests/Unit/Filter/NestedTreeFilterTest.php index c064d1fae94..c5e7f68a92a 100644 --- a/src/Oro/Bundle/ApiBundle/Tests/Unit/Filter/NestedTreeFilterTest.php +++ b/src/Oro/Bundle/ApiBundle/Tests/Unit/Filter/NestedTreeFilterTest.php @@ -47,7 +47,7 @@ public function testWithoutOperator() /** * @dataProvider filterDataProvider */ - public function testFilter(FilterValue $filterValue, Comparison $expectation, string $field = null) + public function testFilter(FilterValue $filterValue, Comparison $expectation, ?string $field = null) { $supportedOperators = [ FilterOperator::GT, diff --git a/src/Oro/Bundle/ApiBundle/Tests/Unit/Form/DataTransformer/DateTimeToStringTransformerTest.php b/src/Oro/Bundle/ApiBundle/Tests/Unit/Form/DataTransformer/DateTimeToStringTransformerTest.php index a8fb2363713..bea60caef90 100644 --- a/src/Oro/Bundle/ApiBundle/Tests/Unit/Form/DataTransformer/DateTimeToStringTransformerTest.php +++ b/src/Oro/Bundle/ApiBundle/Tests/Unit/Form/DataTransformer/DateTimeToStringTransformerTest.php @@ -198,7 +198,7 @@ public function validValueForReverseTransformDataProvider(): array /** * @dataProvider invalidValueForReverseTransformDataProvider */ - public function testReverseTransformWithInvalidValue(string $value, string $exceptionMessage = null) + public function testReverseTransformWithInvalidValue(string $value, ?string $exceptionMessage = null) { if (null === $exceptionMessage) { $exceptionMessage = sprintf('The value "%s" is not a valid datetime.', $value); @@ -323,7 +323,7 @@ public function validValueForReverseTransformDateDataProvider(): array /** * @dataProvider invalidValueForReverseTransformDateDataProvider */ - public function testReverseTransformDateWithInvalidValue(string $value, string $exceptionMessage = null) + public function testReverseTransformDateWithInvalidValue(string $value, ?string $exceptionMessage = null) { if (null === $exceptionMessage) { $exceptionMessage = sprintf('The value "%s" is not a valid date.', $value); @@ -425,7 +425,7 @@ public function validValueForReverseTransformTimeDataProvider(): array /** * @dataProvider invalidValueForReverseTransformTimeDataProvider */ - public function testReverseTransformTimeWithInvalidValue(string $value, string $exceptionMessage = null) + public function testReverseTransformTimeWithInvalidValue(string $value, ?string $exceptionMessage = null) { if (null === $exceptionMessage) { $exceptionMessage = sprintf('The value "%s" is not a valid time.', $value); diff --git a/src/Oro/Bundle/ApiBundle/Tests/Unit/Form/DataTransformer/EntityToIdTransformerTest.php b/src/Oro/Bundle/ApiBundle/Tests/Unit/Form/DataTransformer/EntityToIdTransformerTest.php index 66cbb430287..e42c3f47c53 100644 --- a/src/Oro/Bundle/ApiBundle/Tests/Unit/Form/DataTransformer/EntityToIdTransformerTest.php +++ b/src/Oro/Bundle/ApiBundle/Tests/Unit/Form/DataTransformer/EntityToIdTransformerTest.php @@ -24,8 +24,8 @@ class EntityToIdTransformerTest extends OrmRelatedTestCase { private function getEntityToIdTransformer( AssociationMetadata $metadata, - EntityMapper $entityMapper = null, - IncludedEntityCollection $includedEntities = null + ?EntityMapper $entityMapper = null, + ?IncludedEntityCollection $includedEntities = null ): EntityToIdTransformer { return new EntityToIdTransformer( $this->doctrineHelper, diff --git a/src/Oro/Bundle/ApiBundle/Tests/Unit/Form/Guesser/MetadataTypeGuesserTest.php b/src/Oro/Bundle/ApiBundle/Tests/Unit/Form/Guesser/MetadataTypeGuesserTest.php index baa9c30f840..ecf2b5ed020 100644 --- a/src/Oro/Bundle/ApiBundle/Tests/Unit/Form/Guesser/MetadataTypeGuesserTest.php +++ b/src/Oro/Bundle/ApiBundle/Tests/Unit/Form/Guesser/MetadataTypeGuesserTest.php @@ -55,7 +55,7 @@ protected function setUp(): void ); } - private function getMetadataAccessor(EntityMetadata $metadata = null): MetadataAccessorInterface + private function getMetadataAccessor(?EntityMetadata $metadata = null): MetadataAccessorInterface { $metadataAccessor = $this->createMock(MetadataAccessorInterface::class); if (null === $metadata) { @@ -74,7 +74,7 @@ private function getMetadataAccessor(EntityMetadata $metadata = null): MetadataA private function getConfigAccessor( string $className, - EntityDefinitionConfig $config = null + ?EntityDefinitionConfig $config = null ): ConfigAccessorInterface { $configAccessor = $this->createMock(ConfigAccessorInterface::class); if (null === $config) { diff --git a/src/Oro/Bundle/ApiBundle/Tests/Unit/Normalizer/ByConfigObjectNormalizerTest.php b/src/Oro/Bundle/ApiBundle/Tests/Unit/Normalizer/ByConfigObjectNormalizerTest.php index 326a3cfe5a6..a392ef46edf 100644 --- a/src/Oro/Bundle/ApiBundle/Tests/Unit/Normalizer/ByConfigObjectNormalizerTest.php +++ b/src/Oro/Bundle/ApiBundle/Tests/Unit/Normalizer/ByConfigObjectNormalizerTest.php @@ -92,7 +92,7 @@ private function getRequestType(): RequestType return new RequestType([RequestType::REST]); } - private function normalizeObject(object $object, EntityDefinitionConfig $config = null, array $context = []): array + private function normalizeObject(object $object, ?EntityDefinitionConfig $config = null, array $context = []): array { if (!isset($context[ApiContext::REQUEST_TYPE])) { $context[ApiContext::REQUEST_TYPE] = $this->getRequestType(); diff --git a/src/Oro/Bundle/ApiBundle/Tests/Unit/Processor/CustomizeFormData/CustomizeFormDataContextTest.php b/src/Oro/Bundle/ApiBundle/Tests/Unit/Processor/CustomizeFormData/CustomizeFormDataContextTest.php index b6017708fa9..b7d193171c3 100644 --- a/src/Oro/Bundle/ApiBundle/Tests/Unit/Processor/CustomizeFormData/CustomizeFormDataContextTest.php +++ b/src/Oro/Bundle/ApiBundle/Tests/Unit/Processor/CustomizeFormData/CustomizeFormDataContextTest.php @@ -32,7 +32,7 @@ protected function setUp(): void private function getFormConfig( string $name, bool $compound = false, - string $propertyPath = null + ?string $propertyPath = null ): FormConfigInterface { $config = $this->createMock(FormConfigInterface::class); $config->expects(self::any()) diff --git a/src/Oro/Bundle/ApiBundle/Tests/Unit/Processor/CustomizeFormData/FlushDataHandlerTest.php b/src/Oro/Bundle/ApiBundle/Tests/Unit/Processor/CustomizeFormData/FlushDataHandlerTest.php index 2f5c0f14ad8..836912d5844 100644 --- a/src/Oro/Bundle/ApiBundle/Tests/Unit/Processor/CustomizeFormData/FlushDataHandlerTest.php +++ b/src/Oro/Bundle/ApiBundle/Tests/Unit/Processor/CustomizeFormData/FlushDataHandlerTest.php @@ -68,7 +68,7 @@ private function getForm(): FormInterface private function getFormContext( ?FormInterface $form, - IncludedEntityCollection $itemIncludedEntities = null, + ?IncludedEntityCollection $itemIncludedEntities = null, bool $noHasErrorsExpectation = false ): FormContext { $context = $this->createMock(FormContext::class); @@ -107,7 +107,7 @@ private function getFormContext( private function getSubresourceFormContext( ?FormInterface $form, - IncludedEntityCollection $itemIncludedEntities = null + ?IncludedEntityCollection $itemIncludedEntities = null ): FormContext { $context = $this->createMock(ChangeRelationshipContext::class); $context->expects(self::any()) @@ -129,7 +129,7 @@ private function getSubresourceFormContext( private function expectsFlush( array &$calls, EntityManagerInterface|MockObject $em, - \Throwable $exception = null + ?\Throwable $exception = null ): void { $connection = $this->createMock(Connection::class); diff --git a/src/Oro/Bundle/ApiBundle/Tests/Unit/Processor/GetConfig/CompleteDefinition/CompleteDefinitionHelperTestCase.php b/src/Oro/Bundle/ApiBundle/Tests/Unit/Processor/GetConfig/CompleteDefinition/CompleteDefinitionHelperTestCase.php index 99f70a0bf21..a07d02a71f2 100644 --- a/src/Oro/Bundle/ApiBundle/Tests/Unit/Processor/GetConfig/CompleteDefinition/CompleteDefinitionHelperTestCase.php +++ b/src/Oro/Bundle/ApiBundle/Tests/Unit/Processor/GetConfig/CompleteDefinition/CompleteDefinitionHelperTestCase.php @@ -29,7 +29,7 @@ protected function createConfigObject(array $config): EntityDefinitionConfig return $this->configLoaderFactory->getLoader(ConfigUtil::DEFINITION)->load($config); } - protected function createRelationConfigObject(array $definition = null): Config + protected function createRelationConfigObject(?array $definition = null): Config { $config = new Config(); if (null !== $definition) { @@ -55,7 +55,7 @@ protected function assertConfig(array $expected, object|array $actual): void } protected function getClassMetadataMock( - string $className = null + ?string $className = null ): ClassMetadata|\PHPUnit\Framework\MockObject\MockObject { if ($className) { $classMetadata = $this->getMockBuilder(ClassMetadata::class) diff --git a/src/Oro/Bundle/ApiBundle/Tests/Unit/Processor/GetConfig/ConfigProcessorTestCase.php b/src/Oro/Bundle/ApiBundle/Tests/Unit/Processor/GetConfig/ConfigProcessorTestCase.php index abc73e47563..01847749378 100644 --- a/src/Oro/Bundle/ApiBundle/Tests/Unit/Processor/GetConfig/ConfigProcessorTestCase.php +++ b/src/Oro/Bundle/ApiBundle/Tests/Unit/Processor/GetConfig/ConfigProcessorTestCase.php @@ -48,7 +48,7 @@ protected function convertConfigObjectToArray(object|array $config): array } protected function getClassMetadataMock( - string $className = null + ?string $className = null ): ClassMetadata|\PHPUnit\Framework\MockObject\MockObject { if ($className) { $classMetadata = $this->getMockBuilder(ClassMetadata::class) diff --git a/src/Oro/Bundle/ApiBundle/Tests/Unit/Processor/GetConfig/ExpandRelatedEntitiesTest.php b/src/Oro/Bundle/ApiBundle/Tests/Unit/Processor/GetConfig/ExpandRelatedEntitiesTest.php index f99cc056bd3..373c109198c 100644 --- a/src/Oro/Bundle/ApiBundle/Tests/Unit/Processor/GetConfig/ExpandRelatedEntitiesTest.php +++ b/src/Oro/Bundle/ApiBundle/Tests/Unit/Processor/GetConfig/ExpandRelatedEntitiesTest.php @@ -59,7 +59,7 @@ protected function setUp(): void ); } - private function createRelationConfigObject(array $definition = null, array $testSection = null): Config + private function createRelationConfigObject(?array $definition = null, ?array $testSection = null): Config { $config = new Config(); if (null !== $definition) { diff --git a/src/Oro/Bundle/ApiBundle/Tests/Unit/Processor/GetMetadata/Loader/LoaderTestCase.php b/src/Oro/Bundle/ApiBundle/Tests/Unit/Processor/GetMetadata/Loader/LoaderTestCase.php index 203698b74d4..8f75dda64d6 100644 --- a/src/Oro/Bundle/ApiBundle/Tests/Unit/Processor/GetMetadata/Loader/LoaderTestCase.php +++ b/src/Oro/Bundle/ApiBundle/Tests/Unit/Processor/GetMetadata/Loader/LoaderTestCase.php @@ -10,7 +10,7 @@ class LoaderTestCase extends \PHPUnit\Framework\TestCase { protected function getClassMetadataMock( - string $className = null + ?string $className = null ): ClassMetadata|\PHPUnit\Framework\MockObject\MockObject { if ($className) { $classMetadata = $this->getMockBuilder(ClassMetadata::class) diff --git a/src/Oro/Bundle/ApiBundle/Tests/Unit/Processor/GetMetadata/MetadataProcessorTestCase.php b/src/Oro/Bundle/ApiBundle/Tests/Unit/Processor/GetMetadata/MetadataProcessorTestCase.php index 1a731d7eeee..27e72b22a9b 100644 --- a/src/Oro/Bundle/ApiBundle/Tests/Unit/Processor/GetMetadata/MetadataProcessorTestCase.php +++ b/src/Oro/Bundle/ApiBundle/Tests/Unit/Processor/GetMetadata/MetadataProcessorTestCase.php @@ -45,7 +45,7 @@ protected function createConfigObject(array $config): EntityDefinitionConfig } protected function getClassMetadataMock( - string $className = null + ?string $className = null ): ClassMetadata|\PHPUnit\Framework\MockObject\MockObject { if ($className) { $classMetadata = $this->getMockBuilder(ClassMetadata::class) diff --git a/src/Oro/Bundle/ApiBundle/Tests/Unit/Processor/GetMetadata/NormalizeMetadataTest.php b/src/Oro/Bundle/ApiBundle/Tests/Unit/Processor/GetMetadata/NormalizeMetadataTest.php index d5373a4e8a3..f959028f103 100644 --- a/src/Oro/Bundle/ApiBundle/Tests/Unit/Processor/GetMetadata/NormalizeMetadataTest.php +++ b/src/Oro/Bundle/ApiBundle/Tests/Unit/Processor/GetMetadata/NormalizeMetadataTest.php @@ -54,7 +54,7 @@ protected function setUp(): void ); } - protected function createFieldMetadata(string $fieldName, string $dataType = null): FieldMetadata + protected function createFieldMetadata(string $fieldName, ?string $dataType = null): FieldMetadata { $fieldMetadata = new FieldMetadata(); $fieldMetadata->setName($fieldName); @@ -69,10 +69,10 @@ protected function createFieldMetadata(string $fieldName, string $dataType = nul protected function createAssociationMetadata( string $associationName, string $targetClass, - string $associationType = null, - bool $isCollection = null, - string $dataType = null, - array $acceptableTargetClasses = null, + ?string $associationType = null, + ?bool $isCollection = null, + ?string $dataType = null, + ?array $acceptableTargetClasses = null, bool $collapsed = false ): AssociationMetadata { $associationMetadata = new AssociationMetadata(); diff --git a/src/Oro/Bundle/ApiBundle/Tests/Unit/Processor/OptimizedProcessorIteratorTest.php b/src/Oro/Bundle/ApiBundle/Tests/Unit/Processor/OptimizedProcessorIteratorTest.php index 5fa2f8ad5d5..2d642a4c4c7 100644 --- a/src/Oro/Bundle/ApiBundle/Tests/Unit/Processor/OptimizedProcessorIteratorTest.php +++ b/src/Oro/Bundle/ApiBundle/Tests/Unit/Processor/OptimizedProcessorIteratorTest.php @@ -24,7 +24,7 @@ private function getProcessorIterator( array $processors, array $groups, Context $context, - ApplicableCheckerInterface $applicableChecker = null, + ?ApplicableCheckerInterface $applicableChecker = null, bool $withApplicableCache = false ): OptimizedProcessorIterator { $processorBag = $this->createMock(ProcessorBagInterface::class); diff --git a/src/Oro/Bundle/ApiBundle/Tests/Unit/Processor/Shared/SetHttpResponseStatusCodeTest.php b/src/Oro/Bundle/ApiBundle/Tests/Unit/Processor/Shared/SetHttpResponseStatusCodeTest.php index a18e39f89ea..f8c06ddb74d 100644 --- a/src/Oro/Bundle/ApiBundle/Tests/Unit/Processor/Shared/SetHttpResponseStatusCodeTest.php +++ b/src/Oro/Bundle/ApiBundle/Tests/Unit/Processor/Shared/SetHttpResponseStatusCodeTest.php @@ -128,7 +128,7 @@ public function processHasErrorsDataProvider(): array ]; } - private function getError(int $statusCode = null): Error + private function getError(?int $statusCode = null): Error { $error = new Error(); $error->setStatusCode($statusCode); diff --git a/src/Oro/Bundle/ApiBundle/Tests/Unit/Processor/Subresource/Shared/CollectFormErrorsTest.php b/src/Oro/Bundle/ApiBundle/Tests/Unit/Processor/Subresource/Shared/CollectFormErrorsTest.php index da574502f25..97e776da474 100644 --- a/src/Oro/Bundle/ApiBundle/Tests/Unit/Processor/Subresource/Shared/CollectFormErrorsTest.php +++ b/src/Oro/Bundle/ApiBundle/Tests/Unit/Processor/Subresource/Shared/CollectFormErrorsTest.php @@ -29,7 +29,7 @@ protected function setUp(): void ); } - private function createErrorObject(string $title, string $detail, string $propertyPath = null): Error + private function createErrorObject(string $title, string $detail, ?string $propertyPath = null): Error { $error = Error::createValidationError($title, $detail); if (null !== $propertyPath) { diff --git a/src/Oro/Bundle/ApiBundle/Tests/Unit/Processor/UpdateList/StartAsyncOperationTest.php b/src/Oro/Bundle/ApiBundle/Tests/Unit/Processor/UpdateList/StartAsyncOperationTest.php index 169f49deb47..eb6e653b53b 100644 --- a/src/Oro/Bundle/ApiBundle/Tests/Unit/Processor/UpdateList/StartAsyncOperationTest.php +++ b/src/Oro/Bundle/ApiBundle/Tests/Unit/Processor/UpdateList/StartAsyncOperationTest.php @@ -32,7 +32,7 @@ protected function setUp(): void $this->syncProcessingLimitProvider = $this->createMock(SyncProcessingLimitProvider::class); } - private function getProcessor(MessageProducerInterface $producer = null): StartAsyncOperation + private function getProcessor(?MessageProducerInterface $producer = null): StartAsyncOperation { return new StartAsyncOperation( $producer ?? $this->producer, diff --git a/src/Oro/Bundle/ApiBundle/Tests/Unit/Request/ExceptionTextExtractorDebugModeTest.php b/src/Oro/Bundle/ApiBundle/Tests/Unit/Request/ExceptionTextExtractorDebugModeTest.php index ce7459a2fae..f2136042950 100644 --- a/src/Oro/Bundle/ApiBundle/Tests/Unit/Request/ExceptionTextExtractorDebugModeTest.php +++ b/src/Oro/Bundle/ApiBundle/Tests/Unit/Request/ExceptionTextExtractorDebugModeTest.php @@ -47,7 +47,7 @@ protected function setUp(): void } private function createExecutionFailedException( - \Exception $innerException = null, + ?\Exception $innerException = null, string $processorId = 'processor1' ): ExecutionFailedException { return new ExecutionFailedException( diff --git a/src/Oro/Bundle/ApiBundle/Tests/Unit/Request/ExceptionTextExtractorNotDebugModeTest.php b/src/Oro/Bundle/ApiBundle/Tests/Unit/Request/ExceptionTextExtractorNotDebugModeTest.php index 5c4f80a819d..5dc011bd431 100644 --- a/src/Oro/Bundle/ApiBundle/Tests/Unit/Request/ExceptionTextExtractorNotDebugModeTest.php +++ b/src/Oro/Bundle/ApiBundle/Tests/Unit/Request/ExceptionTextExtractorNotDebugModeTest.php @@ -48,7 +48,7 @@ protected function setUp(): void } private function createExecutionFailedException( - \Exception $innerException = null, + ?\Exception $innerException = null, string $processorId = 'processor1' ): ExecutionFailedException { return new ExecutionFailedException( diff --git a/src/Oro/Bundle/AttachmentBundle/Entity/File.php b/src/Oro/Bundle/AttachmentBundle/Entity/File.php index 0c9b62c6537..f8804422c7f 100644 --- a/src/Oro/Bundle/AttachmentBundle/Entity/File.php +++ b/src/Oro/Bundle/AttachmentBundle/Entity/File.php @@ -229,7 +229,7 @@ public function getUpdatedAt() return $this->updatedAt; } - public function setFile(\SplFileInfo $file = null) + public function setFile(?\SplFileInfo $file = null) { $this->file = $file; diff --git a/src/Oro/Bundle/AttachmentBundle/Tests/Unit/Provider/ExternalUrlProviderTest.php b/src/Oro/Bundle/AttachmentBundle/Tests/Unit/Provider/ExternalUrlProviderTest.php index ef6022c7dbf..4ccbf2c8aa9 100644 --- a/src/Oro/Bundle/AttachmentBundle/Tests/Unit/Provider/ExternalUrlProviderTest.php +++ b/src/Oro/Bundle/AttachmentBundle/Tests/Unit/Provider/ExternalUrlProviderTest.php @@ -114,7 +114,7 @@ public function testGetFilteredImageUrlWhenExternalUrlIsNotEmpty(): void } private function getFile( - string $externalUrl = null + ?string $externalUrl = null ): File|\PHPUnit\Framework\MockObject\MockObject { $file = $this->createMock(File::class); $file->expects(self::any()) diff --git a/src/Oro/Bundle/AttachmentBundle/Tests/Unit/Provider/FileUrlProviderTest.php b/src/Oro/Bundle/AttachmentBundle/Tests/Unit/Provider/FileUrlProviderTest.php index 5baf3186bca..f78e655783a 100644 --- a/src/Oro/Bundle/AttachmentBundle/Tests/Unit/Provider/FileUrlProviderTest.php +++ b/src/Oro/Bundle/AttachmentBundle/Tests/Unit/Provider/FileUrlProviderTest.php @@ -121,7 +121,7 @@ public function testGetFilteredImageUrl(): void ); } - private function getFile(int $id = null, string $filename = ''): File + private function getFile(?int $id = null, string $filename = ''): File { $file = $this->createMock(File::class); $file diff --git a/src/Oro/Bundle/BatchBundle/Tests/Unit/DependencyInjection/Compiler/PushBatchLogHandlerPassTest.php b/src/Oro/Bundle/BatchBundle/Tests/Unit/DependencyInjection/Compiler/PushBatchLogHandlerPassTest.php index f27a05c6b03..fcbae358767 100644 --- a/src/Oro/Bundle/BatchBundle/Tests/Unit/DependencyInjection/Compiler/PushBatchLogHandlerPassTest.php +++ b/src/Oro/Bundle/BatchBundle/Tests/Unit/DependencyInjection/Compiler/PushBatchLogHandlerPassTest.php @@ -45,7 +45,7 @@ public function testProcessWithoutBatchChannel(): void } private function getContainerBuilderMock( - Definition $logger = null + ?Definition $logger = null ): ContainerBuilder|\PHPUnit\Framework\MockObject\MockObject { $container = $this->createMock(ContainerBuilder::class); diff --git a/src/Oro/Bundle/BatchBundle/Tests/Unit/ORM/Query/QueryCountCalculatorTest.php b/src/Oro/Bundle/BatchBundle/Tests/Unit/ORM/Query/QueryCountCalculatorTest.php index ae8bfd94e44..bc5ea4117c6 100644 --- a/src/Oro/Bundle/BatchBundle/Tests/Unit/ORM/Query/QueryCountCalculatorTest.php +++ b/src/Oro/Bundle/BatchBundle/Tests/Unit/ORM/Query/QueryCountCalculatorTest.php @@ -51,7 +51,7 @@ protected function setUp(): void $this->em->getConfiguration()->setMetadataDriverImpl(new AttributeDriver([])); } - private function getQuery(string $dql, array $params = null): Query + private function getQuery(string $dql, ?array $params = null): Query { $query = new Query($this->em); $query->setDQL($dql); @@ -310,7 +310,7 @@ public function testCalculateCountWhenResultSetMappingIsAlreadyBuilt() /** * @dataProvider getSqlCountDataProvider */ - public function testCalculateCountForSqlQuery(string $sql, bool $useWalker = null) + public function testCalculateCountForSqlQuery(string $sql, ?bool $useWalker = null) { $qb = $this->createMock(SqlQueryBuilder::class); diff --git a/src/Oro/Bundle/BatchBundle/Tests/Unit/ORM/QueryBuilder/CountQueryBuilderOptimizerTest.php b/src/Oro/Bundle/BatchBundle/Tests/Unit/ORM/QueryBuilder/CountQueryBuilderOptimizerTest.php index fe7b1e7f3e0..5d4766ec0ab 100644 --- a/src/Oro/Bundle/BatchBundle/Tests/Unit/ORM/QueryBuilder/CountQueryBuilderOptimizerTest.php +++ b/src/Oro/Bundle/BatchBundle/Tests/Unit/ORM/QueryBuilder/CountQueryBuilderOptimizerTest.php @@ -65,7 +65,7 @@ protected function setUp(): void /** * @dataProvider getCountQueryBuilderDataProvider */ - public function testGetCountQueryBuilder(callable $queryBuilder, string $expectedDql, string $platformClass = null) + public function testGetCountQueryBuilder(callable $queryBuilder, string $expectedDql, ?string $platformClass = null) { if (null !== $platformClass) { $this->em->getConnection()->setDatabasePlatform(new $platformClass()); diff --git a/src/Oro/Bundle/BusinessEntitiesBundle/Entity/BaseCart.php b/src/Oro/Bundle/BusinessEntitiesBundle/Entity/BaseCart.php index ce3f8a377a6..aeb2a4b6b16 100644 --- a/src/Oro/Bundle/BusinessEntitiesBundle/Entity/BaseCart.php +++ b/src/Oro/Bundle/BusinessEntitiesBundle/Entity/BaseCart.php @@ -80,7 +80,7 @@ public function setGrandTotal($grandTotal) * @param \DateTime|null $createdAt * @return $this */ - public function setCreatedAt(\DateTime $createdAt = null) + public function setCreatedAt(?\DateTime $createdAt = null) { $this->createdAt = $createdAt; return $this; @@ -98,7 +98,7 @@ public function getCreatedAt() * @param \DateTime|null $updatedAt * @return $this */ - public function setUpdatedAt(\DateTime $updatedAt = null) + public function setUpdatedAt(?\DateTime $updatedAt = null) { $this->updatedAt = $updatedAt; return $this; diff --git a/src/Oro/Bundle/BusinessEntitiesBundle/Entity/BaseOrder.php b/src/Oro/Bundle/BusinessEntitiesBundle/Entity/BaseOrder.php index 906a863d080..5c6b37729eb 100644 --- a/src/Oro/Bundle/BusinessEntitiesBundle/Entity/BaseOrder.php +++ b/src/Oro/Bundle/BusinessEntitiesBundle/Entity/BaseOrder.php @@ -226,7 +226,7 @@ public function hasAddress(AbstractAddress $address) * * @return $this */ - public function setCreatedAt(\DateTime $createdAt = null) + public function setCreatedAt(?\DateTime $createdAt = null) { $this->createdAt = $createdAt; @@ -246,7 +246,7 @@ public function getCreatedAt() * * @return $this */ - public function setUpdatedAt(\DateTime $updatedAt = null) + public function setUpdatedAt(?\DateTime $updatedAt = null) { $this->updatedAt = $updatedAt; diff --git a/src/Oro/Bundle/BusinessEntitiesBundle/Entity/BasePerson.php b/src/Oro/Bundle/BusinessEntitiesBundle/Entity/BasePerson.php index 6417bc465a0..c690f43122c 100644 --- a/src/Oro/Bundle/BusinessEntitiesBundle/Entity/BasePerson.php +++ b/src/Oro/Bundle/BusinessEntitiesBundle/Entity/BasePerson.php @@ -220,7 +220,7 @@ public function getGender() * * @return $this */ - public function setBirthday(\DateTime $birthday = null) + public function setBirthday(?\DateTime $birthday = null) { $this->birthday = $birthday; diff --git a/src/Oro/Bundle/CommentBundle/Entity/BaseComment.php b/src/Oro/Bundle/CommentBundle/Entity/BaseComment.php index 9805cb54a6d..6a8ae6d31ed 100644 --- a/src/Oro/Bundle/CommentBundle/Entity/BaseComment.php +++ b/src/Oro/Bundle/CommentBundle/Entity/BaseComment.php @@ -141,7 +141,7 @@ public function getOrganization() * * @return self */ - public function setOrganization(Organization $organization = null) + public function setOrganization(?Organization $organization = null) { $this->organization = $organization; @@ -165,7 +165,7 @@ public function getCreatedAt() * * @return self */ - public function setCreatedAt(\DateTime $createdAt = null) + public function setCreatedAt(?\DateTime $createdAt = null) { $this->createdAt = $createdAt; @@ -189,7 +189,7 @@ public function getUpdatedAt() * * @return self */ - public function setUpdatedAt(\DateTime $updatedAt = null) + public function setUpdatedAt(?\DateTime $updatedAt = null) { $this->updatedAt = $updatedAt; diff --git a/src/Oro/Bundle/CommentBundle/Tests/Unit/EventListener/CommentLifecycleListenerTest.php b/src/Oro/Bundle/CommentBundle/Tests/Unit/EventListener/CommentLifecycleListenerTest.php index b7323a6657d..db6b9cf86d9 100644 --- a/src/Oro/Bundle/CommentBundle/Tests/Unit/EventListener/CommentLifecycleListenerTest.php +++ b/src/Oro/Bundle/CommentBundle/Tests/Unit/EventListener/CommentLifecycleListenerTest.php @@ -34,8 +34,8 @@ protected function setUp(): void public function testPreUpdate( object $entity, bool $mockUser = false, - bool $detachedUser = null, - bool $reloadUser = null + ?bool $detachedUser = null, + ?bool $reloadUser = null ) { $oldUser = new User(); $oldUser->setFirstName('oldUser'); @@ -102,7 +102,7 @@ public function prePersistAndPreUpdateDataProvider(): array /** * @return EntityManagerInterface|MockObject */ - private function getEntityManagerMock(bool $reloadUser = false, User $newUser = null) + private function getEntityManagerMock(bool $reloadUser = false, ?User $newUser = null) { $result = $this->createMock(EntityManagerInterface::class); diff --git a/src/Oro/Bundle/CronBundle/Entity/ScheduleIntervalInterface.php b/src/Oro/Bundle/CronBundle/Entity/ScheduleIntervalInterface.php index b562a5be376..b7bb0f607ad 100644 --- a/src/Oro/Bundle/CronBundle/Entity/ScheduleIntervalInterface.php +++ b/src/Oro/Bundle/CronBundle/Entity/ScheduleIntervalInterface.php @@ -16,7 +16,7 @@ public function getActiveAt(); * @param \DateTime|null $activeAt * @return $this */ - public function setActiveAt(\DateTime $activeAt = null); + public function setActiveAt(?\DateTime $activeAt = null); /** * @return \DateTime|null @@ -27,7 +27,7 @@ public function getDeactivateAt(); * @param \DateTime|null $deactivateAt * @return $this */ - public function setDeactivateAt(\DateTime $deactivateAt = null); + public function setDeactivateAt(?\DateTime $deactivateAt = null); /** * @return ScheduleIntervalsAwareInterface diff --git a/src/Oro/Bundle/CronBundle/Entity/ScheduleIntervalTrait.php b/src/Oro/Bundle/CronBundle/Entity/ScheduleIntervalTrait.php index 26334e4c06f..3db65fa9613 100644 --- a/src/Oro/Bundle/CronBundle/Entity/ScheduleIntervalTrait.php +++ b/src/Oro/Bundle/CronBundle/Entity/ScheduleIntervalTrait.php @@ -23,7 +23,7 @@ public function getActiveAt() * @param \DateTime|null $activeAt * @return $this */ - public function setActiveAt(\DateTime $activeAt = null) + public function setActiveAt(?\DateTime $activeAt = null) { $this->activeAt = $activeAt; @@ -42,7 +42,7 @@ public function getDeactivateAt() * @param \DateTime|null $deactivateAt * @return $this */ - public function setDeactivateAt(\DateTime $deactivateAt = null) + public function setDeactivateAt(?\DateTime $deactivateAt = null) { $this->deactivateAt = $deactivateAt; diff --git a/src/Oro/Bundle/CronBundle/Tests/Unit/Form/Type/ScheduleIntervalTypeTest.php b/src/Oro/Bundle/CronBundle/Tests/Unit/Form/Type/ScheduleIntervalTypeTest.php index 1d3d855877c..076fcd20fc0 100644 --- a/src/Oro/Bundle/CronBundle/Tests/Unit/Form/Type/ScheduleIntervalTypeTest.php +++ b/src/Oro/Bundle/CronBundle/Tests/Unit/Form/Type/ScheduleIntervalTypeTest.php @@ -25,7 +25,7 @@ protected function getExtensions(): array public function testSubmit( array $submittedData, ScheduleIntervalInterface $expected, - ScheduleIntervalInterface $data = null + ?ScheduleIntervalInterface $data = null ) { if (!$data) { $data = new ScheduleIntervalStub(); diff --git a/src/Oro/Bundle/CurrencyBundle/Tests/Unit/Api/Processor/UpdatePriceByValueAndCurrencyTest.php b/src/Oro/Bundle/CurrencyBundle/Tests/Unit/Api/Processor/UpdatePriceByValueAndCurrencyTest.php index 2fc1c85974e..1d5497c2ba0 100644 --- a/src/Oro/Bundle/CurrencyBundle/Tests/Unit/Api/Processor/UpdatePriceByValueAndCurrencyTest.php +++ b/src/Oro/Bundle/CurrencyBundle/Tests/Unit/Api/Processor/UpdatePriceByValueAndCurrencyTest.php @@ -25,7 +25,7 @@ protected function setUp(): void $this->processor = new UpdatePriceByValueAndCurrency(); } - private function getEntity(Price $price = null): PriceAwareEntityStub + private function getEntity(?Price $price = null): PriceAwareEntityStub { $entity = new PriceAwareEntityStub(); $entity->setPrice($price); diff --git a/src/Oro/Bundle/CurrencyBundle/Tests/Unit/Api/Stub/PriceAwareEntityStub.php b/src/Oro/Bundle/CurrencyBundle/Tests/Unit/Api/Stub/PriceAwareEntityStub.php index 311baedec9c..e041f6938b6 100644 --- a/src/Oro/Bundle/CurrencyBundle/Tests/Unit/Api/Stub/PriceAwareEntityStub.php +++ b/src/Oro/Bundle/CurrencyBundle/Tests/Unit/Api/Stub/PriceAwareEntityStub.php @@ -17,7 +17,7 @@ public function getPrice() return $this->price; } - public function setPrice(Price $price = null) + public function setPrice(?Price $price = null) { $this->price = $price; } diff --git a/src/Oro/Bundle/DashboardBundle/Helper/DateHelper.php b/src/Oro/Bundle/DashboardBundle/Helper/DateHelper.php index 3c9ad6e75c2..fe401971fdf 100644 --- a/src/Oro/Bundle/DashboardBundle/Helper/DateHelper.php +++ b/src/Oro/Bundle/DashboardBundle/Helper/DateHelper.php @@ -62,7 +62,7 @@ public function convertToCurrentPeriod( string $rowKey, string $dataKey, bool $isConvertEmptyData = false, - string $scaleType = null + ?string $scaleType = null ): array { if ($isConvertEmptyData === false && empty($data)) { return []; @@ -147,7 +147,7 @@ public function combinePreviousDataWithCurrentPeriod(\DateTime $from, \DateTime * * @return array */ - public function getDatePeriod(\DateTime $start, \DateTime $end, string $scaleType = null) + public function getDatePeriod(\DateTime $start, \DateTime $end, ?string $scaleType = null) { $start = clone $start; $end = clone $end; @@ -209,7 +209,7 @@ public function addDatePartsSelect( \DateTime $end, QueryBuilder $qb, string $entityField, - string $scaleType = null + ?string $scaleType = null ) { QueryBuilderUtil::checkField($entityField); $scaleType = $scaleType ?? $this->getFormatStrings($start, $end)['viewType']; @@ -299,7 +299,7 @@ public function addDatePartsSelect( * * @return string */ - public function getKey(\DateTime $start, \DateTime $end, array $row, string $scaleType = null) + public function getKey(\DateTime $start, \DateTime $end, array $row, ?string $scaleType = null) { $config = $scaleType ? $this->getDateIntervalConfigByScaleType($scaleType) diff --git a/src/Oro/Bundle/DataGridBundle/Entity/AbstractGridView.php b/src/Oro/Bundle/DataGridBundle/Entity/AbstractGridView.php index 0f026bf526d..0a4eae55c15 100644 --- a/src/Oro/Bundle/DataGridBundle/Entity/AbstractGridView.php +++ b/src/Oro/Bundle/DataGridBundle/Entity/AbstractGridView.php @@ -228,7 +228,7 @@ public function setGridName($gridName) * * @return $this */ - abstract public function setOwner(AbstractUser $owner = null); + abstract public function setOwner(?AbstractUser $owner = null); /** * @return View @@ -315,7 +315,7 @@ public static function getTypes() * * @return $this */ - public function setOrganization(OrganizationInterface $organization = null) + public function setOrganization(?OrganizationInterface $organization = null) { $this->organization = $organization; diff --git a/src/Oro/Bundle/DataGridBundle/Entity/GridView.php b/src/Oro/Bundle/DataGridBundle/Entity/GridView.php index d29aa84ce26..96969a4179d 100644 --- a/src/Oro/Bundle/DataGridBundle/Entity/GridView.php +++ b/src/Oro/Bundle/DataGridBundle/Entity/GridView.php @@ -51,7 +51,7 @@ public function getOwner() } #[\Override] - public function setOwner(AbstractUser $owner = null) + public function setOwner(?AbstractUser $owner = null) { $this->owner = $owner; diff --git a/src/Oro/Bundle/DataGridBundle/Provider/SystemAwareResolver.php b/src/Oro/Bundle/DataGridBundle/Provider/SystemAwareResolver.php index 5cb25559c37..b474910c151 100644 --- a/src/Oro/Bundle/DataGridBundle/Provider/SystemAwareResolver.php +++ b/src/Oro/Bundle/DataGridBundle/Provider/SystemAwareResolver.php @@ -122,7 +122,7 @@ protected function resolveSystemCall($datagridName, $key, $val) * @api */ #[\Override] - public function setContainer(ContainerInterface $container = null) + public function setContainer(?ContainerInterface $container = null) { $this->container = $container; } diff --git a/src/Oro/Bundle/DataGridBundle/Tests/Unit/Datagrid/Common/DatagridConfigurationTest.php b/src/Oro/Bundle/DataGridBundle/Tests/Unit/Datagrid/Common/DatagridConfigurationTest.php index 420f7817bcc..4c32bacd181 100644 --- a/src/Oro/Bundle/DataGridBundle/Tests/Unit/Datagrid/Common/DatagridConfigurationTest.php +++ b/src/Oro/Bundle/DataGridBundle/Tests/Unit/Datagrid/Common/DatagridConfigurationTest.php @@ -143,7 +143,7 @@ public function testAddColumn( array $expected, string $name, array $definition, - string $select = null, + ?string $select = null, array $sorter = [], array $filter = [] ): void { diff --git a/src/Oro/Bundle/DataGridBundle/Tests/Unit/EventListener/DatasourceBindParametersListenerTest.php b/src/Oro/Bundle/DataGridBundle/Tests/Unit/EventListener/DatasourceBindParametersListenerTest.php index 221e3dcdb2a..1c73e2c3faa 100644 --- a/src/Oro/Bundle/DataGridBundle/Tests/Unit/EventListener/DatasourceBindParametersListenerTest.php +++ b/src/Oro/Bundle/DataGridBundle/Tests/Unit/EventListener/DatasourceBindParametersListenerTest.php @@ -36,7 +36,7 @@ protected function setUp(): void /** * @dataProvider onBuildAfterDataProvider */ - public function testOnBuildAfterWorks(array $config, array $expectedBindParameters = null) + public function testOnBuildAfterWorks(array $config, ?array $expectedBindParameters = null) { $config = DatagridConfiguration::create($config); diff --git a/src/Oro/Bundle/DataGridBundle/Tests/Unit/Extension/Action/ActionExtensionTest.php b/src/Oro/Bundle/DataGridBundle/Tests/Unit/Extension/Action/ActionExtensionTest.php index 659ff9853fd..1a958947653 100644 --- a/src/Oro/Bundle/DataGridBundle/Tests/Unit/Extension/Action/ActionExtensionTest.php +++ b/src/Oro/Bundle/DataGridBundle/Tests/Unit/Extension/Action/ActionExtensionTest.php @@ -568,7 +568,7 @@ public function testVisitResultWithOwnershipFieldsForActionWithAclResourceAndAcc $this->authorizationChecker->expects(self::once()) ->method('isGranted') - ->willReturnCallback(function ($resource, DomainObjectReference $object = null) { + ->willReturnCallback(function ($resource, ?DomainObjectReference $object = null) { self::assertEquals('update_acl_resource', $resource); self::assertInstanceOf(DomainObjectReference::class, $object); self::assertSame('Test\Entity', $object->getType()); @@ -641,7 +641,7 @@ public function testVisitResultWithOwnershipFieldsForActionWithAclResourceAndAcc $this->authorizationChecker->expects(self::once()) ->method('isGranted') - ->willReturnCallback(function ($resource, DomainObjectReference $object = null) { + ->willReturnCallback(function ($resource, ?DomainObjectReference $object = null) { self::assertEquals('update_acl_resource', $resource); self::assertInstanceOf(DomainObjectReference::class, $object); self::assertSame('Test\Entity', $object->getType()); @@ -674,7 +674,7 @@ public function testVisitResultWithOwnershipFieldsForActionWithAclResourceAndRec $this->authorizationChecker->expects(self::once()) ->method('isGranted') - ->willReturnCallback(function ($resource, DomainObjectReference $object = null) { + ->willReturnCallback(function ($resource, ?DomainObjectReference $object = null) { self::assertEquals('update_acl_resource', $resource); self::assertNull($object); diff --git a/src/Oro/Bundle/DataGridBundle/Tests/Unit/Extension/GridViews/GridViewsExtensionTest.php b/src/Oro/Bundle/DataGridBundle/Tests/Unit/Extension/GridViews/GridViewsExtensionTest.php index 7a707f9e2b0..28120273c06 100644 --- a/src/Oro/Bundle/DataGridBundle/Tests/Unit/Extension/GridViews/GridViewsExtensionTest.php +++ b/src/Oro/Bundle/DataGridBundle/Tests/Unit/Extension/GridViews/GridViewsExtensionTest.php @@ -150,7 +150,7 @@ public function testVisitMetadataForCachedDefaultView() $this->assertGridStateView($grid2, self::GRID_VIEW_ID_2); } - private function assertGridStateView(string $grid, string $expectedGridView = null): void + private function assertGridStateView(string $grid, ?string $expectedGridView = null): void { $data = MetadataObject::create([]); $config = DatagridConfiguration::create([DatagridConfiguration::NAME_KEY => $grid]); diff --git a/src/Oro/Bundle/DataGridBundle/Tests/Unit/Extension/MassAction/MassActionDispatcherTest.php b/src/Oro/Bundle/DataGridBundle/Tests/Unit/Extension/MassAction/MassActionDispatcherTest.php index d44e0d04453..3dd7c25bc2e 100644 --- a/src/Oro/Bundle/DataGridBundle/Tests/Unit/Extension/MassAction/MassActionDispatcherTest.php +++ b/src/Oro/Bundle/DataGridBundle/Tests/Unit/Extension/MassAction/MassActionDispatcherTest.php @@ -115,8 +115,8 @@ public function testDispatchByRequestWhenNoMassActionExtensionAppliedForGrid() } private function createDatagrid( - DatasourceInterface $datasource = null, - DatagridConfiguration $gridConfig = null + ?DatasourceInterface $datasource = null, + ?DatagridConfiguration $gridConfig = null ): DatagridInterface { $gridParameters = $this->createMock(ParameterBag::class); $gridParameters->expects($this->once()) @@ -144,7 +144,7 @@ private function createDatagrid( return $datagrid; } - private function createMassAction(ActionConfiguration $actionConfiguration = null): MassActionInterface + private function createMassAction(?ActionConfiguration $actionConfiguration = null): MassActionInterface { $massAction = $this->createMock(MassActionInterface::class); $massAction->expects($this->any()) diff --git a/src/Oro/Bundle/DistributionBundle/Routing/AbstractLoader.php b/src/Oro/Bundle/DistributionBundle/Routing/AbstractLoader.php index 5a71732f8f5..6ca406b0b39 100644 --- a/src/Oro/Bundle/DistributionBundle/Routing/AbstractLoader.php +++ b/src/Oro/Bundle/DistributionBundle/Routing/AbstractLoader.php @@ -21,7 +21,7 @@ abstract class AbstractLoader extends CumulativeRoutingFileLoader /** * Sets the event dispatcher */ - public function setEventDispatcher(EventDispatcherInterface $eventDispatcher = null) + public function setEventDispatcher(?EventDispatcherInterface $eventDispatcher = null) { $this->eventDispatcher = $eventDispatcher; } @@ -29,7 +29,7 @@ public function setEventDispatcher(EventDispatcherInterface $eventDispatcher = n /** * Sets an object that can be used to share data between different loaders */ - public function setCache(SharedData $cache = null) + public function setCache(?SharedData $cache = null) { $this->cache = $cache; } diff --git a/src/Oro/Bundle/DraftBundle/Tests/Unit/EventListener/DraftableFilterListenerTest.php b/src/Oro/Bundle/DraftBundle/Tests/Unit/EventListener/DraftableFilterListenerTest.php index d81ed04f9f3..9211a6d6eb5 100644 --- a/src/Oro/Bundle/DraftBundle/Tests/Unit/EventListener/DraftableFilterListenerTest.php +++ b/src/Oro/Bundle/DraftBundle/Tests/Unit/EventListener/DraftableFilterListenerTest.php @@ -245,7 +245,7 @@ private function getFilters(): FilterCollection|\PHPUnit\Framework\MockObject\Mo private function mockEntityManager( int $id, FilterCollection|\PHPUnit\Framework\MockObject\MockObject $filters, - DraftableInterface $expectedEntity = null + ?DraftableInterface $expectedEntity = null ): void { $repository = $this->createMock(EntityRepository::class); $repository->expects(self::once()) diff --git a/src/Oro/Bundle/DraftBundle/Tests/Unit/Voter/AclVoterTest.php b/src/Oro/Bundle/DraftBundle/Tests/Unit/Voter/AclVoterTest.php index 46736e8de77..b0402a92ef6 100644 --- a/src/Oro/Bundle/DraftBundle/Tests/Unit/Voter/AclVoterTest.php +++ b/src/Oro/Bundle/DraftBundle/Tests/Unit/Voter/AclVoterTest.php @@ -14,7 +14,7 @@ class AclVoterTest extends \PHPUnit\Framework\TestCase /** * @dataProvider voteDataProvider */ - public function testVote(array $expected, string $sourceUuid = null): void + public function testVote(array $expected, ?string $sourceUuid = null): void { $source = new DraftableEntityStub(); $source->setDraftUuid($sourceUuid); diff --git a/src/Oro/Bundle/EmailBundle/Entity/EmailAddress.php b/src/Oro/Bundle/EmailBundle/Entity/EmailAddress.php index 9d5b98119dd..6c80fca7367 100644 --- a/src/Oro/Bundle/EmailBundle/Entity/EmailAddress.php +++ b/src/Oro/Bundle/EmailBundle/Entity/EmailAddress.php @@ -165,7 +165,7 @@ abstract public function getOwner(); * @param EmailOwnerInterface|null $owner * @return EmailAddress */ - abstract public function setOwner(EmailOwnerInterface $owner = null); + abstract public function setOwner(?EmailOwnerInterface $owner = null); /** * Get a human-readable representation of this object. diff --git a/src/Oro/Bundle/EmailBundle/Entity/EmailAttachment.php b/src/Oro/Bundle/EmailBundle/Entity/EmailAttachment.php index 10d20ba4747..4d536e12460 100644 --- a/src/Oro/Bundle/EmailBundle/Entity/EmailAttachment.php +++ b/src/Oro/Bundle/EmailBundle/Entity/EmailAttachment.php @@ -167,7 +167,7 @@ public function getFile() * * @return $this */ - public function setFile(File $file = null) + public function setFile(?File $file = null) { $this->file = $file; diff --git a/src/Oro/Bundle/EmailBundle/Entity/EmailOrigin.php b/src/Oro/Bundle/EmailBundle/Entity/EmailOrigin.php index 6181ca8a2bd..ddd1c6b60d7 100644 --- a/src/Oro/Bundle/EmailBundle/Entity/EmailOrigin.php +++ b/src/Oro/Bundle/EmailBundle/Entity/EmailOrigin.php @@ -287,7 +287,7 @@ public function getOrganization() * * @return $this */ - public function setOrganization(OrganizationInterface $organization = null) + public function setOrganization(?OrganizationInterface $organization = null) { $this->organization = $organization; @@ -349,7 +349,7 @@ public function getMailbox() * * @return $this */ - public function setMailbox(Mailbox $mailbox = null) + public function setMailbox(?Mailbox $mailbox = null) { $this->mailbox = $mailbox; diff --git a/src/Oro/Bundle/EmailBundle/Entity/EmailTemplate.php b/src/Oro/Bundle/EmailBundle/Entity/EmailTemplate.php index 47dd8395bcb..4d6376937be 100644 --- a/src/Oro/Bundle/EmailBundle/Entity/EmailTemplate.php +++ b/src/Oro/Bundle/EmailBundle/Entity/EmailTemplate.php @@ -283,7 +283,7 @@ public function removeTranslation(EmailTemplateTranslation $translation): self * * @return EmailTemplate */ - public function setOrganization(Organization $organization = null) + public function setOrganization(?Organization $organization = null) { $this->organization = $organization; diff --git a/src/Oro/Bundle/EmailBundle/Entity/EmailUser.php b/src/Oro/Bundle/EmailBundle/Entity/EmailUser.php index a6d23a01ce2..4480b26fed1 100644 --- a/src/Oro/Bundle/EmailBundle/Entity/EmailUser.php +++ b/src/Oro/Bundle/EmailBundle/Entity/EmailUser.php @@ -164,7 +164,7 @@ public function getOrganization() * @param OrganizationInterface|null $organization * @return $this */ - public function setOrganization(OrganizationInterface $organization = null) + public function setOrganization(?OrganizationInterface $organization = null) { $this->organization = $organization; @@ -289,7 +289,7 @@ public function getMailboxOwner() * * @return $this */ - public function setMailboxOwner(Mailbox $mailboxOwner = null) + public function setMailboxOwner(?Mailbox $mailboxOwner = null) { $this->mailboxOwner = $mailboxOwner; diff --git a/src/Oro/Bundle/EmailBundle/Model/EmailRecipientsProviderArgs.php b/src/Oro/Bundle/EmailBundle/Model/EmailRecipientsProviderArgs.php index b5e9ab9ec8f..01321ab4a6b 100644 --- a/src/Oro/Bundle/EmailBundle/Model/EmailRecipientsProviderArgs.php +++ b/src/Oro/Bundle/EmailBundle/Model/EmailRecipientsProviderArgs.php @@ -33,7 +33,7 @@ public function __construct( $query, $limit, array $excludedRecipients = [], - Organization $organization = null + ?Organization $organization = null ) { $this->relatedEntity = $relatedEntity; $this->query = $query; diff --git a/src/Oro/Bundle/EmailBundle/Model/Recipient.php b/src/Oro/Bundle/EmailBundle/Model/Recipient.php index b1036f967d7..b4bc0ce5162 100644 --- a/src/Oro/Bundle/EmailBundle/Model/Recipient.php +++ b/src/Oro/Bundle/EmailBundle/Model/Recipient.php @@ -21,7 +21,7 @@ class Recipient implements EmailHolderInterface * @param string $name * @param RecipientEntity|null $entity */ - public function __construct($email, $name = '', RecipientEntity $entity = null) + public function __construct($email, $name = '', ?RecipientEntity $entity = null) { $this->email = $email; $this->name = trim($name); diff --git a/src/Oro/Bundle/EmailBundle/Sync/AbstractEmailSynchronizer.php b/src/Oro/Bundle/EmailBundle/Sync/AbstractEmailSynchronizer.php index a8b5575e8d1..3d163c8cd91 100644 --- a/src/Oro/Bundle/EmailBundle/Sync/AbstractEmailSynchronizer.php +++ b/src/Oro/Bundle/EmailBundle/Sync/AbstractEmailSynchronizer.php @@ -145,7 +145,7 @@ public function sync( } #[\Override] - public function syncOrigins(array $originIds, SynchronizationProcessorSettings $settings = null): void + public function syncOrigins(array $originIds, ?SynchronizationProcessorSettings $settings = null): void { if ($this->logger === null) { $this->logger = new NullLogger(); @@ -212,7 +212,7 @@ protected function checkConfiguration(): bool * * @throws \Exception */ - protected function doSyncOrigin(EmailOrigin $origin, SynchronizationProcessorSettings $settings = null): void + protected function doSyncOrigin(EmailOrigin $origin, ?SynchronizationProcessorSettings $settings = null): void { $this->impersonateOrganization($origin->getOrganization()); try { @@ -260,7 +260,7 @@ protected function doSyncOrigin(EmailOrigin $origin, SynchronizationProcessorSet protected function delegateToProcessor( EmailOrigin $origin, AbstractEmailSynchronizationProcessor $processor, - SynchronizationProcessorSettings $settings = null + ?SynchronizationProcessorSettings $settings = null ): void { $inProcessCode = $settings && $settings->isForceMode() ? self::SYNC_CODE_IN_PROCESS_FORCE : self::SYNC_CODE_IN_PROCESS; @@ -280,7 +280,7 @@ protected function delegateToProcessor( * Switches the security context to the given organization * Should be deleted after email sync process will be refactored */ - protected function impersonateOrganization(Organization $organization = null): void + protected function impersonateOrganization(?Organization $organization = null): void { if ($this->tokenStorage->getToken() === null && $organization) { $this->tokenStorage->setToken( diff --git a/src/Oro/Bundle/EmailBundle/Sync/EmailSynchronizerInterface.php b/src/Oro/Bundle/EmailBundle/Sync/EmailSynchronizerInterface.php index a8246244988..93528b74775 100644 --- a/src/Oro/Bundle/EmailBundle/Sync/EmailSynchronizerInterface.php +++ b/src/Oro/Bundle/EmailBundle/Sync/EmailSynchronizerInterface.php @@ -51,7 +51,7 @@ public function sync( * * @throws \Exception */ - public function syncOrigins(array $originIds, SynchronizationProcessorSettings $settings = null): void; + public function syncOrigins(array $originIds, ?SynchronizationProcessorSettings $settings = null): void; /** * Schedule origins sync job diff --git a/src/Oro/Bundle/EmailBundle/Tests/Unit/Async/RecalculateEmailVisibilityProcessorTest.php b/src/Oro/Bundle/EmailBundle/Tests/Unit/Async/RecalculateEmailVisibilityProcessorTest.php index c933febd6fb..f4e31561ffa 100644 --- a/src/Oro/Bundle/EmailBundle/Tests/Unit/Async/RecalculateEmailVisibilityProcessorTest.php +++ b/src/Oro/Bundle/EmailBundle/Tests/Unit/Async/RecalculateEmailVisibilityProcessorTest.php @@ -102,7 +102,7 @@ private function addCountQueryExpectation(string $email, int $count): void ); } - private function addDataQueryExpectation(string $email, array $data, int $offset = null): void + private function addDataQueryExpectation(string $email, array $data, ?int $offset = null): void { $sql = 'SELECT DISTINCT o0_.id AS id_0' . ' FROM oro_email_user o0_' @@ -140,7 +140,7 @@ private function addCountQueryExpectationForArray(array $emails, int $count): vo ); } - private function addDataQueryExpectationForArray(array $emails, array $data, int $offset = null): void + private function addDataQueryExpectationForArray(array $emails, array $data, ?int $offset = null): void { $sql = 'SELECT DISTINCT o0_.id AS id_0' . ' FROM oro_email_user o0_' diff --git a/src/Oro/Bundle/EmailBundle/Tests/Unit/Async/UpdateEmailVisibilitiesForOrganizationProcessorTest.php b/src/Oro/Bundle/EmailBundle/Tests/Unit/Async/UpdateEmailVisibilitiesForOrganizationProcessorTest.php index 34534495e47..06ec6158ff5 100644 --- a/src/Oro/Bundle/EmailBundle/Tests/Unit/Async/UpdateEmailVisibilitiesForOrganizationProcessorTest.php +++ b/src/Oro/Bundle/EmailBundle/Tests/Unit/Async/UpdateEmailVisibilitiesForOrganizationProcessorTest.php @@ -98,7 +98,7 @@ private function addCountQueryExpectation(int $organizationId, int $count): void ); } - private function addDataQueryExpectation(int $organizationId, array $data, int $offset = null): void + private function addDataQueryExpectation(int $organizationId, array $data, ?int $offset = null): void { $sql = 'SELECT o0_.id AS id_0' . ' FROM oro_email o0_' diff --git a/src/Oro/Bundle/EmailBundle/Tests/Unit/Entity/Manager/EmailActivityManagerTest.php b/src/Oro/Bundle/EmailBundle/Tests/Unit/Entity/Manager/EmailActivityManagerTest.php index ce029952c26..4ce693e7845 100644 --- a/src/Oro/Bundle/EmailBundle/Tests/Unit/Entity/Manager/EmailActivityManagerTest.php +++ b/src/Oro/Bundle/EmailBundle/Tests/Unit/Entity/Manager/EmailActivityManagerTest.php @@ -79,7 +79,7 @@ protected function setUp(): void ); } - private function getEmail(int $id = null, int $threadId = null): Email + private function getEmail(?int $id = null, ?int $threadId = null): Email { $email = new Email(); if (null !== $id) { diff --git a/src/Oro/Bundle/EmailBundle/Tests/Unit/Entity/TestFixtures/EmailAddress.php b/src/Oro/Bundle/EmailBundle/Tests/Unit/Entity/TestFixtures/EmailAddress.php index 5e966a5bb3a..eb7d5411c00 100644 --- a/src/Oro/Bundle/EmailBundle/Tests/Unit/Entity/TestFixtures/EmailAddress.php +++ b/src/Oro/Bundle/EmailBundle/Tests/Unit/Entity/TestFixtures/EmailAddress.php @@ -27,7 +27,7 @@ public function getOwner() } #[\Override] - public function setOwner(EmailOwnerInterface $owner = null) + public function setOwner(?EmailOwnerInterface $owner = null) { $this->owner = $owner; diff --git a/src/Oro/Bundle/EmailBundle/Tests/Unit/Fixtures/Entity/EmailAddress.php b/src/Oro/Bundle/EmailBundle/Tests/Unit/Fixtures/Entity/EmailAddress.php index 6f3655f55da..e661588e0a7 100644 --- a/src/Oro/Bundle/EmailBundle/Tests/Unit/Fixtures/Entity/EmailAddress.php +++ b/src/Oro/Bundle/EmailBundle/Tests/Unit/Fixtures/Entity/EmailAddress.php @@ -25,7 +25,7 @@ public function getOwner() * @return $this */ #[\Override] - public function setOwner(EmailOwnerInterface $owner = null) + public function setOwner(?EmailOwnerInterface $owner = null) { $this->owner = $owner; $this->setHasOwner($owner !== null); diff --git a/src/Oro/Bundle/EmailBundle/Tests/Unit/Mailer/Checker/SmtpSettingsCheckerTest.php b/src/Oro/Bundle/EmailBundle/Tests/Unit/Mailer/Checker/SmtpSettingsCheckerTest.php index 5136cf195e0..b0a3c46465f 100644 --- a/src/Oro/Bundle/EmailBundle/Tests/Unit/Mailer/Checker/SmtpSettingsCheckerTest.php +++ b/src/Oro/Bundle/EmailBundle/Tests/Unit/Mailer/Checker/SmtpSettingsCheckerTest.php @@ -73,7 +73,7 @@ public function testCheckConnectionWithError(): void $this->connectionChecker->expects(self::once()) ->method('checkConnection') ->with($dsn) - ->willReturnCallback(static function (Dsn $dsn, string &$error = null) { + ->willReturnCallback(static function (Dsn $dsn, ?string &$error = null) { $error = 'Test exception message'; return false; diff --git a/src/Oro/Bundle/EmailBundle/Tests/Unit/Provider/TranslatedEmailTemplateProviderTest.php b/src/Oro/Bundle/EmailBundle/Tests/Unit/Provider/TranslatedEmailTemplateProviderTest.php index 0bddabaf985..b8c4c202a9c 100644 --- a/src/Oro/Bundle/EmailBundle/Tests/Unit/Provider/TranslatedEmailTemplateProviderTest.php +++ b/src/Oro/Bundle/EmailBundle/Tests/Unit/Provider/TranslatedEmailTemplateProviderTest.php @@ -187,7 +187,7 @@ public function testGetTranslatedEmailTemplateWhenTwoTranslationsAndRecursiveLoc ); } - private function createLocalization(int $id, Localization $parentLocalization = null): Localization + private function createLocalization(int $id, ?Localization $parentLocalization = null): Localization { $localization = new LocalizationStub($id); if ($parentLocalization !== null) { diff --git a/src/Oro/Bundle/EmailBundle/Tests/Unit/Sender/EmailFactoryTest.php b/src/Oro/Bundle/EmailBundle/Tests/Unit/Sender/EmailFactoryTest.php index 552c9bc07c0..af60fbc05e3 100644 --- a/src/Oro/Bundle/EmailBundle/Tests/Unit/Sender/EmailFactoryTest.php +++ b/src/Oro/Bundle/EmailBundle/Tests/Unit/Sender/EmailFactoryTest.php @@ -184,7 +184,7 @@ public function testCreateFromEmailModelWhenAttachments(): void self::assertContainsEquals($inlineAttachment, $attachments); } - private function createEmailAttachmentModel(string $embeddedContentId = null): EmailAttachmentModel + private function createEmailAttachmentModel(?string $embeddedContentId = null): EmailAttachmentModel { $emailAttachmentContent = (new EmailAttachmentContent()) ->setContent(base64_encode('sample_content')) diff --git a/src/Oro/Bundle/EmailBundle/Tests/Unit/Stub/AddressStub.php b/src/Oro/Bundle/EmailBundle/Tests/Unit/Stub/AddressStub.php index 61aad6e24df..4c28bfc0606 100644 --- a/src/Oro/Bundle/EmailBundle/Tests/Unit/Stub/AddressStub.php +++ b/src/Oro/Bundle/EmailBundle/Tests/Unit/Stub/AddressStub.php @@ -12,7 +12,7 @@ class AddressStub implements NameInterface /** @var string */ private $organization; - public function __construct(string $name = '', string $organization = null) + public function __construct(string $name = '', ?string $organization = null) { $this->name = $name; $this->organization = $organization; diff --git a/src/Oro/Bundle/EmailBundle/Tests/Unit/Stub/CustomerStub.php b/src/Oro/Bundle/EmailBundle/Tests/Unit/Stub/CustomerStub.php index ba47fc61b0c..de23870082d 100644 --- a/src/Oro/Bundle/EmailBundle/Tests/Unit/Stub/CustomerStub.php +++ b/src/Oro/Bundle/EmailBundle/Tests/Unit/Stub/CustomerStub.php @@ -17,7 +17,7 @@ class CustomerStub implements NameInterface * @param string $name * @param Organization|null $organization */ - public function __construct($name = '', Organization $organization = null) + public function __construct($name = '', ?Organization $organization = null) { $this->name = $name; $this->organization = $organization; diff --git a/src/Oro/Bundle/EntityBundle/EntityProperty/CreatedAtAwareInterface.php b/src/Oro/Bundle/EntityBundle/EntityProperty/CreatedAtAwareInterface.php index 618b08af951..4ffa959c51a 100644 --- a/src/Oro/Bundle/EntityBundle/EntityProperty/CreatedAtAwareInterface.php +++ b/src/Oro/Bundle/EntityBundle/EntityProperty/CreatedAtAwareInterface.php @@ -13,5 +13,5 @@ public function getCreatedAt(); * @param \DateTime|null $createdAt * @return mixed */ - public function setCreatedAt(\DateTime $createdAt = null); + public function setCreatedAt(?\DateTime $createdAt = null); } diff --git a/src/Oro/Bundle/EntityBundle/EntityProperty/CreatedAtAwareTrait.php b/src/Oro/Bundle/EntityBundle/EntityProperty/CreatedAtAwareTrait.php index 300f2c8d0d3..dcef9499ad0 100644 --- a/src/Oro/Bundle/EntityBundle/EntityProperty/CreatedAtAwareTrait.php +++ b/src/Oro/Bundle/EntityBundle/EntityProperty/CreatedAtAwareTrait.php @@ -27,7 +27,7 @@ public function getCreatedAt() * @param \DateTime|null $createdAt * @return $this */ - public function setCreatedAt(\DateTime $createdAt = null) + public function setCreatedAt(?\DateTime $createdAt = null) { $this->createdAt = $createdAt; diff --git a/src/Oro/Bundle/EntityBundle/EntityProperty/UpdatedAtAwareInterface.php b/src/Oro/Bundle/EntityBundle/EntityProperty/UpdatedAtAwareInterface.php index e39bc721394..7a6b519068b 100644 --- a/src/Oro/Bundle/EntityBundle/EntityProperty/UpdatedAtAwareInterface.php +++ b/src/Oro/Bundle/EntityBundle/EntityProperty/UpdatedAtAwareInterface.php @@ -13,7 +13,7 @@ public function getUpdatedAt(); * @param \DateTime|null $updatedAt * @return mixed */ - public function setUpdatedAt(\DateTime $updatedAt = null); + public function setUpdatedAt(?\DateTime $updatedAt = null); /** * @return bool diff --git a/src/Oro/Bundle/EntityBundle/EntityProperty/UpdatedAtAwareTrait.php b/src/Oro/Bundle/EntityBundle/EntityProperty/UpdatedAtAwareTrait.php index 33420a5d127..11b0f1ac1dd 100644 --- a/src/Oro/Bundle/EntityBundle/EntityProperty/UpdatedAtAwareTrait.php +++ b/src/Oro/Bundle/EntityBundle/EntityProperty/UpdatedAtAwareTrait.php @@ -33,7 +33,7 @@ public function getUpdatedAt() * * @return $this */ - public function setUpdatedAt(\DateTime $updatedAt = null) + public function setUpdatedAt(?\DateTime $updatedAt = null) { $this->updatedAtSet = false; if ($updatedAt !== null) { diff --git a/src/Oro/Bundle/EntityBundle/EntityProperty/UpdatedByAwareInterface.php b/src/Oro/Bundle/EntityBundle/EntityProperty/UpdatedByAwareInterface.php index 06186b0f0a3..c689845227a 100644 --- a/src/Oro/Bundle/EntityBundle/EntityProperty/UpdatedByAwareInterface.php +++ b/src/Oro/Bundle/EntityBundle/EntityProperty/UpdatedByAwareInterface.php @@ -15,7 +15,7 @@ public function getUpdatedBy(); * @param User|null $updatedBy * @return mixed */ - public function setUpdatedBy(User $updatedBy = null); + public function setUpdatedBy(?User $updatedBy = null); /** * @return bool diff --git a/src/Oro/Bundle/EntityBundle/Helper/FieldHelper.php b/src/Oro/Bundle/EntityBundle/Helper/FieldHelper.php index afb88b6ac2d..6fea0963c48 100644 --- a/src/Oro/Bundle/EntityBundle/Helper/FieldHelper.php +++ b/src/Oro/Bundle/EntityBundle/Helper/FieldHelper.php @@ -234,7 +234,7 @@ public function getObjectValue($object, $fieldName) } } - public function getObjectValueWithReflection($object, string $fieldName, \Throwable $exception = null) + public function getObjectValueWithReflection($object, string $fieldName, ?\Throwable $exception = null) { $class = ClassUtils::getClass($object); while ($class && !EntityPropertyInfo::propertyExists($class, $fieldName) && $class = get_parent_class($class)) { diff --git a/src/Oro/Bundle/EntityConfigBundle/Config/Config.php b/src/Oro/Bundle/EntityConfigBundle/Config/Config.php index ba24dda43de..400b30275b6 100644 --- a/src/Oro/Bundle/EntityConfigBundle/Config/Config.php +++ b/src/Oro/Bundle/EntityConfigBundle/Config/Config.php @@ -87,7 +87,7 @@ public function in($code, array $values, $strict = false) } #[\Override] - public function all(\Closure $filter = null) + public function all(?\Closure $filter = null) { if (null === $filter) { return $this->values; diff --git a/src/Oro/Bundle/EntityConfigBundle/Config/ConfigInterface.php b/src/Oro/Bundle/EntityConfigBundle/Config/ConfigInterface.php index 2f8d6cb9748..0ecc3c0a7c3 100644 --- a/src/Oro/Bundle/EntityConfigBundle/Config/ConfigInterface.php +++ b/src/Oro/Bundle/EntityConfigBundle/Config/ConfigInterface.php @@ -82,7 +82,7 @@ public function in($code, array $values, $strict = false); * @param \Closure|null $filter The callback function to be used to filter attributes * @return array */ - public function all(\Closure $filter = null); + public function all(?\Closure $filter = null); /** * Returns all configuration attributes. diff --git a/src/Oro/Bundle/EntityConfigBundle/Entity/EntityConfigModel.php b/src/Oro/Bundle/EntityConfigBundle/Entity/EntityConfigModel.php index acd2d9e7fec..67e6aaa0b95 100644 --- a/src/Oro/Bundle/EntityConfigBundle/Entity/EntityConfigModel.php +++ b/src/Oro/Bundle/EntityConfigBundle/Entity/EntityConfigModel.php @@ -111,7 +111,7 @@ public function addField($field) * @param \Closure|null $filter function (FieldConfigModel $model) * @return ArrayCollection|FieldConfigModel[] */ - public function getFields(\Closure $filter = null) + public function getFields(?\Closure $filter = null) { return $filter ? $this->fields->filter($filter) : $this->fields; } diff --git a/src/Oro/Bundle/EntityConfigBundle/ImportExport/Serializer/EntityFieldNormalizer.php b/src/Oro/Bundle/EntityConfigBundle/ImportExport/Serializer/EntityFieldNormalizer.php index 5d329b64bf3..12848df7a54 100644 --- a/src/Oro/Bundle/EntityConfigBundle/ImportExport/Serializer/EntityFieldNormalizer.php +++ b/src/Oro/Bundle/EntityConfigBundle/ImportExport/Serializer/EntityFieldNormalizer.php @@ -44,13 +44,13 @@ public function __construct( } #[\Override] - public function supportsNormalization($data, string $format = null, array $context = []): bool + public function supportsNormalization($data, ?string $format = null, array $context = []): bool { return $data instanceof FieldConfigModel; } #[\Override] - public function normalize($object, string $format = null, array $context = []) + public function normalize($object, ?string $format = null, array $context = []) { $result = [ 'id' => $object->getId(), @@ -70,13 +70,13 @@ public function normalize($object, string $format = null, array $context = []) } #[\Override] - public function supportsDenormalization($data, string $type, string $format = null, array $context = []): bool + public function supportsDenormalization($data, string $type, ?string $format = null, array $context = []): bool { return is_array($data) && is_a($type, FieldConfigModel::class, true); } #[\Override] - public function denormalize($data, string $type, string $format = null, array $context = []) + public function denormalize($data, string $type, ?string $format = null, array $context = []) { if (!isset($data['entity']['id'])) { throw new UnexpectedValueException('Data doesn\'t contains entity id'); diff --git a/src/Oro/Bundle/EntityConfigBundle/Provider/ConfigProvider.php b/src/Oro/Bundle/EntityConfigBundle/Provider/ConfigProvider.php index c518b7fe238..c7472f3fd75 100644 --- a/src/Oro/Bundle/EntityConfigBundle/Provider/ConfigProvider.php +++ b/src/Oro/Bundle/EntityConfigBundle/Provider/ConfigProvider.php @@ -55,9 +55,9 @@ public function getConfigManager(): ConfigManager * Gets an instance of FieldConfigId or EntityConfigId depends on the given parameters. */ public function getId( - string $className = null, - string $fieldName = null, - string $fieldType = null + ?string $className = null, + ?string $fieldName = null, + ?string $fieldType = null ): ConfigIdInterface { if ($className) { $className = ClassUtils::getRealClass($className); @@ -77,7 +77,7 @@ public function getId( /** * Determines if this provider has configuration data for the given entity or field. */ - public function hasConfig(string $className, string $fieldName = null): bool + public function hasConfig(string $className, ?string $fieldName = null): bool { return $this->configManager->hasConfig(ClassUtils::getRealClass($className), $fieldName); } @@ -97,7 +97,7 @@ public function hasConfigById(ConfigIdInterface $configId): bool /** * Gets configuration data for the given entity or field. */ - public function getConfig(string $className = null, string $fieldName = null): ConfigInterface + public function getConfig(?string $className = null, ?string $fieldName = null): ConfigInterface { if ($className) { $className = ClassUtils::getRealClass($className); @@ -145,7 +145,7 @@ public function getConfigById(ConfigIdInterface $configId): ConfigInterface * * @return ConfigIdInterface[] */ - public function getIds(string $className = null, bool $withHidden = false): array + public function getIds(?string $className = null, bool $withHidden = false): array { if ($className) { $className = ClassUtils::getRealClass($className); @@ -164,7 +164,7 @@ public function getIds(string $className = null, bool $withHidden = false): arra * * @return ConfigInterface[] */ - public function getConfigs(string $className = null, bool $withHidden = false): array + public function getConfigs(?string $className = null, bool $withHidden = false): array { if ($className) { $className = ClassUtils::getRealClass($className); @@ -183,7 +183,7 @@ public function getConfigs(string $className = null, bool $withHidden = false): * * @return array */ - public function map($callback, string $className = null, bool $withHidden = false): array + public function map($callback, ?string $className = null, bool $withHidden = false): array { return array_map($callback, $this->getConfigs($className, $withHidden)); } @@ -198,7 +198,7 @@ public function map($callback, string $className = null, bool $withHidden = fals * * @return ConfigInterface[] */ - public function filter($callback, string $className = null, bool $withHidden = false): array + public function filter($callback, ?string $className = null, bool $withHidden = false): array { return array_filter($this->getConfigs($className, $withHidden), $callback); } diff --git a/src/Oro/Bundle/EntityConfigBundle/Tests/Unit/Config/ConfigManagerTest.php b/src/Oro/Bundle/EntityConfigBundle/Tests/Unit/Config/ConfigManagerTest.php index 7777aa42193..ee53817217e 100644 --- a/src/Oro/Bundle/EntityConfigBundle/Tests/Unit/Config/ConfigManagerTest.php +++ b/src/Oro/Bundle/EntityConfigBundle/Tests/Unit/Config/ConfigManagerTest.php @@ -1948,7 +1948,7 @@ private function createFieldConfigModel( return $result; } - private function getEntityMetadata(string $className, array $defaultValues = null): EntityMetadata + private function getEntityMetadata(string $className, ?array $defaultValues = null): EntityMetadata { $metadata = new EntityMetadata($className); $metadata->mode = ConfigModel::MODE_DEFAULT; @@ -1959,7 +1959,7 @@ private function getEntityMetadata(string $className, array $defaultValues = nul return $metadata; } - private function getFieldMetadata(string $className, string $fieldName, array $defaultValues = null): FieldMetadata + private function getFieldMetadata(string $className, string $fieldName, ?array $defaultValues = null): FieldMetadata { $metadata = new FieldMetadata($className, $fieldName); if (null !== $defaultValues) { @@ -1969,7 +1969,7 @@ private function getFieldMetadata(string $className, string $fieldName, array $d return $metadata; } - private function getConfig(ConfigIdInterface $configId, array $values = null): Config + private function getConfig(ConfigIdInterface $configId, ?array $values = null): Config { $config = new Config($configId); if (null !== $values) { diff --git a/src/Oro/Bundle/EntityConfigBundle/Tests/Unit/Form/EventListener/ConfigSubscriberTest.php b/src/Oro/Bundle/EntityConfigBundle/Tests/Unit/Form/EventListener/ConfigSubscriberTest.php index 70200a7fcf6..eed3269eac3 100644 --- a/src/Oro/Bundle/EntityConfigBundle/Tests/Unit/Form/EventListener/ConfigSubscriberTest.php +++ b/src/Oro/Bundle/EntityConfigBundle/Tests/Unit/Form/EventListener/ConfigSubscriberTest.php @@ -65,7 +65,7 @@ public function testGetSubscribedEvents(): void /** * @dataProvider preSetDataProvider */ - public function testPreSetData(array $data, ConfigModel $model, array $trans, array $expectedData = null): void + public function testPreSetData(array $data, ConfigModel $model, array $trans, ?array $expectedData = null): void { $provider1 = $this->getConfigProvider( 'entity', @@ -792,7 +792,7 @@ public function testPostSubmitWhenEmptyData(): void private function getFormEvent( array $data, ConfigModel $model, - FormInterface|Form $form = null + FormInterface|Form|null $form = null ): \PHPUnit\Framework\MockObject\MockObject|FormEvent { $fieldName = ''; if ($model instanceof FieldConfigModel && !$model->getId()) { diff --git a/src/Oro/Bundle/EntityConfigBundle/Tests/Unit/Form/Extension/AttributeConfigExtensionTest.php b/src/Oro/Bundle/EntityConfigBundle/Tests/Unit/Form/Extension/AttributeConfigExtensionTest.php index fd826ea8950..7077984c8a1 100644 --- a/src/Oro/Bundle/EntityConfigBundle/Tests/Unit/Form/Extension/AttributeConfigExtensionTest.php +++ b/src/Oro/Bundle/EntityConfigBundle/Tests/Unit/Form/Extension/AttributeConfigExtensionTest.php @@ -294,7 +294,7 @@ public function testOnPostIsValidAndFieldConfigModelExists(): void $this->assertEmpty($event->getData()); } - private function getFieldConfigModel(int $id = null): FieldConfigModel + private function getFieldConfigModel(?int $id = null): FieldConfigModel { $entityConfigModel = new EntityConfigModel('class'); $fieldConfigModel = new FieldConfigModel('test', 'string'); diff --git a/src/Oro/Bundle/EntityConfigBundle/Tests/Unit/Form/Type/AttributeGroupTypeTest.php b/src/Oro/Bundle/EntityConfigBundle/Tests/Unit/Form/Type/AttributeGroupTypeTest.php index 51decfc0ff3..0c5cf59ef33 100644 --- a/src/Oro/Bundle/EntityConfigBundle/Tests/Unit/Form/Type/AttributeGroupTypeTest.php +++ b/src/Oro/Bundle/EntityConfigBundle/Tests/Unit/Form/Type/AttributeGroupTypeTest.php @@ -111,8 +111,8 @@ private function getLocalization(int $id): Localization private function createLocalizedValue( string $string, - string $text = null, - Localization $localization = null + ?string $text = null, + ?Localization $localization = null ): LocalizedFallbackValue { $value = new LocalizedFallbackValue(); $value->setString($string) diff --git a/src/Oro/Bundle/EntityConfigBundle/Tests/Unit/Form/Util/ConfigTypeHelperTest.php b/src/Oro/Bundle/EntityConfigBundle/Tests/Unit/Form/Util/ConfigTypeHelperTest.php index cd10f0d171e..f3036196f24 100644 --- a/src/Oro/Bundle/EntityConfigBundle/Tests/Unit/Form/Util/ConfigTypeHelperTest.php +++ b/src/Oro/Bundle/EntityConfigBundle/Tests/Unit/Form/Util/ConfigTypeHelperTest.php @@ -89,7 +89,7 @@ public function testGetImmutableNoConfig() /** * @dataProvider getImmutableProvider */ - public function testGetImmutable(mixed $value, string $fieldName = null) + public function testGetImmutable(mixed $value, ?string $fieldName = null) { $scope = 'test_scope'; $className = 'Test\Entity'; @@ -140,8 +140,8 @@ public function getImmutableProvider(): array public function testIsImmutable( mixed $value, bool $expected, - string $fieldName = null, - string $constraintName = null + ?string $fieldName = null, + ?string $constraintName = null ) { $scope = 'test_scope'; $className = 'Test\Entity'; diff --git a/src/Oro/Bundle/EntityConfigBundle/Tests/Unit/ImportExport/TemplateFixture/EntityFieldFixtureTest.php b/src/Oro/Bundle/EntityConfigBundle/Tests/Unit/ImportExport/TemplateFixture/EntityFieldFixtureTest.php index 826e2f6e992..243662150c4 100644 --- a/src/Oro/Bundle/EntityConfigBundle/Tests/Unit/ImportExport/TemplateFixture/EntityFieldFixtureTest.php +++ b/src/Oro/Bundle/EntityConfigBundle/Tests/Unit/ImportExport/TemplateFixture/EntityFieldFixtureTest.php @@ -31,7 +31,7 @@ protected function setUp(): void $this->fixture = new EntityFieldFixture($this->fieldTypeProvider, $this->typeRegistry); } - private function createFieldConfigModel(string $type = null, array $data = []): FieldConfigModel + private function createFieldConfigModel(?string $type = null, array $data = []): FieldConfigModel { $entity = new FieldConfigModel(); diff --git a/src/Oro/Bundle/EntityConfigBundle/Tests/Unit/Metadata/Factory/MetadataFactoryTest.php b/src/Oro/Bundle/EntityConfigBundle/Tests/Unit/Metadata/Factory/MetadataFactoryTest.php index 3d604b2f9cf..fa78a5bc3fa 100644 --- a/src/Oro/Bundle/EntityConfigBundle/Tests/Unit/Metadata/Factory/MetadataFactoryTest.php +++ b/src/Oro/Bundle/EntityConfigBundle/Tests/Unit/Metadata/Factory/MetadataFactoryTest.php @@ -24,8 +24,8 @@ protected function setUp(): void private function getFieldMetadata( string $class, string $name, - string $mode = null, - array $defaultValues = null + ?string $mode = null, + ?array $defaultValues = null ): FieldMetadata { $fieldMetadata = new FieldMetadata($class, $name); $fieldMetadata->mode = $mode; diff --git a/src/Oro/Bundle/EntityConfigBundle/Tests/Unit/Provider/AttributeFamilyEntityNameProviderTest.php b/src/Oro/Bundle/EntityConfigBundle/Tests/Unit/Provider/AttributeFamilyEntityNameProviderTest.php index bc6cf2fe8e2..d20aa96e182 100644 --- a/src/Oro/Bundle/EntityConfigBundle/Tests/Unit/Provider/AttributeFamilyEntityNameProviderTest.php +++ b/src/Oro/Bundle/EntityConfigBundle/Tests/Unit/Provider/AttributeFamilyEntityNameProviderTest.php @@ -20,7 +20,7 @@ protected function setUp(): void $this->provider = new AttributeFamilyEntityNameProvider(); } - private function getAttributeFamilyLabel(string $string, Localization $localization = null): LocalizedFallbackValue + private function getAttributeFamilyLabel(string $string, ?Localization $localization = null): LocalizedFallbackValue { $value = new LocalizedFallbackValue(); $value->setString($string); diff --git a/src/Oro/Bundle/EntityConfigBundle/Tests/Unit/Stub/AttributeGroupStub.php b/src/Oro/Bundle/EntityConfigBundle/Tests/Unit/Stub/AttributeGroupStub.php index 74039fb2ce2..c0dd89aaa7b 100644 --- a/src/Oro/Bundle/EntityConfigBundle/Tests/Unit/Stub/AttributeGroupStub.php +++ b/src/Oro/Bundle/EntityConfigBundle/Tests/Unit/Stub/AttributeGroupStub.php @@ -24,7 +24,7 @@ public function setLabel(LocalizedFallbackValue $label) return $this; } - public function getLabel(Localization $localization = null) + public function getLabel(?Localization $localization = null) { return $this->label; } diff --git a/src/Oro/Bundle/EntityConfigBundle/Tests/Unit/Translation/ConfigTranslationHelperTest.php b/src/Oro/Bundle/EntityConfigBundle/Tests/Unit/Translation/ConfigTranslationHelperTest.php index 923b4c4600b..7050b3eff45 100644 --- a/src/Oro/Bundle/EntityConfigBundle/Tests/Unit/Translation/ConfigTranslationHelperTest.php +++ b/src/Oro/Bundle/EntityConfigBundle/Tests/Unit/Translation/ConfigTranslationHelperTest.php @@ -77,7 +77,7 @@ public function testInvalidateCache() /** * @dataProvider saveTranslationsDataProvider */ - public function testSaveTranslations(array $translations, string $key = null, string $value = null) + public function testSaveTranslations(array $translations, ?string $key = null, ?string $value = null) { if ($translations) { $this->assertTranslationManagerCalled($key, $value); diff --git a/src/Oro/Bundle/EntityExtendBundle/Decorator/OroPropertyAccessorBuilder.php b/src/Oro/Bundle/EntityExtendBundle/Decorator/OroPropertyAccessorBuilder.php index 10b3d2adb92..dc152eaf97b 100644 --- a/src/Oro/Bundle/EntityExtendBundle/Decorator/OroPropertyAccessorBuilder.php +++ b/src/Oro/Bundle/EntityExtendBundle/Decorator/OroPropertyAccessorBuilder.php @@ -15,7 +15,7 @@ class OroPropertyAccessorBuilder extends PropertyAccessorBuilder private $magicMethods = OroPropertyAccessor::MAGIC_GET | OroPropertyAccessor::MAGIC_SET; public function getPropertyAccessorWithDotArraySyntax( - int $magicMethods = null, + ?int $magicMethods = null, $isThrow = null ): PropertyAccessorInterface { $throw = OroPropertyAccessor::DO_NOT_THROW; diff --git a/src/Oro/Bundle/EntityExtendBundle/EntityExtend/PropertyAccessorWithDotArraySyntax.php b/src/Oro/Bundle/EntityExtendBundle/EntityExtend/PropertyAccessorWithDotArraySyntax.php index 6f0624ee4b1..013b860eec4 100644 --- a/src/Oro/Bundle/EntityExtendBundle/EntityExtend/PropertyAccessorWithDotArraySyntax.php +++ b/src/Oro/Bundle/EntityExtendBundle/EntityExtend/PropertyAccessorWithDotArraySyntax.php @@ -102,7 +102,7 @@ class PropertyAccessorWithDotArraySyntax implements PropertyAccessorInterface public function __construct( $magicMethods = self::MAGIC_GET | self::MAGIC_SET, $throw = self::THROW_ON_INVALID_PROPERTY_PATH, - CacheItemPoolInterface $cacheItemPool = null, + ?CacheItemPoolInterface $cacheItemPool = null, $readInfoExtractor = null, $writeInfoExtractor = null ) { @@ -310,7 +310,7 @@ private static function throwInvalidArgumentException( array $trace, int $i, string $propertyPath, - \Throwable $previous = null + ?\Throwable $previous = null ): void { if (!isset($trace[$i]['file']) || __FILE__ !== $trace[$i]['file']) { return; @@ -968,7 +968,7 @@ public static function createCache( string $namespace, int $defaultLifetime, string $version, - LoggerInterface $logger = null + ?LoggerInterface $logger = null ) { if (!class_exists(ApcuAdapter::class)) { throw new \LogicException( diff --git a/src/Oro/Bundle/EntityExtendBundle/Extend/ReflectionExtractor.php b/src/Oro/Bundle/EntityExtendBundle/Extend/ReflectionExtractor.php index 2163c5d2157..9608816c71d 100644 --- a/src/Oro/Bundle/EntityExtendBundle/Extend/ReflectionExtractor.php +++ b/src/Oro/Bundle/EntityExtendBundle/Extend/ReflectionExtractor.php @@ -21,12 +21,12 @@ class ReflectionExtractor extends BasicReflectionExtractor private Inflector $inflector; public function __construct( - array $mutatorPrefixes = null, - array $accessorPrefixes = null, - array $arrayMutatorPrefixes = null, + ?array $mutatorPrefixes = null, + ?array $accessorPrefixes = null, + ?array $arrayMutatorPrefixes = null, bool $enableConstructorExtraction = true, int $accessFlags = BasicReflectionExtractor::ALLOW_PUBLIC, - InflectorInterface $inflector = null, + ?InflectorInterface $inflector = null, int $magicMethodsFlags = BasicReflectionExtractor::ALLOW_MAGIC_GET | BasicReflectionExtractor::ALLOW_MAGIC_SET ) { parent::__construct( diff --git a/src/Oro/Bundle/EntityExtendBundle/PropertyAccess.php b/src/Oro/Bundle/EntityExtendBundle/PropertyAccess.php index 1a9002e36db..e543529c17a 100644 --- a/src/Oro/Bundle/EntityExtendBundle/PropertyAccess.php +++ b/src/Oro/Bundle/EntityExtendBundle/PropertyAccess.php @@ -25,8 +25,8 @@ public static function createPropertyAccessor(): PropertyAccessorInterface } public static function createPropertyAccessorWithDotSyntax( - int $magicMethods = null, - int $throw = null + ?int $magicMethods = null, + ?int $throw = null ): PropertyAccessorInterface { return self::createPropertyAccessorBuilder()->getPropertyAccessorWithDotArraySyntax($magicMethods, $throw); } diff --git a/src/Oro/Bundle/EntityExtendBundle/Tests/Unit/EventListener/DoctrineListenerTest.php b/src/Oro/Bundle/EntityExtendBundle/Tests/Unit/EventListener/DoctrineListenerTest.php index d67f745e705..d072ea3b303 100644 --- a/src/Oro/Bundle/EntityExtendBundle/Tests/Unit/EventListener/DoctrineListenerTest.php +++ b/src/Oro/Bundle/EntityExtendBundle/Tests/Unit/EventListener/DoctrineListenerTest.php @@ -41,7 +41,7 @@ protected function setUp(): void public function testProcessFieldMappings( string $path, array $expectedValues, - string $expectedException = null + ?string $expectedException = null ) { if ($expectedException) { return; @@ -86,7 +86,7 @@ public function testProcessFieldMappings( public function testProcessDiscriminatorValues( string $path, array $expectedValues, - string $expectedException = null + ?string $expectedException = null ) { if (null !== $expectedException) { $this->expectException($expectedException); diff --git a/src/Oro/Bundle/EntityExtendBundle/Tests/Unit/Fixtures/PropertyAccess/NonTraversableArrayObject.php b/src/Oro/Bundle/EntityExtendBundle/Tests/Unit/Fixtures/PropertyAccess/NonTraversableArrayObject.php index 7669928a607..9d90666188a 100644 --- a/src/Oro/Bundle/EntityExtendBundle/Tests/Unit/Fixtures/PropertyAccess/NonTraversableArrayObject.php +++ b/src/Oro/Bundle/EntityExtendBundle/Tests/Unit/Fixtures/PropertyAccess/NonTraversableArrayObject.php @@ -10,7 +10,7 @@ class NonTraversableArrayObject implements \ArrayAccess, \Countable { private $array; - public function __construct(array $array = null) + public function __construct(?array $array = null) { $this->array = $array ?: array(); } diff --git a/src/Oro/Bundle/EntityExtendBundle/Tests/Unit/Fixtures/PropertyAccess/TraversableArrayObject.php b/src/Oro/Bundle/EntityExtendBundle/Tests/Unit/Fixtures/PropertyAccess/TraversableArrayObject.php index 84f4bf66685..6164180f985 100644 --- a/src/Oro/Bundle/EntityExtendBundle/Tests/Unit/Fixtures/PropertyAccess/TraversableArrayObject.php +++ b/src/Oro/Bundle/EntityExtendBundle/Tests/Unit/Fixtures/PropertyAccess/TraversableArrayObject.php @@ -10,7 +10,7 @@ class TraversableArrayObject implements \ArrayAccess, \IteratorAggregate, \Count { private $array; - public function __construct(array $array = null) + public function __construct(?array $array = null) { $this->array = $array ?: array(); } diff --git a/src/Oro/Bundle/EntityExtendBundle/Tests/Unit/Form/Type/AbstractEnumTypeTestCase.php b/src/Oro/Bundle/EntityExtendBundle/Tests/Unit/Form/Type/AbstractEnumTypeTestCase.php index 1f21bb5a935..bbb5df528e8 100644 --- a/src/Oro/Bundle/EntityExtendBundle/Tests/Unit/Form/Type/AbstractEnumTypeTestCase.php +++ b/src/Oro/Bundle/EntityExtendBundle/Tests/Unit/Form/Type/AbstractEnumTypeTestCase.php @@ -13,6 +13,7 @@ use Oro\Bundle\EntityExtendBundle\Form\Type\AbstractEnumType; use Oro\Bundle\EntityExtendBundle\Tests\Unit\Fixtures\TestEnumValue; use Oro\Bundle\EntityExtendBundle\Tests\Unit\Form\Fixtures\TestEntity; +use PHPUnit\Framework\MockObject\MockObject; use Symfony\Component\Form\FormConfigInterface; use Symfony\Component\Form\FormEvent; use Symfony\Component\Form\FormEvents; @@ -24,10 +25,10 @@ class AbstractEnumTypeTestCase extends TypeTestCase { - /** @var ConfigManager|\PHPUnit\Framework\MockObject\MockObject */ + /** @var ConfigManager|MockObject */ protected $configManager; - /** @var ManagerRegistry|\PHPUnit\Framework\MockObject\MockObject */ + /** @var ManagerRegistry|MockObject */ protected $doctrine; #[\Override] @@ -341,9 +342,9 @@ protected function getOptionsResolver(): OptionsResolver } protected function expectFormWillReturnParentForm( - FormInterface|\PHPUnit\Framework\MockObject\MockObject $form, - FormInterface|\PHPUnit\Framework\MockObject\MockObject $parentForm = null - ): FormInterface|\PHPUnit\Framework\MockObject\MockObject { + FormInterface|MockObject $form, + FormInterface|MockObject|null $parentForm = null + ): FormInterface|MockObject { if (!$parentForm) { $parentForm = $this->createMock(FormInterface::class); } @@ -356,8 +357,8 @@ protected function expectFormWillReturnParentForm( } protected function expectFormWillReturnData( - FormInterface|\PHPUnit\Framework\MockObject\MockObject $form, - mixed $data + FormInterface|MockObject $form, + mixed $data ): void { $form->expects($this->once()) ->method('getData') @@ -365,9 +366,9 @@ protected function expectFormWillReturnData( } protected function expectFormWillReturnFormConfig( - FormInterface|\PHPUnit\Framework\MockObject\MockObject $form, - FormConfigInterface|\PHPUnit\Framework\MockObject\MockObject $formConfig = null - ): FormConfigInterface|\PHPUnit\Framework\MockObject\MockObject { + FormInterface|MockObject $form, + FormConfigInterface|MockObject|null $formConfig = null + ): FormConfigInterface|MockObject { if (!$formConfig) { $formConfig = $this->createMock(FormConfigInterface::class); } @@ -380,7 +381,7 @@ protected function expectFormWillReturnFormConfig( } protected function expectFormConfigWillReturnOptions( - \PHPUnit\Framework\MockObject\MockObject $formConfig, + MockObject $formConfig, array $optionsValueMap ): void { $formConfig->expects($this->atLeastOnce()) diff --git a/src/Oro/Bundle/EntityExtendBundle/Tests/Unit/Form/Type/AssociationChoiceTypeTest.php b/src/Oro/Bundle/EntityExtendBundle/Tests/Unit/Form/Type/AssociationChoiceTypeTest.php index ab6a9c53f9e..a7236df06f4 100644 --- a/src/Oro/Bundle/EntityExtendBundle/Tests/Unit/Form/Type/AssociationChoiceTypeTest.php +++ b/src/Oro/Bundle/EntityExtendBundle/Tests/Unit/Form/Type/AssociationChoiceTypeTest.php @@ -67,7 +67,7 @@ public function testGetParent() $this->assertEquals(ChoiceType::class, $this->getFormType()->getParent()); } - protected function getDisabledFormView(string $cssClass = null): array + protected function getDisabledFormView(?string $cssClass = null): array { return [ 'disabled' => true, diff --git a/src/Oro/Bundle/EntityExtendBundle/Tools/ExtendHelper.php b/src/Oro/Bundle/EntityExtendBundle/Tools/ExtendHelper.php index 7fc25eb00f1..521e87987b8 100644 --- a/src/Oro/Bundle/EntityExtendBundle/Tools/ExtendHelper.php +++ b/src/Oro/Bundle/EntityExtendBundle/Tools/ExtendHelper.php @@ -231,7 +231,7 @@ public static function extractEnumCode(string $enumOptionId): string public static function generateEnumCode( string $entityClassName, string $fieldName, - int $maxEnumCodeSize = null + ?int $maxEnumCodeSize = null ): string { if ('' === $entityClassName) { throw new \InvalidArgumentException('$entityClassName must not be empty.'); diff --git a/src/Oro/Bundle/EntityMergeBundle/Metadata/FieldMetadata.php b/src/Oro/Bundle/EntityMergeBundle/Metadata/FieldMetadata.php index b5c790c16e5..d299404d404 100644 --- a/src/Oro/Bundle/EntityMergeBundle/Metadata/FieldMetadata.php +++ b/src/Oro/Bundle/EntityMergeBundle/Metadata/FieldMetadata.php @@ -16,7 +16,7 @@ class FieldMetadata extends Metadata implements MetadataInterface */ protected $doctrineMetadata; - public function __construct(array $options = [], DoctrineMetadata $doctrineMetadata = null) + public function __construct(array $options = [], ?DoctrineMetadata $doctrineMetadata = null) { parent::__construct($options); if ($doctrineMetadata) { diff --git a/src/Oro/Bundle/EntityMergeBundle/Metadata/Metadata.php b/src/Oro/Bundle/EntityMergeBundle/Metadata/Metadata.php index 563ca32115e..b738613491d 100644 --- a/src/Oro/Bundle/EntityMergeBundle/Metadata/Metadata.php +++ b/src/Oro/Bundle/EntityMergeBundle/Metadata/Metadata.php @@ -49,7 +49,7 @@ public function is($code, $value = true) } #[\Override] - public function all(\Closure $filter = null) + public function all(?\Closure $filter = null) { if ($filter) { return array_filter($this->options, $filter); diff --git a/src/Oro/Bundle/EntityMergeBundle/Metadata/MetadataInterface.php b/src/Oro/Bundle/EntityMergeBundle/Metadata/MetadataInterface.php index a342743bd0b..4e4229903e3 100644 --- a/src/Oro/Bundle/EntityMergeBundle/Metadata/MetadataInterface.php +++ b/src/Oro/Bundle/EntityMergeBundle/Metadata/MetadataInterface.php @@ -34,7 +34,7 @@ public function is($code, $value = true); * @param \Closure|null $filter * @return array */ - public function all(\Closure $filter = null); + public function all(?\Closure $filter = null); /** * Merges values of this object with another set of data diff --git a/src/Oro/Bundle/LocaleBundle/Entity/AbstractLocalizedFallbackValue.php b/src/Oro/Bundle/LocaleBundle/Entity/AbstractLocalizedFallbackValue.php index c5453b2260c..68ffac727fe 100644 --- a/src/Oro/Bundle/LocaleBundle/Entity/AbstractLocalizedFallbackValue.php +++ b/src/Oro/Bundle/LocaleBundle/Entity/AbstractLocalizedFallbackValue.php @@ -120,7 +120,7 @@ public function getLocalization() * @param Localization|null $localization * @return $this */ - public function setLocalization(Localization $localization = null) + public function setLocalization(?Localization $localization = null) { $this->localization = $localization; diff --git a/src/Oro/Bundle/LocaleBundle/Entity/Localization.php b/src/Oro/Bundle/LocaleBundle/Entity/Localization.php index d0f433f5a2a..fd1de526def 100644 --- a/src/Oro/Bundle/LocaleBundle/Entity/Localization.php +++ b/src/Oro/Bundle/LocaleBundle/Entity/Localization.php @@ -194,7 +194,7 @@ public function getName() * * @return $this */ - public function setParentLocalization(Localization $parentLocalization = null) + public function setParentLocalization(?Localization $parentLocalization = null) { $this->parentLocalization = $parentLocalization; diff --git a/src/Oro/Bundle/OrganizationBundle/Entity/BusinessUnit.php b/src/Oro/Bundle/OrganizationBundle/Entity/BusinessUnit.php index 7daf2dc19e8..b2412b4d33f 100644 --- a/src/Oro/Bundle/OrganizationBundle/Entity/BusinessUnit.php +++ b/src/Oro/Bundle/OrganizationBundle/Entity/BusinessUnit.php @@ -378,7 +378,7 @@ public function getParentBusinessUnit() * * @return BusinessUnit */ - public function setParentBusinessUnit(BusinessUnit $value = null) + public function setParentBusinessUnit(?BusinessUnit $value = null) { $this->setOwner($value); diff --git a/src/Oro/Bundle/SecurityBundle/AccessRule/Expr/Path.php b/src/Oro/Bundle/SecurityBundle/AccessRule/Expr/Path.php index 1809afb40c5..e86fae314f5 100644 --- a/src/Oro/Bundle/SecurityBundle/AccessRule/Expr/Path.php +++ b/src/Oro/Bundle/SecurityBundle/AccessRule/Expr/Path.php @@ -15,7 +15,7 @@ class Path implements ExpressionInterface /** @var string */ private $field; - public function __construct(string $field, string $alias = null) + public function __construct(string $field, ?string $alias = null) { $this->alias = $alias; $this->field = $field; diff --git a/src/Oro/Bundle/UIBundle/Twig/UiExtension.php b/src/Oro/Bundle/UIBundle/Twig/UiExtension.php index 1a222d55018..e4b9b167f0f 100644 --- a/src/Oro/Bundle/UIBundle/Twig/UiExtension.php +++ b/src/Oro/Bundle/UIBundle/Twig/UiExtension.php @@ -177,7 +177,7 @@ public function scrollDataBefore( $pageIdentifier, array $data, $entity, - FormView $formView = null + ?FormView $formView = null ) { $event = new BeforeListRenderEvent($environment, new ScrollData($data), $entity, $formView); $this->getEventDispatcher()->dispatch($event, 'oro_ui.scroll_data.before.' . $pageIdentifier); @@ -427,7 +427,7 @@ protected function getUniqueIdentifier() * * @return array */ - public function getContent(array $additionalContent = null, array $keys = null) + public function getContent(?array $additionalContent = null, ?array $keys = null) { $content = $this->getContentProviderManager()->getContent($keys); if ($additionalContent) { diff --git a/src/Oro/Bundle/UserBundle/Entity/AbstractUser.php b/src/Oro/Bundle/UserBundle/Entity/AbstractUser.php index 54d3c5c867b..d628b17b0e9 100644 --- a/src/Oro/Bundle/UserBundle/Entity/AbstractUser.php +++ b/src/Oro/Bundle/UserBundle/Entity/AbstractUser.php @@ -195,7 +195,7 @@ public function getLastLogin() * @return AbstractUser */ #[\Override] - public function setLastLogin(\DateTime $time = null) + public function setLastLogin(?\DateTime $time = null) { $this->lastLogin = $time; @@ -429,7 +429,7 @@ public function getOrganization() } #[\Override] - public function setOrganization(OrganizationInterface $organization = null) + public function setOrganization(?OrganizationInterface $organization = null) { $this->organization = $organization; @@ -483,7 +483,7 @@ public function getPasswordRequestedAt() * @return AbstractUser */ #[\Override] - public function setPasswordRequestedAt(\DateTime $time = null) + public function setPasswordRequestedAt(?\DateTime $time = null) { $this->passwordRequestedAt = $time; @@ -501,7 +501,7 @@ public function getPasswordChangedAt() * @return AbstractUser */ #[\Override] - public function setPasswordChangedAt(\DateTime $time = null) + public function setPasswordChangedAt(?\DateTime $time = null) { $this->passwordChangedAt = $time; diff --git a/src/Oro/Bundle/UserBundle/Entity/Ownership/UserAwareTrait.php b/src/Oro/Bundle/UserBundle/Entity/Ownership/UserAwareTrait.php index ffa64f99a2d..1fdf08423b4 100644 --- a/src/Oro/Bundle/UserBundle/Entity/Ownership/UserAwareTrait.php +++ b/src/Oro/Bundle/UserBundle/Entity/Ownership/UserAwareTrait.php @@ -30,7 +30,7 @@ public function getOwner() * @param User|null $owner * @return $this */ - public function setOwner(User $owner = null) + public function setOwner(?User $owner = null) { $this->owner = $owner; diff --git a/src/Oro/Bundle/UserBundle/Entity/PasswordRecoveryInterface.php b/src/Oro/Bundle/UserBundle/Entity/PasswordRecoveryInterface.php index 9077b452da9..3aab267f54f 100644 --- a/src/Oro/Bundle/UserBundle/Entity/PasswordRecoveryInterface.php +++ b/src/Oro/Bundle/UserBundle/Entity/PasswordRecoveryInterface.php @@ -38,7 +38,7 @@ public function getPasswordRequestedAt(); /** * @param \DateTime|null $time New password request time. Null by default. */ - public function setPasswordRequestedAt(\DateTime $time = null); + public function setPasswordRequestedAt(?\DateTime $time = null); /** * @return \DateTime|null @@ -48,5 +48,5 @@ public function getPasswordChangedAt(); /** * @param \DateTime|null $time Password changed time. Null by default. */ - public function setPasswordChangedAt(\DateTime $time = null); + public function setPasswordChangedAt(?\DateTime $time = null); } diff --git a/src/Oro/Bundle/UserBundle/Entity/User.php b/src/Oro/Bundle/UserBundle/Entity/User.php index d105b51957d..178b120bd66 100644 --- a/src/Oro/Bundle/UserBundle/Entity/User.php +++ b/src/Oro/Bundle/UserBundle/Entity/User.php @@ -364,7 +364,7 @@ public function getBirthday() * * @return User */ - public function setBirthday(\DateTime $birthday = null) + public function setBirthday(?\DateTime $birthday = null) { $this->birthday = $birthday; @@ -386,7 +386,7 @@ public function getCreatedAt() * * @return User */ - public function setCreatedAt(\DateTime $createdAt = null) + public function setCreatedAt(?\DateTime $createdAt = null) { $this->createdAt = $createdAt; @@ -408,7 +408,7 @@ public function getUpdatedAt() * * @return User */ - public function setUpdatedAt(\DateTime $updatedAt = null) + public function setUpdatedAt(?\DateTime $updatedAt = null) { $this->updatedAt = $updatedAt; @@ -680,7 +680,7 @@ function ($item) { : $items->first(); } - public function setImapAccountType(AccountTypeModel $accountTypeModel = null) + public function setImapAccountType(?AccountTypeModel $accountTypeModel = null) { $this->imapAccountType = $accountTypeModel; if ($accountTypeModel instanceof AccountTypeModel) { diff --git a/src/Oro/Bundle/UserBundle/Tests/Unit/Stub/UserStub.php b/src/Oro/Bundle/UserBundle/Tests/Unit/Stub/UserStub.php index 7525c6de4f4..fe2cb5394ce 100644 --- a/src/Oro/Bundle/UserBundle/Tests/Unit/Stub/UserStub.php +++ b/src/Oro/Bundle/UserBundle/Tests/Unit/Stub/UserStub.php @@ -23,7 +23,7 @@ public function getAuthStatus() return $this->auth_status; } - public function setAuthStatus(EnumOptionInterface $enum = null) + public function setAuthStatus(?EnumOptionInterface $enum = null) { $this->auth_status = $enum; diff --git a/src/Oro/Component/Action/Action/ActionFactoryInterface.php b/src/Oro/Component/Action/Action/ActionFactoryInterface.php index 8be0ab1b87a..b18a5b55fa3 100644 --- a/src/Oro/Component/Action/Action/ActionFactoryInterface.php +++ b/src/Oro/Component/Action/Action/ActionFactoryInterface.php @@ -16,5 +16,5 @@ interface ActionFactoryInterface extends FactoryWithTypesInterface * @throws \RunTimeException * @return ActionInterface */ - public function create($type, array $options = array(), ExpressionInterface $condition = null); + public function create($type, array $options = array(), ?ExpressionInterface $condition = null); } diff --git a/src/Oro/Component/ChainProcessor/Exception/ExecutionFailedException.php b/src/Oro/Component/ChainProcessor/Exception/ExecutionFailedException.php index 1e90d3affa9..4d75dfbd1aa 100644 --- a/src/Oro/Component/ChainProcessor/Exception/ExecutionFailedException.php +++ b/src/Oro/Component/ChainProcessor/Exception/ExecutionFailedException.php @@ -18,9 +18,9 @@ class ExecutionFailedException extends \RuntimeException public function __construct( string $processorId, - string $action = null, - string $group = null, - \Exception $previous = null + ?string $action = null, + ?string $group = null, + ?\Exception $previous = null ) { $this->processorId = $processorId; $this->action = $action; diff --git a/src/Oro/Component/Config/Common/ConfigObject.php b/src/Oro/Component/Config/Common/ConfigObject.php index dd06d3b574b..c0ba7ddab2c 100644 --- a/src/Oro/Component/Config/Common/ConfigObject.php +++ b/src/Oro/Component/Config/Common/ConfigObject.php @@ -24,7 +24,7 @@ class ConfigObject implements \ArrayAccess, \IteratorAggregate /** @var array */ protected $params; - protected function __construct(array $params, PropertyAccessorInterface $propertyAccessor = null) + protected function __construct(array $params, ?PropertyAccessorInterface $propertyAccessor = null) { $this->accessor = $propertyAccessor ?? new PropertyAccessor(); $this->params = $params; @@ -37,7 +37,7 @@ protected function __construct(array $params, PropertyAccessorInterface $propert * * @return $this */ - public static function create(array $params, PropertyAccessorInterface $propertyAccessor = null) + public static function create(array $params, ?PropertyAccessorInterface $propertyAccessor = null) { return new static($params, $propertyAccessor); } @@ -50,7 +50,7 @@ public static function create(array $params, PropertyAccessorInterface $property * * @return $this */ - public static function createNamed($name, array $params, PropertyAccessorInterface $propertyAccessor = null) + public static function createNamed($name, array $params, ?PropertyAccessorInterface $propertyAccessor = null) { $params[self::NAME_KEY] = $name; diff --git a/src/Oro/Component/ConfigExpression/AbstractExpression.php b/src/Oro/Component/ConfigExpression/AbstractExpression.php index 9f1914f939e..fac29d0720f 100644 --- a/src/Oro/Component/ConfigExpression/AbstractExpression.php +++ b/src/Oro/Component/ConfigExpression/AbstractExpression.php @@ -16,7 +16,7 @@ abstract class AbstractExpression implements ExpressionInterface protected $errors; #[\Override] - public function evaluate($context, \ArrayAccess $errors = null) + public function evaluate($context, ?\ArrayAccess $errors = null) { $this->errors = $errors; $result = $this->doEvaluate($context); diff --git a/src/Oro/Component/ConfigExpression/ExpressionInterface.php b/src/Oro/Component/ConfigExpression/ExpressionInterface.php index 9e110e0b869..62d315d3312 100644 --- a/src/Oro/Component/ConfigExpression/ExpressionInterface.php +++ b/src/Oro/Component/ConfigExpression/ExpressionInterface.php @@ -19,7 +19,7 @@ public function getName(); * * @return mixed */ - public function evaluate($context, \ArrayAccess $errors = null); + public function evaluate($context, ?\ArrayAccess $errors = null); /** * Sets the condition error message. diff --git a/src/Oro/Component/EntitySerializer/EntityConfigInterface.php b/src/Oro/Component/EntitySerializer/EntityConfigInterface.php index 08956139601..f5b679239ed 100644 --- a/src/Oro/Component/EntitySerializer/EntityConfigInterface.php +++ b/src/Oro/Component/EntitySerializer/EntityConfigInterface.php @@ -48,7 +48,7 @@ public function getOrAddField(string $fieldName): FieldConfigInterface; /** * Adds the configuration of the field. */ - public function addField(string $fieldName, FieldConfigInterface $field = null): FieldConfigInterface; + public function addField(string $fieldName, ?FieldConfigInterface $field = null): FieldConfigInterface; /** * Removes the configuration of the field. diff --git a/src/Oro/Component/EntitySerializer/FieldConfigInterface.php b/src/Oro/Component/EntitySerializer/FieldConfigInterface.php index 291851282db..0d4f07b97d6 100644 --- a/src/Oro/Component/EntitySerializer/FieldConfigInterface.php +++ b/src/Oro/Component/EntitySerializer/FieldConfigInterface.php @@ -32,10 +32,10 @@ public function hasPropertyPath(): bool; /** * Gets the path of the field value. */ - public function getPropertyPath(string $defaultValue = null): ?string; + public function getPropertyPath(?string $defaultValue = null): ?string; /** * Sets the path of the field value. */ - public function setPropertyPath(string $propertyPath = null): void; + public function setPropertyPath(?string $propertyPath = null): void; } diff --git a/src/Oro/Component/Testing/Command/CommandTestingTrait.php b/src/Oro/Component/Testing/Command/CommandTestingTrait.php index 951693d657f..f83642e28e8 100644 --- a/src/Oro/Component/Testing/Command/CommandTestingTrait.php +++ b/src/Oro/Component/Testing/Command/CommandTestingTrait.php @@ -110,7 +110,7 @@ private function assertOutputIsEmpty(CommandTester $commandTester): void self::assertThat($commandTester, new CommandOutputIsEmpty()); } - private function assertProducedWarning(CommandTester $commandTester, string $expectedWarningMessage = null): void + private function assertProducedWarning(CommandTester $commandTester, ?string $expectedWarningMessage = null): void { self::assertThat($commandTester, new CommandProducedWarning($expectedWarningMessage)); } @@ -120,7 +120,7 @@ private function assertSuccessReturnCode(CommandTester $commandTester): void self::assertThat($commandTester, new CommandSuccessReturnCode()); } - private function assertProducedError(CommandTester $commandTester, string $expectedErrorMessage = null): void + private function assertProducedError(CommandTester $commandTester, ?string $expectedErrorMessage = null): void { self::assertThat($commandTester, new CommandProducedError($expectedErrorMessage)); } diff --git a/src/Oro/Component/Testing/Unit/EntityTrait.php b/src/Oro/Component/Testing/Unit/EntityTrait.php index 3393b7646d8..68f89cae180 100644 --- a/src/Oro/Component/Testing/Unit/EntityTrait.php +++ b/src/Oro/Component/Testing/Unit/EntityTrait.php @@ -29,7 +29,7 @@ trait EntityTrait * @psalm-param class-string $className * @psalm-return T */ - protected function getEntity($className, array $properties = [], array $constructorArgs = null) + protected function getEntity($className, array $properties = [], ?array $constructorArgs = null) { $reflectionClass = new \ReflectionClass($className); $reflectionMethod = null; diff --git a/src/Oro/Component/Testing/Unit/ORM/OrmTestCase.php b/src/Oro/Component/Testing/Unit/ORM/OrmTestCase.php index a06c45439d3..73d4df3be04 100644 --- a/src/Oro/Component/Testing/Unit/ORM/OrmTestCase.php +++ b/src/Oro/Component/Testing/Unit/ORM/OrmTestCase.php @@ -52,7 +52,7 @@ protected function getProxyDir(bool $shouldBeCreated = true): string */ protected function getTestEntityManager( mixed $conn = null, - EventManager $eventManager = null, + ?EventManager $eventManager = null, bool $withSharedMetadata = true ): EntityManagerMock { $config = new \Doctrine\ORM\Configuration(); diff --git a/src/Oro/Component/Testing/Unit/PreloadedExtension.php b/src/Oro/Component/Testing/Unit/PreloadedExtension.php index 67ebdb2614d..6bdfe9fd298 100644 --- a/src/Oro/Component/Testing/Unit/PreloadedExtension.php +++ b/src/Oro/Component/Testing/Unit/PreloadedExtension.php @@ -17,7 +17,7 @@ class PreloadedExtension extends BasePreloadExtension */ private $types = []; - public function __construct(array $types, array $typeExtensions, FormTypeGuesserInterface $typeGuesser = null) + public function __construct(array $types, array $typeExtensions, ?FormTypeGuesserInterface $typeGuesser = null) { foreach ($types as $key => $type) { if (is_string($key)) {