Checkstyle fix
This commit is contained in:
parent
3022cfb81a
commit
27862d6fb1
|
@ -44,10 +44,8 @@ abstract class AbstractCommand extends ContainerAwareCommand
|
||||||
*/
|
*/
|
||||||
protected $input;
|
protected $input;
|
||||||
|
|
||||||
|
|
||||||
use FormattingHelpers;
|
use FormattingHelpers;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
@ -398,7 +396,7 @@ EOT;
|
||||||
/**
|
/**
|
||||||
* Extract the database name from a given DSN
|
* Extract the database name from a given DSN
|
||||||
*
|
*
|
||||||
* @param string $dsn A DSN
|
* @param string $dsn A DSN
|
||||||
* @return string The database name extracted from the given DSN
|
* @return string The database name extracted from the given DSN
|
||||||
*/
|
*/
|
||||||
protected function parseDbName($dsn)
|
protected function parseDbName($dsn)
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
namespace Propel\PropelBundle\Command;
|
namespace Propel\PropelBundle\Command;
|
||||||
|
|
||||||
use Propel\Runtime\Propel;
|
use Propel\Runtime\Propel;
|
||||||
use Symfony\Component\Console\Input\InputArgument;
|
|
||||||
use Symfony\Component\Console\Input\InputInterface;
|
use Symfony\Component\Console\Input\InputInterface;
|
||||||
use Symfony\Component\Console\Input\InputOption;
|
use Symfony\Component\Console\Input\InputOption;
|
||||||
use Symfony\Component\Console\Output\OutputInterface;
|
use Symfony\Component\Console\Output\OutputInterface;
|
||||||
|
@ -57,6 +56,7 @@ EOT
|
||||||
{
|
{
|
||||||
if (!$input->getOption('force')) {
|
if (!$input->getOption('force')) {
|
||||||
$output->writeln('<error>You have to use the "--force" option to drop the database.</error>');
|
$output->writeln('<error>You have to use the "--force" option to drop the database.</error>');
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,9 +19,6 @@ use Symfony\Component\Filesystem\Filesystem;
|
||||||
use Symfony\Component\Finder\Finder;
|
use Symfony\Component\Finder\Finder;
|
||||||
use Symfony\Component\HttpKernel\Bundle\BundleInterface;
|
use Symfony\Component\HttpKernel\Bundle\BundleInterface;
|
||||||
|
|
||||||
use Propel\PropelBundle\DataFixtures\Loader\YamlDataLoader;
|
|
||||||
use Propel\PropelBundle\DataFixtures\Loader\XmlDataLoader;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* FixturesLoadCommand
|
* FixturesLoadCommand
|
||||||
*
|
*
|
||||||
|
@ -157,8 +154,8 @@ EOT
|
||||||
/**
|
/**
|
||||||
* Load fixtures
|
* Load fixtures
|
||||||
*
|
*
|
||||||
* @param \Symfony\Component\Console\Input\InputInterface $input
|
* @param \Symfony\Component\Console\Input\InputInterface $input
|
||||||
* @param \Symfony\Component\Console\Output\OutputInterface $output
|
* @param \Symfony\Component\Console\Output\OutputInterface $output
|
||||||
*/
|
*/
|
||||||
protected function loadFixtures(InputInterface $input, OutputInterface $output, $type = null)
|
protected function loadFixtures(InputInterface $input, OutputInterface $output, $type = null)
|
||||||
{
|
{
|
||||||
|
@ -201,8 +198,8 @@ EOT
|
||||||
/**
|
/**
|
||||||
* Load SQL fixtures
|
* Load SQL fixtures
|
||||||
*
|
*
|
||||||
* @param \Symfony\Component\Console\Input\InputInterface $input
|
* @param \Symfony\Component\Console\Input\InputInterface $input
|
||||||
* @param \Symfony\Component\Console\Output\OutputInterface $output
|
* @param \Symfony\Component\Console\Output\OutputInterface $output
|
||||||
*/
|
*/
|
||||||
protected function loadSqlFixtures(InputInterface $input, OutputInterface $output)
|
protected function loadSqlFixtures(InputInterface $input, OutputInterface $output)
|
||||||
{
|
{
|
||||||
|
|
|
@ -22,8 +22,8 @@ trait FormattingHelpers
|
||||||
* @see https://github.com/sensio/SensioGeneratorBundle/blob/master/Command/Helper/DialogHelper.php#L52
|
* @see https://github.com/sensio/SensioGeneratorBundle/blob/master/Command/Helper/DialogHelper.php#L52
|
||||||
*
|
*
|
||||||
* @param OutputInterface $output The output.
|
* @param OutputInterface $output The output.
|
||||||
* @param string $text A text message.
|
* @param string $text A text message.
|
||||||
* @param string $style A style to apply on the section.
|
* @param string $style A style to apply on the section.
|
||||||
*/
|
*/
|
||||||
protected function writeSection(OutputInterface $output, $text, $style = 'bg=blue;fg=white')
|
protected function writeSection(OutputInterface $output, $text, $style = 'bg=blue;fg=white')
|
||||||
{
|
{
|
||||||
|
@ -37,9 +37,9 @@ trait FormattingHelpers
|
||||||
/**
|
/**
|
||||||
* Ask confirmation from the user.
|
* Ask confirmation from the user.
|
||||||
*
|
*
|
||||||
* @param OutputInterface $output The output.
|
* @param OutputInterface $output The output.
|
||||||
* @param string $question A given question.
|
* @param string $question A given question.
|
||||||
* @param string $default A default response.
|
* @param string $default A default response.
|
||||||
*/
|
*/
|
||||||
protected function askConfirmation(OutputInterface $output, $question, $default = null)
|
protected function askConfirmation(OutputInterface $output, $question, $default = null)
|
||||||
{
|
{
|
||||||
|
|
|
@ -46,6 +46,7 @@ class TableDropCommand extends ContainerAwareCommand
|
||||||
{
|
{
|
||||||
if (!$input->getOption('force')) {
|
if (!$input->getOption('force')) {
|
||||||
$output->writeln('<error>You have to use the "--force" option to drop some tables.</error>');
|
$output->writeln('<error>You have to use the "--force" option to drop some tables.</error>');
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,7 +91,7 @@ class TableDropCommand extends ContainerAwareCommand
|
||||||
|
|
||||||
$connection->exec('SET FOREIGN_KEY_CHECKS = 0;');
|
$connection->exec('SET FOREIGN_KEY_CHECKS = 0;');
|
||||||
|
|
||||||
array_walk($tablesToDelete, function(&$table, $key, $dbAdapter) {
|
array_walk($tablesToDelete, function (&$table, $key, $dbAdapter) {
|
||||||
$table = $dbAdapter->quoteIdentifierTable($table);
|
$table = $dbAdapter->quoteIdentifierTable($table);
|
||||||
}, $adapter);
|
}, $adapter);
|
||||||
|
|
||||||
|
|
|
@ -140,7 +140,8 @@ abstract class AbstractDataHandler
|
||||||
*
|
*
|
||||||
* @return string[]
|
* @return string[]
|
||||||
*/
|
*/
|
||||||
protected function getModelSearchPaths($connectionName) {
|
protected function getModelSearchPaths($connectionName)
|
||||||
|
{
|
||||||
$searchPath = array();
|
$searchPath = array();
|
||||||
|
|
||||||
if (!empty($this->datasources[$connectionName]['connection']['model_paths'])) {
|
if (!empty($this->datasources[$connectionName]['connection']['model_paths'])) {
|
||||||
|
|
|
@ -233,8 +233,8 @@ abstract class AbstractDataLoader extends AbstractDataHandler implements DataLoa
|
||||||
/**
|
/**
|
||||||
* Save a reference to the specified object (and its ancestors) before loading them.
|
* Save a reference to the specified object (and its ancestors) before loading them.
|
||||||
*
|
*
|
||||||
* @param string $class Class name of passed object
|
* @param string $class Class name of passed object
|
||||||
* @param string $key Key identifying specified object
|
* @param string $key Key identifying specified object
|
||||||
* @param ActiveRecordInterface $obj A Propel object
|
* @param ActiveRecordInterface $obj A Propel object
|
||||||
*/
|
*/
|
||||||
protected function saveParentReference($class, $key, &$obj)
|
protected function saveParentReference($class, $key, &$obj)
|
||||||
|
@ -261,8 +261,8 @@ abstract class AbstractDataLoader extends AbstractDataHandler implements DataLoa
|
||||||
* Loads many to many objects.
|
* Loads many to many objects.
|
||||||
*
|
*
|
||||||
* @param ActiveRecordInterface $obj A Propel object
|
* @param ActiveRecordInterface $obj A Propel object
|
||||||
* @param string $middleTableName The middle table name
|
* @param string $middleTableName The middle table name
|
||||||
* @param array $values An array of values
|
* @param array $values An array of values
|
||||||
*/
|
*/
|
||||||
protected function loadManyToMany($obj, $middleTableName, $values)
|
protected function loadManyToMany($obj, $middleTableName, $values)
|
||||||
{
|
{
|
||||||
|
|
|
@ -48,14 +48,14 @@ class YamlDataLoader extends AbstractDataLoader
|
||||||
|
|
||||||
if (null !== $this->container && $this->container->has('faker.generator')) {
|
if (null !== $this->container && $this->container->has('faker.generator')) {
|
||||||
$generator = $this->container->get('faker.generator');
|
$generator = $this->container->get('faker.generator');
|
||||||
$faker = function($type) use ($generator) {
|
$faker = function ($type) use ($generator) {
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
array_shift($args);
|
array_shift($args);
|
||||||
|
|
||||||
echo Yaml::dump(call_user_func_array(array($generator, $type), $args)) . "\n";
|
echo Yaml::dump(call_user_func_array(array($generator, $type), $args)) . "\n";
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
$faker = function($text) {
|
$faker = function ($text) {
|
||||||
echo $text . "\n";
|
echo $text . "\n";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue