forked from sonata-project/SonataAdminBundle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow symfony config, dependency-injection and routing 5.1
Symfony/config 5.1 introduces a deprecation notice when calling setDeprecation() with less than 3 args. An internal helper class has been added as a BC layer.
- Loading branch information
1 parent
3ad3910
commit 7cc6f5b
Showing
7 changed files
with
75 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the Sonata Project package. | ||
* | ||
* (c) Thomas Rabaix <thomas.rabaix@sonata-project.org> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Sonata\AdminBundle\Util; | ||
|
||
use Symfony\Component\Config\Definition\BaseNode; | ||
|
||
/** | ||
* This class is a BC layer for deprecation messages for symfony/config < 5.1. | ||
* Remove this class when dropping support for symfony/config < 5.1. | ||
* | ||
* @internal | ||
*/ | ||
final class BCDeprecationParameters | ||
{ | ||
/** | ||
* @return string[] | ||
*/ | ||
public static function forConfig(string $message, string $version): array | ||
{ | ||
if (method_exists(BaseNode::class, 'getDeprecation')) { | ||
return [ | ||
'sonata-project/admin-bundle', | ||
$version, | ||
$message, | ||
]; | ||
} | ||
|
||
return [$message]; | ||
} | ||
} |