Skip to content

Commit

Permalink
BAP-22912: Fix PHP 8.4 deprecation messages - fix Static Analysis (#4…
Browse files Browse the repository at this point in the history
…0343)
  • Loading branch information
ikhrysieva authored Jan 31, 2025
1 parent 989b071 commit 0120ea9
Show file tree
Hide file tree
Showing 18 changed files with 90 additions and 67 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public function getRootAlias()
*/
public function getRootEntity(
?EntityClassResolver $entityClassResolver = null,
$lookAtExtendedEntityClassName = false
$lookAtExtendedEntityClassName = false
) {
if ($lookAtExtendedEntityClassName) {
$entityClassName = $this->config->getExtendedEntityClassName();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,13 @@ public function findMessageIdByEmailId(int $id): ?string
*
* @return array
*/
public function getNewEmails(User $user, Organization $organization, $limit, $folderId, ?AclHelper $aclHelper = null)
{
public function getNewEmails(
User $user,
Organization $organization,
$limit,
$folderId,
?AclHelper $aclHelper = null
) {
$qb = $this->getEmailList($user, $organization, $limit, $folderId, false);
$query = $qb->getQuery();
if ($aclHelper) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\Form\FormInterface;

/**
* This class retrieves a form from the Symfony dependency injection container
* and generates a unique hash for its configuration.
*/
class DependencyInjectionFormAccessor extends AbstractFormAccessor implements ConfigurableFormAccessorInterface
{
/** @var ContainerInterface */
Expand All @@ -28,10 +32,10 @@ class DependencyInjectionFormAccessor extends AbstractFormAccessor implements Co
*/
public function __construct(
ContainerInterface $container,
$formServiceId,
?FormAction $action = null,
$method = null,
$enctype = null
$formServiceId,
?FormAction $action = null,
$method = null,
$enctype = null
) {
$this->container = $container;
$this->formServiceId = $formServiceId;
Expand Down
6 changes: 4 additions & 2 deletions src/Oro/Bundle/EntityConfigBundle/Tools/CommandExecutor.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ class CommandExecutor implements CommandExecutorInterface
*/
private $dataCacheManager;

public function __construct(CommandExecutorInterface $commandExecutor, ?OroDataCacheManager $dataCacheManager = null)
{
public function __construct(
CommandExecutorInterface $commandExecutor,
?OroDataCacheManager $dataCacheManager = null
) {
$this->commandExecutor = $commandExecutor;
$this->dataCacheManager = $dataCacheManager;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,10 @@ public function getMethods(EntityFieldProcessTransport $transport): array
return [];
}

protected function initializeDefaultValue(EntityFieldProcessTransport $transport, ?string $propertyName = null): void
{
protected function initializeDefaultValue(
EntityFieldProcessTransport $transport,
?string $propertyName = null
): void {
$propertyName = $propertyName ?? $transport->getName();
$defaultValue = null;
if (!$transport->getStorage()->offsetExists($propertyName)) {
Expand Down
7 changes: 5 additions & 2 deletions src/Oro/Bundle/ImportExportBundle/Reader/EntityReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,11 @@ public function setAclHelper(AclHelper $aclHelper)
* @param string $entityName
* @param Organization|null $organization
*/
protected function addOrganizationLimits(QueryBuilder $queryBuilder, $entityName, ?Organization $organization = null)
{
protected function addOrganizationLimits(
QueryBuilder $queryBuilder,
$entityName,
?Organization $organization = null
) {
if ($organization) {
$organizationField = $this->ownershipMetadata->getMetadata($entityName)->getOrganizationFieldName();
if ($organizationField) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@ class SoapConnectionException extends TransportException
* @param int|string $code
* @return static
*/
public static function createFromResponse($response, ?\Exception $exception = null, $request = '', $code = 'unknown')
{
public static function createFromResponse(
$response,
?\Exception $exception = null,
$request = '',
$code = 'unknown'
) {
$exceptionMessage = '';
$exceptionCode = 0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ class CacheExpressionProcessor extends ExpressionProcessor

#[\Override]
public function processExpressions(
array &$values,
ContextInterface $context,
array &$values,
ContextInterface $context,
?DataAccessorInterface $data = null,
$evaluate = true,
$encoding = null
$evaluate = true,
$encoding = null
): void {
if (!$evaluate && $encoding === null) {
return;
Expand Down
6 changes: 3 additions & 3 deletions src/Oro/Bundle/MigrationBundle/Tools/SchemaDumper.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ public function acceptSchema(Schema $schema)
*/
public function dump(
?array $allowedTables = null,
$namespace = null,
$className = self::DEFAULT_CLASS_NAME,
$version = self::DEFAULT_VERSION,
$namespace = null,
$className = self::DEFAULT_CLASS_NAME,
$version = self::DEFAULT_VERSION,
?array $extendedOptions = null
) {
$content = $this->twig->render(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ protected function getNavigationItemClassName()
* @return integer
*/
public function countNavigationItems(
string $url,
$user,
string $url,
$user,
?OrganizationInterface $organization = null,
$type = null
$type = null
): int {
$qb = $this->createNavigationItemsQueryBuiler($user, $organization, $type);

Expand Down
6 changes: 3 additions & 3 deletions src/Oro/Bundle/SearchBundle/Query/Expression/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ class Parser
* @throws ExpressionSyntaxError
*/
public function parse(
TokenStream $stream,
?Query $query = null,
TokenStream $stream,
?Query $query = null,
?FieldResolverInterface $fieldResolver = null,
$keyword = null
$keyword = null
) {
if (null === $query) {
$query = new Query();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -691,13 +691,13 @@ protected function findAclByOid(\SplObjectStorage $acls, ObjectIdentity $oid)
* @param string|null $aclGroup
*/
protected function addPermissions(
SID $sid,
AclPrivilege $privilege,
OID $oid,
\SplObjectStorage $acls,
SID $sid,
AclPrivilege $privilege,
OID $oid,
\SplObjectStorage $acls,
AclExtensionInterface $extension,
?AclInterface $rootAcl = null,
$aclGroup = null
?AclInterface $rootAcl = null,
$aclGroup = null
) {
$allowedPermissions = $extension->getAllowedPermissions($oid, null, $aclGroup);
$acl = $this->findAclByOid($acls, $oid);
Expand Down Expand Up @@ -726,13 +726,13 @@ protected function addPermissions(
* @param AclInterface|null $acl
*/
protected function addAclPermissions(
SID $sid,
$field,
AclPrivilege $privilege,
array $permissions,
SID $sid,
$field,
AclPrivilege $privilege,
array $permissions,
AclExtensionInterface $extension,
?AclInterface $rootAcl = null,
?AclInterface $acl = null
?AclInterface $rootAcl = null,
?AclInterface $acl = null
) {
if ($acl !== null) {
// check object ACEs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ class ExceptionListener extends BaseExceptionListener
private array $excludedRoutes = [];

public function __construct(
TokenStorageInterface $tokenStorage,
TokenStorageInterface $tokenStorage,
AuthenticationTrustResolverInterface $trustResolver,
HttpUtils $httpUtils,
$providerKey,
?AuthenticationEntryPointInterface $authenticationEntryPoint = null,
$errorPage = null,
?AccessDeniedHandlerInterface $accessDeniedHandler = null,
?LoggerInterface $logger = null,
$stateless = false
HttpUtils $httpUtils,
$providerKey,
?AuthenticationEntryPointInterface $authenticationEntryPoint = null,
$errorPage = null,
?AccessDeniedHandlerInterface $accessDeniedHandler = null,
?LoggerInterface $logger = null,
$stateless = false
) {
parent::__construct(
$tokenStorage,
Expand Down
7 changes: 5 additions & 2 deletions src/Oro/Bundle/TagBundle/Entity/TagManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,11 @@ public function getEntities(Tag $tag): array
return $this->getRepository()->getEntities($tag);
}

public function getPreparedArray(object $entity, ?Collection $tags = null, ?Organization $organization = null): array
{
public function getPreparedArray(
object $entity,
?Collection $tags = null,
?Organization $organization = null
): array {
if (null === $tags) {
$this->loadTagging($entity, $organization);
$tags = $this->getTags($entity);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,10 @@ public function clear($entityClass = null)
*/
protected function scheduleProcess(
ProcessTrigger $trigger,
$entity,
?array $changeSet = null,
$old = null,
$new = null
$entity,
?array $changeSet = null,
$old = null,
$new = null
) {
$entityClass = ClassUtils::getClass($entity);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ private function getExpressionValues(TransitionEventTrigger $trigger, $entity, $
*/
public static function buildContextValues(
?WorkflowDefinition $workflowDefinition = null,
$entity = null,
$mainEntity = null,
?WorkflowItem $item = null,
$prevEntity = null
$entity = null,
$mainEntity = null,
?WorkflowItem $item = null,
$prevEntity = null
) {
return [
self::TRIGGER_WORKFLOW_DEFINITION => $workflowDefinition,
Expand Down
6 changes: 3 additions & 3 deletions src/Oro/Bundle/WorkflowBundle/Model/Workflow.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,9 @@ public function start($entity, array $data = [], $startTransition = null, ?Colle
*/
public function isTransitionAllowed(
WorkflowItem $workflowItem,
$transition,
?Collection $errors = null,
$fireExceptions = false
$transition,
?Collection $errors = null,
$fireExceptions = false
) {
// get current transition
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,13 +363,13 @@ public function configurationEntityIdentifierProvider(): array
}

private function getVariable(
string $name,
string $label,
string $type,
$value,
array $options = [],
string $name,
string $label,
string $type,
$value,
array $options = [],
?string $propertyPath = null,
array $entityAcl = []
array $entityAcl = []
): Variable {
$variable = new Variable();
$variable
Expand Down

0 comments on commit 0120ea9

Please sign in to comment.