Skip to content

Commit 759bd42

Browse files
committed
Phpstan: fix missing sfTask* return statement
1 parent 561b269 commit 759bd42

31 files changed

+67
-1
lines changed

lib/task/app/sfAppRoutesTask.class.php

+2
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ protected function execute($arguments = [], $options = [])
4747

4848
// display
4949
$arguments['name'] ? $this->outputRoute($arguments['application'], $arguments['name']) : $this->outputRoutes($arguments['application']);
50+
51+
return 0;
5052
}
5153

5254
protected function outputRoutes($application)

lib/task/cache/sfCacheClearTask.class.php

+2
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ protected function execute($arguments = [], $options = [])
154154
if (null === $options['app'] && 'all' == $options['type']) {
155155
$this->getFilesystem()->remove(sfFinder::type('file')->discard('.*')->in(sfConfig::get('sf_cache_dir')));
156156
}
157+
158+
return 0;
157159
}
158160

159161
protected function getClearCacheMethod($type)

lib/task/configure/sfConfigureAuthorTask.class.php

+2
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,7 @@ protected function execute($arguments = [], $options = [])
6363
}
6464

6565
file_put_contents($file, $ini);
66+
67+
return 0;
6668
}
6769
}

lib/task/generator/sfGenerateAppTask.class.php

+2
Original file line numberDiff line numberDiff line change
@@ -153,5 +153,7 @@ protected function execute($arguments = [], $options = [])
153153

154154
// Create test dir
155155
$this->getFilesystem()->mkdirs(sfConfig::get('sf_test_dir').'/functional/'.$app);
156+
157+
return 0;
156158
}
157159
}

lib/task/generator/sfGenerateModuleTask.class.php

+2
Original file line numberDiff line numberDiff line change
@@ -104,5 +104,7 @@ protected function execute($arguments = [], $options = [])
104104
// customize php and yml files
105105
$finder = sfFinder::type('file')->name('*.php', '*.yml');
106106
$this->getFilesystem()->replaceTokens($finder->in($moduleDir), '##', '##', $constants);
107+
108+
return 0;
107109
}
108110
}

lib/task/generator/sfGenerateProjectTask.class.php

+2
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ protected function execute($arguments = [], $options = [])
137137
$fixPerms->run();
138138

139139
$this->replaceTokens();
140+
141+
return 0;
140142
}
141143

142144
protected function canRunInstaller($installer)

lib/task/generator/sfGenerateTaskTask.class.php

+2
Original file line numberDiff line numberDiff line change
@@ -178,5 +178,7 @@ protected function execute(\$arguments = array(), \$options = array())
178178

179179
$this->logSection('task', sprintf('Creating "%s" task file', $taskFile));
180180
file_put_contents($taskFile, $content);
181+
182+
return 0;
181183
}
182184
}

lib/task/help/sfHelpTask.class.php

+2
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ protected function execute($arguments = [], $options = [])
5757
} else {
5858
$this->outputAsText($task);
5959
}
60+
61+
return 0;
6062
}
6163

6264
protected function outputAsText(sfTask $task)

lib/task/help/sfListTask.class.php

+2
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ protected function execute($arguments = [], $options = [])
7373
} else {
7474
$this->outputAsText($arguments['namespace'], $tasks);
7575
}
76+
77+
return 0;
7678
}
7779

7880
protected function outputAsText($namespace, $tasks)

lib/task/i18n/sfI18nExtractTask.class.php

+2
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ public function execute($arguments = [], $options = [])
6666

6767
$extract->deleteOldMessages();
6868
}
69+
70+
return 0;
6971
}
7072

7173
/**

lib/task/i18n/sfI18nFindTask.class.php

+2
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ public function execute($arguments = [], $options = [])
8585
$this->log(" {$message}\n");
8686
}
8787
}
88+
89+
return 0;
8890
}
8991

9092
/**

lib/task/log/sfLogClearTask.class.php

+2
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,7 @@ protected function execute($arguments = [], $options = [])
3838
{
3939
$logs = sfFinder::type('file')->in(sfConfig::get('sf_log_dir'));
4040
$this->getFilesystem()->remove($logs);
41+
42+
return 0;
4143
}
4244
}

lib/task/log/sfLogRotateTask.class.php

+2
Original file line numberDiff line numberDiff line change
@@ -143,5 +143,7 @@ protected function configure()
143143
protected function execute($arguments = [], $options = [])
144144
{
145145
$this->rotate($arguments['application'], $arguments['env'], $options['period'], $options['history'], true);
146+
147+
return 0;
146148
}
147149
}

lib/task/plugin/sfPluginAddChannelTask.class.php

+2
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,7 @@ protected function execute($arguments = [], $options = [])
4646
$this->logSection('plugin', sprintf('add channel "%s"', $arguments['name']));
4747

4848
$this->getPluginManager()->getEnvironment()->registerChannel($arguments['name']);
49+
50+
return 0;
4951
}
5052
}

lib/task/plugin/sfPluginInstallTask.class.php

+2
Original file line numberDiff line numberDiff line change
@@ -111,5 +111,7 @@ protected function execute($arguments = [], $options = [])
111111
}
112112

113113
$this->getPluginManager()->installPlugin($arguments['name'], $options);
114+
115+
return 0;
114116
}
115117
}

lib/task/plugin/sfPluginListTask.class.php

+2
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,7 @@ protected function execute($arguments = [], $options = [])
4747
$alias = $this->getPluginManager()->getEnvironment()->getRegistry()->getChannel($package->getChannel())->getAlias();
4848
$this->log(sprintf(' %-40s %10s-%-6s %s', $this->formatter->format($package->getPackage(), 'INFO'), $package->getVersion(), $package->getState() ?: null, $this->formatter->format(sprintf('# %s (%s)', $package->getChannel(), $alias), 'COMMENT')));
4949
}
50+
51+
return 0;
5052
}
5153
}

lib/task/plugin/sfPluginPublishAssetsTask.class.php

+2
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ protected function execute($arguments = [], $options = [])
7777
$this->logSection('plugin', 'Configuring plugin - '.$plugin);
7878
$this->installPluginAssets($plugin, $pluginConfiguration->getRootDir(), $options['relative']);
7979
}
80+
81+
return 0;
8082
}
8183

8284
/**

lib/task/plugin/sfPluginUninstallTask.class.php

+2
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,7 @@ protected function execute($arguments = [], $options = [])
7070
$this->logSection('plugin', sprintf('uninstalling plugin "%s"', $arguments['name']));
7171

7272
$this->getPluginManager()->uninstallPlugin($arguments['name'], $options['channel']);
73+
74+
return 0;
7375
}
7476
}

lib/task/plugin/sfPluginUpgradeTask.class.php

+2
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,7 @@ protected function execute($arguments = [], $options = [])
5959
$this->logSection('plugin', sprintf('upgrading plugin "%s"', $arguments['name']));
6060

6161
$this->getPluginManager()->installPlugin($arguments['name'], $options);
62+
63+
return 0;
6264
}
6365
}

lib/task/project/sfProjectClearControllersTask.class.php

+2
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,7 @@ protected function execute($arguments = [], $options = [])
6868
}
6969
}
7070
}
71+
72+
return 0;
7173
}
7274
}

lib/task/project/sfProjectDeployTask.class.php

+2
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,8 @@ protected function execute($arguments = [], $options = [])
170170
$this->getFilesystem()->execute($command, $options['trace'] ? [$this, 'logOutput'] : null, [$this, 'logErrors']);
171171

172172
$this->clearBuffers();
173+
174+
return 0;
173175
}
174176

175177
protected function clearBuffers()

lib/task/project/sfProjectDisableTask.class.php

+2
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,7 @@ protected function execute($arguments = [], $options = [])
6565
$this->logSection('enable', sprintf('%s [%s] has been DISABLED', $app, $env));
6666
}
6767
}
68+
69+
return 0;
6870
}
6971
}

lib/task/project/sfProjectEnableTask.class.php

+2
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,7 @@ protected function execute($arguments = [], $options = [])
7070
$this->logSection('enable', sprintf('%s [%s] has been ENABLED', $app, $env));
7171
}
7272
}
73+
74+
return 0;
7375
}
7476
}

lib/task/project/sfProjectOptimizeTask.class.php

+2
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ protected function execute($arguments = [], $options = [])
9090
file_put_contents($target, '<?php return '.var_export($data, true).';');
9191

9292
umask($current_umask);
93+
94+
return 0;
9395
}
9496

9597
protected function optimizeGetControllerDirs($modules)

lib/task/project/sfProjectPermissionsTask.class.php

+4
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,11 @@ protected function execute($arguments = [], $options = [])
7979
['Permissions on the following file(s) could not be fixed:', ''],
8080
array_map(function ($f) { return ' - '.sfDebug::shortenFilePath($f); }, $this->failed)
8181
), 'ERROR_LARGE');
82+
83+
return 1;
8284
}
85+
86+
return 0;
8387
}
8488

8589
/**

lib/task/project/sfProjectSendEmailsTask.class.php

+2
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,7 @@ protected function execute($arguments = [], $options = [])
5858
$sent = $this->getMailer()->flushQueue();
5959

6060
$this->logSection('project', sprintf('sent %s emails', $sent));
61+
62+
return 0;
6163
}
6264
}

lib/task/project/sfProjectValidateTask.class.php

+2
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ protected function execute($arguments = [], $options = [])
6666

6767
$this->log($v->getExplanation());
6868
}
69+
70+
return 0;
6971
}
7072

7173
protected function formatFile($file)

lib/task/sfBaseTask.class.php

+6
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ public function checkProjectExists()
5959
if (!file_exists('symfony')) {
6060
throw new sfException('You must be in a symfony project directory.');
6161
}
62+
63+
return true;
6264
}
6365

6466
/**
@@ -75,6 +77,8 @@ public function checkAppExists($app)
7577
if (!is_dir(sfConfig::get('sf_apps_dir').'/'.$app)) {
7678
throw new sfException(sprintf('Application "%s" does not exist', $app));
7779
}
80+
81+
return true;
7882
}
7983

8084
/**
@@ -92,6 +96,8 @@ public function checkModuleExists($app, $module)
9296
if (!is_dir(sfConfig::get('sf_apps_dir').'/'.$app.'/modules/'.$module)) {
9397
throw new sfException(sprintf('Module "%s/%s" does not exist.', $app, $module));
9498
}
99+
100+
return true;
95101
}
96102

97103
/**

lib/task/test/sfTestCoverageTask.class.php

+2
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ protected function execute($arguments = [], $options = [])
6565

6666
$coveredFiles = $this->getFiles(sfConfig::get('sf_root_dir').'/'.$arguments['lib_name']);
6767
$coverage->output($coveredFiles);
68+
69+
return 0;
6870
}
6971

7072
protected function getTestHarness($harnessOptions = [])

lib/task/test/sfTestFunctionalTask.class.php

+2
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ protected function execute($arguments = [], $options = [])
8383
}
8484
} else {
8585
$this->logSection('functional', 'no controller found', null, 'ERROR');
86+
87+
return 1;
8688
}
8789
} else {
8890
require_once __DIR__.'/sfLimeHarness.class.php';

lib/task/test/sfTestPluginTask.class.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,6 @@ protected function execute($arguments = [], $options = [])
6767
$finder = sfFinder::type('file')->follow_link()->name('*Test.php');
6868
$h->register($finder->in($h->base_dir));
6969

70-
$h->run();
70+
return $h->run();
7171
}
7272
}

0 commit comments

Comments
 (0)