3
3
/*
4
4
* This file is part of php-cache\cache-bundle package.
5
5
*
6
- * (c) 2015-2015 Aaron Scherer <[email protected] >
6
+ * (c) 2015-2015 Aaron Scherer <[email protected] >, Tobias Nyholm <[email protected] >
7
7
*
8
8
* This source file is subject to the MIT license that is bundled
9
9
* with this source code in the file LICENSE.
@@ -56,21 +56,21 @@ protected function configure()
56
56
*/
57
57
protected function execute (InputInterface $ input , OutputInterface $ output )
58
58
{
59
- if (false ===$ type = $ this ->verifyArguments ($ input , $ output )) {
59
+ if (false === $ type = $ this ->verifyArguments ($ input , $ output )) {
60
60
return 0 ;
61
61
}
62
62
63
63
$ builtInTypes = ['session ' , 'router ' , 'doctrine ' ];
64
64
if (in_array ($ type , $ builtInTypes )) {
65
- return $ this ->clearCacheForBuiltInType ($ type )? 0 : 1 ;
65
+ return $ this ->clearCacheForBuiltInType ($ type ) ? 0 : 1 ;
66
66
}
67
67
68
68
if ($ type === 'symfony ' ) {
69
- return $ this ->clearSymfonyCache ($ output )? 0 : 1 ;
69
+ return $ this ->clearSymfonyCache ($ output ) ? 0 : 1 ;
70
70
}
71
71
72
72
if ($ type === 'provider ' ) {
73
- return $ this ->clearCacheForProvider ($ input ->getArgument ('service ' ))? 0 : 1 ;
73
+ return $ this ->clearCacheForProvider ($ input ->getArgument ('service ' )) ? 0 : 1 ;
74
74
}
75
75
76
76
if ($ type === 'all ' ) {
@@ -80,7 +80,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
80
80
}
81
81
$ result = $ result && $ this ->clearSymfonyCache ($ output );
82
82
83
- return $ result? 0 : 1 ;
83
+ return $ result ? 0 : 1 ;
84
84
}
85
85
}
86
86
@@ -129,8 +129,7 @@ private function clearTypedCacheFromService($type, $serviceId)
129
129
}
130
130
131
131
/**
132
- *
133
- * @param InputInterface $input
132
+ * @param InputInterface $input
134
133
* @param OutputInterface $output
135
134
*
136
135
* @return string|bool type or false if invalid arguements
@@ -140,7 +139,7 @@ protected function verifyArguments(InputInterface $input, OutputInterface $outpu
140
139
$ type = $ input ->getArgument ('type ' );
141
140
if ($ type === null ) {
142
141
// ask a question and default $type='all'
143
- $ helper = $ this ->getHelper ('question ' );
142
+ $ helper = $ this ->getHelper ('question ' );
144
143
$ question = new ConfirmationQuestion ('Do you want to clear all cache? [N] ' , false );
145
144
146
145
if (!$ helper ->ask ($ input , $ output , $ question )) {
@@ -194,10 +193,10 @@ protected function clearCacheForProvider($serviceId)
194
193
*/
195
194
protected function clearSymfonyCache (OutputInterface $ output )
196
195
{
197
- $ command = $ this ->getApplication ()->find ('cache:clear ' );
198
- $ arguments = array (
196
+ $ command = $ this ->getApplication ()->find ('cache:clear ' );
197
+ $ arguments = [
199
198
'command ' => 'cache:clear ' ,
200
- ) ;
199
+ ] ;
201
200
202
201
return $ command ->run (new ArrayInput ($ arguments ), $ output ) === 0 ;
203
202
}
0 commit comments