Skip to content

Commit

Permalink
Fix deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
zonky2 committed Aug 7, 2024
1 parent 2402929 commit d56fdd6
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 25 deletions.
6 changes: 3 additions & 3 deletions src/Contao/Factory/SessionStorageFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* This file is part of contao-community-alliance/dc-general.
*
* (c) 2013-2023 Contao Community Alliance.
* (c) 2013-2024 Contao Community Alliance.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -13,7 +13,7 @@
* @package contao-community-alliance/dc-general
* @author Sven Baumann <[email protected]>
* @author Ingolf Steinhardt <[email protected]>
* @copyright 2013-2023 Contao Community Alliance.
* @copyright 2013-2024 Contao Community Alliance.
* @license https://github.com/contao-community-alliance/dc-general/blob/master/LICENSE LGPL-3.0-or-later
* @filesource
*/
Expand All @@ -34,7 +34,7 @@ class SessionStorageFactory
*
* @var ContainerInterface
*/
private $container;
private ContainerInterface $container;

/**
* SessionStorageFactory constructor.
Expand Down
11 changes: 6 additions & 5 deletions src/Contao/Picker/AbstractAwarePickerProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* This file is part of contao-community-alliance/dc-general.
*
* (c) 2013-2022 Contao Community Alliance.
* (c) 2013-2024 Contao Community Alliance.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -13,7 +13,7 @@
* @package contao-community-alliance/dc-general
* @author Sven Baumann <[email protected]>
* @author Ingolf Steinhardt <[email protected]>
* @copyright 2013-2022 Contao Community Alliance.
* @copyright 2013-2024 Contao Community Alliance.
* @license https://github.com/contao-community-alliance/dc-general/blob/master/LICENSE LGPL-3.0-or-later
* @filesource
*/
Expand All @@ -24,6 +24,7 @@
use Contao\CoreBundle\Picker\PickerConfig;
use Contao\CoreBundle\Picker\PickerProviderInterface;
use Knp\Menu\FactoryInterface;
use Knp\Menu\ItemInterface;
use Symfony\Component\Routing\RouterInterface;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
Expand Down Expand Up @@ -78,15 +79,15 @@ public function __construct(FactoryInterface $menuFactory, RouterInterface $rout
/**
* {@inheritdoc}
*/
public function getUrl(PickerConfig $config)
public function getUrl(PickerConfig $config): string
{
return $this->generateUrl($config, false);
}

/**
* {@inheritdoc}
*/
public function createMenuItem(PickerConfig $config)
public function createMenuItem(PickerConfig $config): ItemInterface
{
$name = $this->getName();
return $this->menuFactory->createItem(
Expand Down Expand Up @@ -115,7 +116,7 @@ public function setTokenStorage(TokenStorageInterface $tokenStorage)
/**
* {@inheritdoc}
*/
public function isCurrent(PickerConfig $config)
public function isCurrent(PickerConfig $config): bool
{
return $config->getCurrent() === $this->getName();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Contao/Picker/PagePickerProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function supportsContext($context)
/**
* {@inheritdoc}
*/
public function supportsValue(PickerConfig $config)
public function supportsValue(PickerConfig $config): bool
{
if ('page' === $config->getContext()) {
return \is_numeric($config->getValue());
Expand Down
15 changes: 8 additions & 7 deletions src/Contao/Picker/TreePickerProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* This file is part of contao-community-alliance/dc-general.
*
* (c) 2013-2019 Contao Community Alliance.
* (c) 2013-2024 Contao Community Alliance.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -12,7 +12,8 @@
*
* @package contao-community-alliance/dc-general
* @author Sven Baumann <[email protected]>
* @copyright 2013-2019 Contao Community Alliance.
* @author Ingolf Steinhardt <[email protected]>
* @copyright 2013-2024 Contao Community Alliance.
* @license https://github.com/contao-community-alliance/dc-general/blob/master/LICENSE LGPL-3.0-or-later
* @filesource
*/
Expand All @@ -30,7 +31,7 @@ class TreePickerProvider extends AbstractAwarePickerProvider implements DcaPicke
/**
* {@inheritdoc}
*/
public function getName()
public function getName(): string
{
return 'ccaTreePicker';
}
Expand All @@ -46,7 +47,7 @@ public function supportsContext($context)
/**
* {@inheritdoc}
*/
public function supportsValue(PickerConfig $config)
public function supportsValue(PickerConfig $config): bool
{
if ('cca_tree' === $config->getContext()) {
return is_numeric($config->getValue());
Expand All @@ -58,15 +59,15 @@ public function supportsValue(PickerConfig $config)
/**
* {@inheritdoc}
*/
public function getDcaTable()
public function getDcaTable(): string
{
return 'tl_page';
}

/**
* {@inheritdoc}
*/
public function getDcaAttributes(PickerConfig $config)
public function getDcaAttributes(PickerConfig $config): array
{
$value = $config->getValue();
$attributes = ['fieldType' => 'radio'];
Expand Down Expand Up @@ -97,7 +98,7 @@ public function getDcaAttributes(PickerConfig $config)
/**
* {@inheritdoc}
*/
public function convertDcaValue(PickerConfig $config, $value)
public function convertDcaValue(PickerConfig $config, $value): string|int
{
if ('cca_tree' === $config->getContext()) {
return (int) $value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function __construct(RequestScopeDeterminator $scopeDeterminator)
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents()
public static function getSubscribedEvents(): array
{
return [
DcGeneralEvents::ACTION => ['handleAction'],
Expand Down
6 changes: 3 additions & 3 deletions src/Contao/View/Contao2BackendView/Filter/LanguageFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* This file is part of contao-community-alliance/dc-general.
*
* (c) 2013-2023 Contao Community Alliance.
* (c) 2013-2024 Contao Community Alliance.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -16,7 +16,7 @@
* @author David Molineus <[email protected]>
* @author Sven Baumann <[email protected]>
* @author Ingolf Steinhardt <[email protected]>
* @copyright 2013-2023 Contao Community Alliance.
* @copyright 2013-2024 Contao Community Alliance.
* @license https://github.com/contao-community-alliance/dc-general/blob/master/LICENSE LGPL-3.0-or-later
* @filesource
*/
Expand Down Expand Up @@ -67,7 +67,7 @@ public function __construct(RequestScopeDeterminator $scopeDeterminator)
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents()
public static function getSubscribedEvents(): array
{
return [
DcGeneralEvents::ACTION => [['handleAction', 500]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function __construct(
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents()
public static function getSubscribedEvents(): array
{
return [
BuildDataDefinitionEvent::NAME => [
Expand Down
8 changes: 5 additions & 3 deletions src/ContaoManager/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* This file is part of contao-community-alliance/dc-general.
*
* (c) 2013-2019 Contao Community Alliance.
* (c) 2013-2024 Contao Community Alliance.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -14,7 +14,8 @@
* @author Sven Baumann <[email protected]>
* @author Christian Schiffler <[email protected]>
* @author Richard Henkenjohann <[email protected]>
* @copyright 2013-2019 Contao Community Alliance.
* @author Ingolf Steinhardt <[email protected]>
* @copyright 2013-2024 Contao Community Alliance.
* @license https://github.com/contao-community-alliance/dc-general/blob/master/LICENSE LGPL-3.0-or-later
* @filesource
*/
Expand All @@ -41,7 +42,7 @@ class Plugin implements BundlePluginInterface, RoutingPluginInterface
/**
* {@inheritdoc}
*/
public function getBundles(ParserInterface $parser)
public function getBundles(ParserInterface $parser): array
{
return [
BundleConfig::create(CcaDcGeneralBundle::class)
Expand All @@ -62,6 +63,7 @@ public function getRouteCollection(LoaderResolverInterface $resolver, KernelInte
{
$loader = $resolver->resolve(__DIR__ . '/../Resources/config/routing.yml');
assert($loader instanceof LoaderInterface);

return $loader->load(__DIR__ . '/../Resources/config/routing.yml');
}
}
5 changes: 4 additions & 1 deletion src/Resources/config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ services:

ContaoCommunityAlliance\DcGeneral\Cache\Factory\DcGeneralFactoryCache:
public: true
deprecated: Warning the %service_id% is in future not public!
deprecated:
package: contao-community-alliance/dc-general
version: 2.2
message: 'Warning the %service_id% is in future not public!'

ContaoCommunityAlliance\DcGeneral\Factory\DcGeneralFactoryService:
public: false
Expand Down

0 comments on commit d56fdd6

Please sign in to comment.