Skip to content

Commit

Permalink
[task] fix return statement missing stan errors
Browse files Browse the repository at this point in the history
  • Loading branch information
connorhu committed Mar 21, 2024
1 parent 50c946b commit 3561660
Show file tree
Hide file tree
Showing 31 changed files with 61 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/task/app/sfAppRoutesTask.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ protected function execute($arguments = [], $options = [])

// display
$arguments['name'] ? $this->outputRoute($arguments['application'], $arguments['name']) : $this->outputRoutes($arguments['application']);

return 0;
}

protected function outputRoutes($application)
Expand Down
2 changes: 2 additions & 0 deletions lib/task/cache/sfCacheClearTask.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ protected function execute($arguments = [], $options = [])
if (null === $options['app'] && 'all' == $options['type']) {
$this->getFilesystem()->remove(sfFinder::type('file')->discard('.*')->in(sfConfig::get('sf_cache_dir')));
}

return 0;
}

protected function getClearCacheMethod($type)
Expand Down
2 changes: 2 additions & 0 deletions lib/task/configure/sfConfigureAuthorTask.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,7 @@ protected function execute($arguments = [], $options = [])
}

file_put_contents($file, $ini);

return 0;
}
}
2 changes: 2 additions & 0 deletions lib/task/generator/sfGenerateAppTask.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,5 +153,7 @@ protected function execute($arguments = [], $options = [])

// Create test dir
$this->getFilesystem()->mkdirs(sfConfig::get('sf_test_dir').'/functional/'.$app);

return 0;
}
}
2 changes: 2 additions & 0 deletions lib/task/generator/sfGenerateModuleTask.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,7 @@ protected function execute($arguments = [], $options = [])
// customize php and yml files
$finder = sfFinder::type('file')->name('*.php', '*.yml');
$this->getFilesystem()->replaceTokens($finder->in($moduleDir), '##', '##', $constants);

return 0;
}
}
2 changes: 2 additions & 0 deletions lib/task/generator/sfGenerateProjectTask.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ protected function execute($arguments = [], $options = [])
$fixPerms->run();

$this->replaceTokens();

return 0;
}

protected function canRunInstaller($installer)
Expand Down
2 changes: 2 additions & 0 deletions lib/task/generator/sfGenerateTaskTask.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,5 +178,7 @@ protected function execute(\$arguments = array(), \$options = array())

$this->logSection('task', sprintf('Creating "%s" task file', $taskFile));
file_put_contents($taskFile, $content);

return 0;
}
}
2 changes: 2 additions & 0 deletions lib/task/help/sfHelpTask.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ protected function execute($arguments = [], $options = [])
} else {
$this->outputAsText($task);
}

return 0;
}

protected function outputAsText(sfTask $task)
Expand Down
2 changes: 2 additions & 0 deletions lib/task/help/sfListTask.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ protected function execute($arguments = [], $options = [])
} else {
$this->outputAsText($arguments['namespace'], $tasks);
}

return 0;
}

protected function outputAsText($namespace, $tasks)
Expand Down
2 changes: 2 additions & 0 deletions lib/task/i18n/sfI18nExtractTask.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ public function execute($arguments = [], $options = [])

$extract->deleteOldMessages();
}

return 0;
}

/**
Expand Down
2 changes: 2 additions & 0 deletions lib/task/i18n/sfI18nFindTask.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ public function execute($arguments = [], $options = [])
$this->log(" {$message}\n");
}
}

return 0;
}

/**
Expand Down
2 changes: 2 additions & 0 deletions lib/task/log/sfLogClearTask.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,7 @@ protected function execute($arguments = [], $options = [])
{
$logs = sfFinder::type('file')->in(sfConfig::get('sf_log_dir'));
$this->getFilesystem()->remove($logs);

return 0;
}
}
2 changes: 2 additions & 0 deletions lib/task/log/sfLogRotateTask.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,5 +143,7 @@ protected function configure()
protected function execute($arguments = [], $options = [])
{
$this->rotate($arguments['application'], $arguments['env'], $options['period'], $options['history'], true);

return 0;
}
}
2 changes: 2 additions & 0 deletions lib/task/plugin/sfPluginAddChannelTask.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,7 @@ protected function execute($arguments = [], $options = [])
$this->logSection('plugin', sprintf('add channel "%s"', $arguments['name']));

$this->getPluginManager()->getEnvironment()->registerChannel($arguments['name']);

return 0;
}
}
2 changes: 2 additions & 0 deletions lib/task/plugin/sfPluginInstallTask.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,7 @@ protected function execute($arguments = [], $options = [])
}

$this->getPluginManager()->installPlugin($arguments['name'], $options);

return 0;
}
}
2 changes: 2 additions & 0 deletions lib/task/plugin/sfPluginListTask.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,7 @@ protected function execute($arguments = [], $options = [])
$alias = $this->getPluginManager()->getEnvironment()->getRegistry()->getChannel($package->getChannel())->getAlias();
$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')));
}

return 0;
}
}
2 changes: 2 additions & 0 deletions lib/task/plugin/sfPluginPublishAssetsTask.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ protected function execute($arguments = [], $options = [])
$this->logSection('plugin', 'Configuring plugin - '.$plugin);
$this->installPluginAssets($plugin, $pluginConfiguration->getRootDir(), $options['relative']);
}

return 0;
}

/**
Expand Down
2 changes: 2 additions & 0 deletions lib/task/plugin/sfPluginUninstallTask.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,7 @@ protected function execute($arguments = [], $options = [])
$this->logSection('plugin', sprintf('uninstalling plugin "%s"', $arguments['name']));

$this->getPluginManager()->uninstallPlugin($arguments['name'], $options['channel']);

return 0;
}
}
2 changes: 2 additions & 0 deletions lib/task/plugin/sfPluginUpgradeTask.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,7 @@ protected function execute($arguments = [], $options = [])
$this->logSection('plugin', sprintf('upgrading plugin "%s"', $arguments['name']));

$this->getPluginManager()->installPlugin($arguments['name'], $options);

return 0;
}
}
2 changes: 2 additions & 0 deletions lib/task/project/sfProjectClearControllersTask.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,7 @@ protected function execute($arguments = [], $options = [])
}
}
}

return 0;
}
}
2 changes: 2 additions & 0 deletions lib/task/project/sfProjectDeployTask.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ protected function execute($arguments = [], $options = [])
$this->getFilesystem()->execute($command, $options['trace'] ? [$this, 'logOutput'] : null, [$this, 'logErrors']);

$this->clearBuffers();

return 0;
}

protected function clearBuffers()
Expand Down
2 changes: 2 additions & 0 deletions lib/task/project/sfProjectDisableTask.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,7 @@ protected function execute($arguments = [], $options = [])
$this->logSection('enable', sprintf('%s [%s] has been DISABLED', $app, $env));
}
}

return 0;
}
}
2 changes: 2 additions & 0 deletions lib/task/project/sfProjectEnableTask.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,7 @@ protected function execute($arguments = [], $options = [])
$this->logSection('enable', sprintf('%s [%s] has been ENABLED', $app, $env));
}
}

return 0;
}
}
2 changes: 2 additions & 0 deletions lib/task/project/sfProjectOptimizeTask.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ protected function execute($arguments = [], $options = [])
file_put_contents($target, '<?php return '.var_export($data, true).';');

umask($current_umask);

return 0;
}

protected function optimizeGetControllerDirs($modules)
Expand Down
2 changes: 2 additions & 0 deletions lib/task/project/sfProjectPermissionsTask.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ protected function execute($arguments = [], $options = [])
array_map(function ($f) { return ' - '.sfDebug::shortenFilePath($f); }, $this->failed)
), 'ERROR_LARGE');
}

return 0;
}

/**
Expand Down
2 changes: 2 additions & 0 deletions lib/task/project/sfProjectSendEmailsTask.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,7 @@ protected function execute($arguments = [], $options = [])
$sent = $this->getMailer()->flushQueue();

$this->logSection('project', sprintf('sent %s emails', $sent));

return 0;
}
}
2 changes: 2 additions & 0 deletions lib/task/project/sfProjectValidateTask.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ protected function execute($arguments = [], $options = [])

$this->log($v->getExplanation());
}

return 0;
}

protected function formatFile($file)
Expand Down
2 changes: 2 additions & 0 deletions lib/task/test/sfTestCoverageTask.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ protected function execute($arguments = [], $options = [])

$coveredFiles = $this->getFiles(sfConfig::get('sf_root_dir').'/'.$arguments['lib_name']);
$coverage->output($coveredFiles);

return 0;
}

protected function getTestHarness($harnessOptions = [])
Expand Down
2 changes: 2 additions & 0 deletions lib/task/test/sfTestFunctionalTask.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,7 @@ protected function execute($arguments = [], $options = [])

return $ret;
}

return 0;
}
}
2 changes: 1 addition & 1 deletion lib/task/test/sfTestPluginTask.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ protected function execute($arguments = [], $options = [])
$finder = sfFinder::type('file')->follow_link()->name('*Test.php');
$h->register($finder->in($h->base_dir));

$h->run();
return $h->run() ? 0 : 1;
}
}
2 changes: 2 additions & 0 deletions lib/task/test/sfTestUnitTask.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,7 @@ protected function execute($arguments = [], $options = [])

return $ret;
}

return 0;
}
}

0 comments on commit 3561660

Please sign in to comment.