Skip to content

Commit

Permalink
Fixed PSR issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Hounddog committed Dec 12, 2013
1 parent 70bf753 commit 29c5ab1
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 18 deletions.
4 changes: 2 additions & 2 deletions Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
/**
* This file is placed here for compatibility with Zendframework 2's ModuleManager.
* It allows usage of this module even without composer.
* The original Module.php is in 'src/DoctrineORMModule' in order to respect PSR-0
* The original Module.php is in 'src/DoctrineDataFixtureModule' in order to respect PSR-0
*/
require_once __DIR__ . '/src/DoctrineDataFixtureModule/Module.php';
require_once __DIR__ . '/src/DoctrineDataFixtureModule/Module.php';
25 changes: 13 additions & 12 deletions src/DoctrineDataFixtureModule/Command/ImportCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@

namespace DoctrineDataFixtureModule\Command;

use Symfony\Component\Console\Command\Command,
Symfony\Component\Console\Input\InputInterface,
Symfony\Component\Console\Output\OutputInterface,
Symfony\Component\Console\Input\InputArgument,
Symfony\Component\Console\Input\InputOption,
Doctrine\ORM\Tools\SchemaTool,
Doctrine\DBAL\Migrations\Configuration\Configuration;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
use Doctrine\ORM\Tools\SchemaTool;
use Doctrine\DBAL\Migrations\Configuration\Configuration;
use Doctrine\Common\DataFixtures\Loader;
use Doctrine\Common\DataFixtures\Executor\ORMExecutor;
use Doctrine\Common\DataFixtures\Purger\ORMPurger;

/**
* Command for generate migration classes by comparing your current database schema
* to your mapping information.
Expand All @@ -53,7 +53,8 @@ protected function configure()

$this->setName('data-fixture:import')
->setDescription('Import Data Fixtures')
->setHelp(<<<EOT
->setHelp(
<<<EOT
The import command Imports data-fixtures
EOT
)
Expand All @@ -66,19 +67,19 @@ public function execute(InputInterface $input, OutputInterface $output)
$loader = new Loader();
$purger = new ORMPurger();

if($input->getOption('purge-with-truncate')) {
if ($input->getOption('purge-with-truncate')) {
$purger->setPurgeMode(self::PURGE_MODE_TRUNCATE);
}

$executor = new ORMExecutor($this->em, $purger);

foreach($this->paths as $key => $value) {
foreach ($this->paths as $key => $value) {
$loader->loadFromDirectory($value);
}
$executor->execute($loader->getFixtures(), $input->getOption('append'));
}

public function setPath($paths)
public function setPath($paths)
{
$this->paths=$paths;
}
Expand Down
2 changes: 1 addition & 1 deletion src/DoctrineDataFixtureModule/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function init(ModuleManager $e)
$events = $e->getEventManager()->getSharedManager();

// Attach to helper set event and load the entity manager helper.
$events->attach('doctrine', 'loadCli.post', function(EventInterface $e) {
$events->attach('doctrine', 'loadCli.post', function (EventInterface $e) {
/* @var $cli \Symfony\Component\Console\Application */
$cli = $e->getTarget();

Expand Down
4 changes: 2 additions & 2 deletions src/DoctrineDataFixtureModule/Service/FixtureFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function createService(ServiceLocatorInterface $sl)
public function getOptions(ServiceLocatorInterface $sl, $key)
{
$options = $sl->get('Configuration');
if(!isset($options['data-fixture'])) {
if (!isset($options['data-fixture'])) {
return array();
}

Expand All @@ -61,6 +61,6 @@ public function getOptions(ServiceLocatorInterface $sl, $key)

public function getOptionsClass()
{
return 'DoctrineDataFixtureModule\Options\Fixture';
return 'DoctrineDataFixtureModule\Options\Fixture';
}
}
2 changes: 1 addition & 1 deletion tests/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
/* @var $loader \Composer\Autoload\ClassLoader */
$loader->add('DoctrineDataFixtureTest\\', __DIR__);

unset($files, $file, $loader);
unset($files, $file, $loader);

0 comments on commit 29c5ab1

Please sign in to comment.