-
Notifications
You must be signed in to change notification settings - Fork 84
Replace deprecated Command::$defaultName #582
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
---|---|---|
|
@@ -12,7 +12,7 @@ | |
namespace FOS\HttpCacheBundle\Command; | ||
|
||
use FOS\HttpCache\CacheInvalidator; | ||
use FOS\HttpCacheBundle\CacheManager; | ||
use Symfony\Component\Console\Attribute\AsCommand; | ||
use Symfony\Component\Console\Input\InputInterface; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
|
||
|
@@ -21,29 +21,18 @@ | |
* | ||
* @author Alexander Schranz <[email protected]> | ||
*/ | ||
#[AsCommand(name: 'fos:httpcache:clear')] | ||
class ClearCommand extends BaseInvalidateCommand | ||
{ | ||
use PathSanityCheck; | ||
|
||
protected static $defaultName = 'fos:httpcache:clear'; | ||
|
||
/** | ||
* If no cache manager is specified explicitly, fos_http_cache.cache_manager | ||
* is automatically loaded. | ||
* | ||
* @param CacheManager|null $cacheManager The cache manager to talk to | ||
*/ | ||
public function __construct(CacheManager $cacheManager = null) | ||
{ | ||
parent::__construct($cacheManager); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
protected function configure() | ||
{ | ||
$this | ||
->setName('fos:httpcache:clear') | ||
->setDescription('Clear the HTTP cache.') | ||
->setHelp( | ||
<<<'EOF' | ||
|
This file contains hidden or 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 |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
namespace FOS\HttpCacheBundle\Command; | ||
|
||
use FOS\HttpCacheBundle\CacheManager; | ||
use Symfony\Component\Console\Attribute\AsCommand; | ||
use Symfony\Component\Console\Input\InputArgument; | ||
use Symfony\Component\Console\Input\InputInterface; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
|
@@ -21,12 +22,11 @@ | |
* | ||
* @author David Buchmann <[email protected]> | ||
*/ | ||
#[AsCommand(name: 'fos:httpcache:invalidate:path')] | ||
class InvalidatePathCommand extends BaseInvalidateCommand | ||
{ | ||
use PathSanityCheck; | ||
|
||
protected static $defaultName = 'fos:httpcache:invalidate:path'; | ||
|
||
/** | ||
* If no cache manager is specified explicitly, fos_http_cache.cache_manager | ||
* is automatically loaded. | ||
|
@@ -35,11 +35,12 @@ class InvalidatePathCommand extends BaseInvalidateCommand | |
*/ | ||
public function __construct(CacheManager $cacheManager = null) | ||
{ | ||
parent::__construct($cacheManager); | ||
|
||
if (2 <= func_num_args()) { | ||
@trigger_error('Passing a command name in the constructor is deprecated and will be removed in version 3', E_USER_DEPRECATED); | ||
static::$defaultName = func_get_arg(1); | ||
$this->setName(func_get_arg(1)); | ||
} | ||
parent::__construct($cacheManager); | ||
} | ||
|
||
/** | ||
|
@@ -48,6 +49,7 @@ public function __construct(CacheManager $cacheManager = null) | |
protected function configure() | ||
{ | ||
$this | ||
->setName('fos:httpcache:invalidate:path') | ||
->setDescription('Invalidate cached paths on all configured caching proxies') | ||
->addArgument( | ||
'paths', | ||
|
This file contains hidden or 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 |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
namespace FOS\HttpCacheBundle\Command; | ||
|
||
use FOS\HttpCacheBundle\CacheManager; | ||
use Symfony\Component\Console\Attribute\AsCommand; | ||
use Symfony\Component\Console\Input\InputArgument; | ||
use Symfony\Component\Console\Input\InputInterface; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
|
@@ -22,10 +23,9 @@ | |
* @author Christian Stocker <[email protected]> | ||
* @author David Buchmann <[email protected]> | ||
*/ | ||
#[AsCommand(name: 'fos:httpcache:invalidate:regex')] | ||
class InvalidateRegexCommand extends BaseInvalidateCommand | ||
{ | ||
protected static $defaultName = 'fos:httpcache:invalidate:regex'; | ||
|
||
/** | ||
* If no cache manager is specified explicitly, fos_http_cache.cache_manager | ||
* is automatically loaded. | ||
|
@@ -34,11 +34,12 @@ class InvalidateRegexCommand extends BaseInvalidateCommand | |
*/ | ||
public function __construct(CacheManager $cacheManager = null, $commandName = 'fos:httpcache:invalidate:regex') | ||
{ | ||
parent::__construct($cacheManager); | ||
|
||
if (2 <= func_num_args()) { | ||
@trigger_error('Passing a command name in the constructor is deprecated and will be removed in version 3', E_USER_DEPRECATED); | ||
static::$defaultName = func_get_arg(1); | ||
$this->setName(func_get_arg(1)); | ||
XWB marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
parent::__construct($cacheManager); | ||
} | ||
|
||
/** | ||
|
@@ -47,6 +48,7 @@ public function __construct(CacheManager $cacheManager = null, $commandName = 'f | |
protected function configure() | ||
{ | ||
$this | ||
->setName('fos:httpcache:invalidate:regex') | ||
->setDescription('Invalidate everything matching a regular expression on all configured caching proxies') | ||
->addArgument( | ||
'regex', | ||
|
This file contains hidden or 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 |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
namespace FOS\HttpCacheBundle\Command; | ||
|
||
use FOS\HttpCacheBundle\CacheManager; | ||
use Symfony\Component\Console\Attribute\AsCommand; | ||
use Symfony\Component\Console\Input\InputArgument; | ||
use Symfony\Component\Console\Input\InputInterface; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
|
@@ -21,10 +22,9 @@ | |
* | ||
* @author David Buchmann <[email protected]> | ||
*/ | ||
#[AsCommand(name: 'fos:httpcache:invalidate:tag')] | ||
class InvalidateTagCommand extends BaseInvalidateCommand | ||
{ | ||
protected static $defaultName = 'fos:httpcache:invalidate:tag'; | ||
|
||
/** | ||
* If no cache manager is specified explicitly, fos_http_cache.cache_manager | ||
* is automatically loaded. | ||
|
@@ -33,11 +33,12 @@ class InvalidateTagCommand extends BaseInvalidateCommand | |
*/ | ||
public function __construct(CacheManager $cacheManager = null, $commandName = 'fos:httpcache:invalidate:tag') | ||
{ | ||
parent::__construct($cacheManager); | ||
|
||
if (2 <= func_num_args()) { | ||
@trigger_error('Passing a command name in the constructor is deprecated and will be removed in version 3', E_USER_DEPRECATED); | ||
static::$defaultName = func_get_arg(1); | ||
$this->setName(func_get_arg(1)); | ||
XWB marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
parent::__construct($cacheManager); | ||
} | ||
|
||
/** | ||
|
@@ -46,6 +47,7 @@ public function __construct(CacheManager $cacheManager = null, $commandName = 'f | |
protected function configure() | ||
{ | ||
$this | ||
->setName('fos:httpcache:invalidate:tag') | ||
->setDescription('Invalidate cached content matching the specified tags on all configured caching proxies') | ||
->addArgument( | ||
'tags', | ||
|
This file contains hidden or 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 |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
namespace FOS\HttpCacheBundle\Command; | ||
|
||
use FOS\HttpCacheBundle\CacheManager; | ||
use Symfony\Component\Console\Attribute\AsCommand; | ||
use Symfony\Component\Console\Input\InputArgument; | ||
use Symfony\Component\Console\Input\InputInterface; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
|
@@ -21,12 +22,11 @@ | |
* | ||
* @author David Buchmann <[email protected]> | ||
*/ | ||
#[AsCommand(name: 'fos:httpcache:refresh:path')] | ||
class RefreshPathCommand extends BaseInvalidateCommand | ||
{ | ||
use PathSanityCheck; | ||
|
||
protected static $defaultName = 'fos:httpcache:refresh:path'; | ||
|
||
/** | ||
* If no cache manager is specified explicitly, fos_http_cache.cache_manager | ||
* is automatically loaded. | ||
|
@@ -35,11 +35,12 @@ class RefreshPathCommand extends BaseInvalidateCommand | |
*/ | ||
public function __construct(CacheManager $cacheManager = null) | ||
{ | ||
parent::__construct($cacheManager); | ||
|
||
if (2 <= func_num_args()) { | ||
@trigger_error('Passing a command name in the constructor is deprecated and will be removed in version 3', E_USER_DEPRECATED); | ||
static::$defaultName = func_get_arg(1); | ||
$this->setName(func_get_arg(1)); | ||
XWB marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
parent::__construct($cacheManager); | ||
} | ||
|
||
/** | ||
|
@@ -48,6 +49,7 @@ public function __construct(CacheManager $cacheManager = null) | |
protected function configure() | ||
{ | ||
$this | ||
->setName('fos:httpcache:refresh:path') | ||
->setDescription('Refresh paths on all configured caching proxies') | ||
->addArgument( | ||
'paths', | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.