Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Applied fixes from FlintCI #6786

Merged
merged 1 commit into from
Jan 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Action/GetShortObjectDescriptionAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function __invoke(Request $request): Response
@trigger_error(
'Trying to get a short object description for a non found object is deprecated'
.' since sonata-project/admin-bundle 3.76 and will be throw a 404 in version 4.0.',
E_USER_DEPRECATED
\E_USER_DEPRECATED
);
//throw new NotFoundHttpException(sprintf('Could not find subject for id "%s"', $objectId));

Expand Down
2 changes: 1 addition & 1 deletion src/Action/RetrieveAutocompleteItemsAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public function __invoke(Request $request): JsonResponse
@trigger_error(sprintf(
'Not implementing "%s::getCurrentPageResults()" is deprecated since sonata-project/admin-bundle 3.87 and will fail in 4.0.',
PagerInterface::class
), E_USER_DEPRECATED);
), \E_USER_DEPRECATED);

$results = $pager->getResults();
}
Expand Down
4 changes: 2 additions & 2 deletions src/Action/SearchAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public function __invoke(Request $request): Response
@trigger_error(sprintf(
'Not implementing "%s::getCurrentPageResults()" is deprecated since sonata-project/admin-bundle 3.87 and will fail in 4.0.',
PagerInterface::class
), E_USER_DEPRECATED);
), \E_USER_DEPRECATED);

$pageResults = $pager->getResults();
}
Expand All @@ -135,7 +135,7 @@ public function __invoke(Request $request): Response
@trigger_error(sprintf(
'Not implementing "%s::countResults()" is deprecated since sonata-project/admin-bundle 3.86 and will fail in 4.0.',
'Sonata\AdminBundle\Datagrid\PagerInterface'
), E_USER_DEPRECATED);
), \E_USER_DEPRECATED);
$total = (int) $pager->getNbResults();
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Action/SetObjectFieldValueAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function __construct(
DataTransformerResolverInterface::class,
__METHOD__,
\TypeError::class
), E_USER_DEPRECATED);
), \E_USER_DEPRECATED);
$resolver = new DataTransformerResolver();
}

Expand All @@ -95,7 +95,7 @@ public function __construct(
.' 3.82 and will throw a \TypeError error in version 4.0. You must pass an instance of %s instead.',
__METHOD__,
PropertyAccessorInterface::class
), E_USER_DEPRECATED);
), \E_USER_DEPRECATED);

$propertyAccessor = $pool->getPropertyAccessor();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Admin/AbstractAdminExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function validate(AdminInterface $admin, ErrorElement $errorElement, $obj
@trigger_error(sprintf(
'The %s method is deprecated since version 3.82 and will be removed in 4.0.',
__METHOD__
), E_USER_DEPRECATED);
), \E_USER_DEPRECATED);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Admin/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
@trigger_error(sprintf(
'The %1$s\Admin class is deprecated since version 3.1 and will be removed in 4.0. Use %1$s\AbstractAdmin instead.',
__NAMESPACE__
), E_USER_DEPRECATED);
), \E_USER_DEPRECATED);

/**
* NEXT_MAJOR: remove this class.
Expand Down
2 changes: 1 addition & 1 deletion src/Admin/AdminExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
'The %1$s\AdminExtension class is deprecated since version 3.1 and will be removed in 4.0.'
.' Use %1$s\AbstractAdminExtension instead.',
__NAMESPACE__
), E_USER_DEPRECATED);
), \E_USER_DEPRECATED);

/**
* NEXT_MAJOR: remove this class.
Expand Down
8 changes: 4 additions & 4 deletions src/Admin/AdminHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function __construct($poolOrPropertyAccessor)
Pool::class,
__METHOD__,
PropertyAccessorInterface::class
), E_USER_DEPRECATED);
), \E_USER_DEPRECATED);

$this->pool = $poolOrPropertyAccessor;
$this->propertyAccessor = $poolOrPropertyAccessor->getPropertyAccessor();
Expand Down Expand Up @@ -294,7 +294,7 @@ public function addNewInstance($object, FieldDescriptionInterface $fieldDescript
.' Use %s::addInstance() instead.',
__METHOD__,
ObjectManipulator::class
), E_USER_DEPRECATED);
), \E_USER_DEPRECATED);

$instance = $fieldDescription->getAssociationAdmin()->getNewInstance();

Expand All @@ -320,7 +320,7 @@ public function camelize($property)
'The %s method is deprecated since 3.1 and will be removed in 4.0. Use %s::classify() instead.',
__METHOD__,
Inflector::class
), E_USER_DEPRECATED);
), \E_USER_DEPRECATED);

return InflectorFactory::create()->build()->classify($property);
}
Expand Down Expand Up @@ -391,7 +391,7 @@ protected function getEntityClassName(AdminInterface $admin, $elements)
.' Use %s::getModelClassName() instead.',
__METHOD__,
__CLASS__
), E_USER_DEPRECATED);
), \E_USER_DEPRECATED);
}

$element = array_shift($elements);
Expand Down
36 changes: 18 additions & 18 deletions src/Admin/Pool.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public function __construct(
.' sonata-project/admin-bundle 3.86 and will throw "%s" exception in 4.0.',
__METHOD__,
\TypeError::class
), E_USER_DEPRECATED);
), \E_USER_DEPRECATED);

$this->title = $titleOrAdminServiceIds;
}
Expand All @@ -169,7 +169,7 @@ public function __construct(
.' sonata-project/admin-bundle 3.86 and will throw "%s" exception in 4.0.',
__METHOD__,
\TypeError::class
), E_USER_DEPRECATED);
), \E_USER_DEPRECATED);

$this->titleLogo = $logoTitleOrAdminGroups;
}
Expand All @@ -187,7 +187,7 @@ public function __construct(
'Passing an "%s" instance as argument 4 to "%s()" is deprecated since sonata-project/admin-bundle 3.82.',
PropertyAccessorInterface::class,
__METHOD__
), E_USER_DEPRECATED);
), \E_USER_DEPRECATED);
}

// NEXT_MAJOR: Remove next line.
Expand Down Expand Up @@ -218,7 +218,7 @@ public function getGroups()
@trigger_error(sprintf(
'Method "%s()" is deprecated since sonata-project/admin-bundle 3.83 and will be removed in version 4.0.',
__METHOD__
), E_USER_DEPRECATED);
), \E_USER_DEPRECATED);

$groups = $this->adminGroups;

Expand Down Expand Up @@ -247,7 +247,7 @@ public function hasGroup($group)
@trigger_error(sprintf(
'Method "%s()" is deprecated since sonata-project/admin-bundle 3.83 and will be removed in version 4.0.',
__METHOD__
), E_USER_DEPRECATED);
), \E_USER_DEPRECATED);

return isset($this->adminGroups[$group]);
}
Expand Down Expand Up @@ -313,7 +313,7 @@ public function getAdminsByGroup($group)
@trigger_error(sprintf(
'Method "%s()" is deprecated since sonata-project/admin-bundle 3.83 and will be removed in version 4.0.',
__METHOD__
), E_USER_DEPRECATED);
), \E_USER_DEPRECATED);

if (!isset($this->adminGroups[$group])) {
throw new \InvalidArgumentException(sprintf('Group "%s" not found in admin pool.', $group));
Expand Down Expand Up @@ -354,7 +354,7 @@ public function getAdminByClass($class)
__METHOD__,
$class,
__CLASS__
), E_USER_DEPRECATED);
), \E_USER_DEPRECATED);

// NEXT_MAJOR : remove the previous `trigger_error()` call, the `return null` statement,
// uncomment the following exception and declare AdminInterface as return type
Expand Down Expand Up @@ -417,7 +417,7 @@ public function getAdminByAdminCode($adminCode)
.' sonata-project/admin-bundle 3.51 and will cause a %s in 4.0.',
__METHOD__,
\TypeError::class
), E_USER_DEPRECATED);
), \E_USER_DEPRECATED);

return false;

Expand All @@ -441,7 +441,7 @@ public function getAdminByAdminCode($adminCode)
'Passing an invalid admin code as argument 1 for %s() is deprecated since'
.' sonata-project/admin-bundle 3.50 and will throw an exception in 4.0.',
__METHOD__
), E_USER_DEPRECATED);
), \E_USER_DEPRECATED);

// NEXT_MAJOR : throw `\InvalidArgumentException` instead
}
Expand All @@ -451,7 +451,7 @@ public function getAdminByAdminCode($adminCode)
'Passing an invalid admin hierarchy inside argument 1 for %s() is deprecated since'
.' sonata-project/admin-bundle 3.51 and will throw an exception in 4.0.',
__METHOD__
), E_USER_DEPRECATED);
), \E_USER_DEPRECATED);

// NEXT_MAJOR : remove the previous `trigger_error()` call, uncomment the following exception and declare AdminInterface as return type
// throw new \InvalidArgumentException(sprintf(
Expand Down Expand Up @@ -549,7 +549,7 @@ public function getContainer()
@trigger_error(sprintf(
'Method "%s()" is deprecated since sonata-project/admin-bundle 3.77 and will be removed in version 4.0.',
__METHOD__
), E_USER_DEPRECATED);
), \E_USER_DEPRECATED);
}

return $this->container;
Expand All @@ -572,7 +572,7 @@ public function setAdminGroups(array $adminGroups)
@trigger_error(sprintf(
'Method "%s()" is deprecated since sonata-project/admin-bundle 3.86 and will be removed in version 4.0.',
__METHOD__
), E_USER_DEPRECATED);
), \E_USER_DEPRECATED);
}

$this->adminGroups = $adminGroups;
Expand Down Expand Up @@ -600,7 +600,7 @@ public function setAdminServiceIds(array $adminServiceIds)
@trigger_error(sprintf(
'Method "%s()" is deprecated since sonata-project/admin-bundle 3.86 and will be removed in version 4.0.',
__METHOD__
), E_USER_DEPRECATED);
), \E_USER_DEPRECATED);
}

$this->adminServiceIds = $adminServiceIds;
Expand Down Expand Up @@ -632,7 +632,7 @@ public function setAdminClasses(array $adminClasses)
@trigger_error(sprintf(
'Method "%s()" is deprecated since sonata-project/admin-bundle 3.86 and will be removed in version 4.0.',
__METHOD__
), E_USER_DEPRECATED);
), \E_USER_DEPRECATED);
}

$this->adminClasses = $adminClasses;
Expand Down Expand Up @@ -705,7 +705,7 @@ public function getTitleLogo()
.' Use "%s::getLogo()" instead.',
__METHOD__,
SonataConfiguration::class
), E_USER_DEPRECATED);
), \E_USER_DEPRECATED);

return $this->titleLogo;
}
Expand All @@ -724,7 +724,7 @@ public function getTitle()
.' Use "%s::getTitle()" instead.',
__METHOD__,
SonataConfiguration::class
), E_USER_DEPRECATED);
), \E_USER_DEPRECATED);

return $this->title;
}
Expand All @@ -746,7 +746,7 @@ public function getOption($name, $default = null)
.' Use "%s::getOption()" instead.',
__METHOD__,
SonataConfiguration::class
), E_USER_DEPRECATED);
), \E_USER_DEPRECATED);

if (isset($this->options[$name])) {
return $this->options[$name];
Expand All @@ -763,7 +763,7 @@ public function getPropertyAccessor()
@trigger_error(sprintf(
'The "%s" method is deprecated since version 3.82 and will be removed in 4.0.',
__METHOD__
), E_USER_DEPRECATED);
), \E_USER_DEPRECATED);

if (null === $this->propertyAccessor) {
$this->propertyAccessor = PropertyAccess::createPropertyAccessor();
Expand Down
2 changes: 1 addition & 1 deletion src/Block/AdminListBlockService.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function __construct(
null === $poolOrTemplating ? 'null' : EngineInterface::class,
__METHOD__,
Pool::class
), E_USER_DEPRECATED);
), \E_USER_DEPRECATED);

if (!$templateRegistryOrPool instanceof Pool) {
throw new \TypeError(sprintf(
Expand Down
4 changes: 2 additions & 2 deletions src/Block/AdminSearchBlockService.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function __construct($twigOrName, ?object $poolOrTemplating, object $sear
'Not passing a string as argument 4 to %s() is deprecated since sonata-project/admin-bundle 3.81'
.' and will throw a \TypeError in version 4.0.',
__METHOD__
), E_USER_DEPRECATED);
), \E_USER_DEPRECATED);
}

$this->pool = $poolOrTemplating;
Expand All @@ -102,7 +102,7 @@ public function __construct($twigOrName, ?object $poolOrTemplating, object $sear
null === $poolOrTemplating ? 'null' : EngineInterface::class,
__METHOD__,
Pool::class
), E_USER_DEPRECATED);
), \E_USER_DEPRECATED);

if (!$searchHandlerOrPool instanceof Pool) {
throw new \TypeError(sprintf(
Expand Down
2 changes: 1 addition & 1 deletion src/Block/AdminStatsBlockService.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function __construct($twigOrName, ?object $poolOrTemplating, ?Pool $pool
null === $poolOrTemplating ? 'null' : EngineInterface::class,
__METHOD__,
Pool::class
), E_USER_DEPRECATED);
), \E_USER_DEPRECATED);

if (null === $pool) {
throw new \TypeError(sprintf(
Expand Down
2 changes: 1 addition & 1 deletion src/Command/CreateClassCacheCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
@trigger_error(sprintf(
'The %s\CreateClassCacheCommand class is deprecated since version 3.39.0 and will be removed in 4.0.',
__NAMESPACE__
), E_USER_DEPRECATED);
), \E_USER_DEPRECATED);

/**
* NEXT_MAJOR: Remove this class.
Expand Down
8 changes: 4 additions & 4 deletions src/Command/GenerateObjectAclCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function __construct(Pool $pool, array $aclObjectManipulators, $registry
@trigger_error(sprintf(
'Passing a third argument to %s() is deprecated since sonata-project/admin-bundle 3.77.',
__METHOD__
), E_USER_DEPRECATED);
), \E_USER_DEPRECATED);

if (!$registry instanceof RegistryInterface && !$registry instanceof ManagerRegistry) {
throw new \TypeError(sprintf(
Expand Down Expand Up @@ -196,7 +196,7 @@ protected function initialize(InputInterface $input, OutputInterface $output)
@trigger_error(
'Option "user_entity" is deprecated since sonata-project/admin-bundle 3.69 and will be removed in version 4.0.'
.' Use "user_model" option instead.',
E_USER_DEPRECATED
\E_USER_DEPRECATED
);

if (null === $input->getOption('user_model')) {
Expand Down Expand Up @@ -225,7 +225,7 @@ protected function getUserEntityClass(InputInterface $input, OutputInterface $ou
.' Use %s::getUserModelClass() instead.',
__METHOD__,
__CLASS__
), E_USER_DEPRECATED);
), \E_USER_DEPRECATED);
}

if ('' === $this->userEntityClass) {
Expand All @@ -247,7 +247,7 @@ protected function getUserEntityClass(InputInterface $input, OutputInterface $ou
.' sonata-project/admin-bundle 3.77 and will throw an exception in 4.0.'
.' Pass a fully qualified class name instead (e.g. App\Model\User).',
$userModelFromInput
), E_USER_DEPRECATED);
), \E_USER_DEPRECATED);

// throw new \InvalidArgumentException(sprintf(
// 'The "user_model" name be a fully qualified class name'
Expand Down
2 changes: 1 addition & 1 deletion src/Command/Validators.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public static function validateEntityName($shortcut)
'Method "%s()" is deprecated since sonata-project/admin-bundle 3.78'
.' and will be removed in version 4.0.',
__METHOD__
), E_USER_DEPRECATED);
), \E_USER_DEPRECATED);

$model = str_replace('/', '\\', $shortcut);

Expand Down
Loading