Skip to content

Commit

Permalink
enhancement: Improve deprecation logging
Browse files Browse the repository at this point in the history
  • Loading branch information
chapterjason committed Aug 2, 2021
1 parent fe6e9c5 commit bc6c33e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"require": {
"php": "^5.5 || ^7.0 || ^8.0",
"symfony/dependency-injection": "^3.4 || ^4.3 || ^5.0 || ^6.0",
"symfony/deprecation-contracts": "^2.4",
"symfony/framework-bundle": "^3.4.24 || ^4.3 || ^5.0 || ^6.0",
"symfony/http-kernel": "^3.4 || ^4.3 || ^5.0 || ^6.0",
"symfony/yaml": "^3.4 || ^4.3 || ^5.0 || ^6.0"
Expand Down
2 changes: 1 addition & 1 deletion src/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function __construct(/*string $environment, bool $debug*/)
$args = \func_get_args();

if (1 === \func_num_args()) {
trigger_deprecation('nyholm/symfony-bundle-test', '1.9', 'The signature of the "%s($cachePrefix)" constructor is deprecated, use the constructor with 2 arguments: "string $environment, bool $debug".', self::class);
printf('The signature of the method "%s($cachePrefix)" is deprecated since 1.9 and will be removed in 2.0, use with 2 arguments instead: "string $environment, bool $debug".', __METHOD__);

parent::__construct($args[0], true);
} elseif (2 === \func_num_args()) {
Expand Down
2 changes: 1 addition & 1 deletion src/BaseBundleTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Symfony\Component\DependencyInjection\ResettableContainerInterface;
use Symfony\Component\HttpKernel\Kernel;

trigger_deprecation('nyholm/symfony-bundle-test', '1.9', 'Deprecated since 1.9 and will be removed in 2.0, use %s instead.', KernelTestCase::class);
printf('%s is deprecated since 1.9 and will be removed in 2.0, use "%s" instead.', BaseBundleTestCase::class, KernelTestCase::class);

/**
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
Expand Down

0 comments on commit bc6c33e

Please sign in to comment.