Skip to content
This repository has been archived by the owner on Aug 28, 2018. It is now read-only.

Commit

Permalink
Fixed some more psr2 CS issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lenard Palko committed Dec 9, 2015
1 parent 363033f commit 5d75a95
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 18 deletions.
3 changes: 2 additions & 1 deletion Command/FixturesLoadCommand.php
Expand Up @@ -29,7 +29,8 @@ protected function configure()
'database-name',
null,
InputArgument::OPTIONAL,
'If set, will purge the database specified. If not set, will purge all databases. (require purge option)'
'If set, will purge the database specified. If not set, will purge all
databases. (require purge option)'
)
->addOption(
'purge-mongodb',
Expand Down
2 changes: 1 addition & 1 deletion Fixture/OrmYamlFixture.php
Expand Up @@ -16,7 +16,7 @@ public function createObject($class, $data, $metadata, $options = array())
if (isset($data['__construct'])) {
$arguments = $data['__construct'];
if (is_array($arguments)) {
foreach($arguments as $argument) {
foreach ($arguments as $argument) {
if (is_array($argument)) {
if ($argument['type'] == 'datetime') {
$constructArguments[] = new \DateTime($argument['value']);
Expand Down
1 change: 0 additions & 1 deletion KhepinYamlFixturesBundle.php
Expand Up @@ -14,5 +14,4 @@ public function build(ContainerBuilder $container)

$container->addCompilerPass(new YamlFixturesPass());
}

}
4 changes: 2 additions & 2 deletions Loader/YamlLoader.php
Expand Up @@ -145,11 +145,11 @@ public function purgeDatabase($persistence, $databaseName = null, $withTruncate

// Instanciate purger and executor
$persister = $this->getPersister($persistence);
$entityManagers = ($databaseName)
$entityManagers = ($databaseName)
? array($persister->getManager($databaseName))
: $persister->getManagers();

foreach($entityManagers as $entityManager) {
foreach ($entityManagers as $entityManager) {
$purger = new $purge_class($entityManager);
if ($withTruncate && $purger instanceof ORMPurger) {
$purger->setPurgeMode(ORMPurger::PURGE_MODE_TRUNCATE);
Expand Down
3 changes: 1 addition & 2 deletions tests/Khepin/Utils/BaseTestCaseMongo.php
Expand Up @@ -64,7 +64,7 @@ protected function getDoctrine()
$dm = \Doctrine\ODM\MongoDB\DocumentManager::create(null, $config);

return $this->doctrine = m::mock(array(
'getManager' => $dm,
'getManager' => $dm,
'getManagers' => array($dm),
'getManagerForClass' => $dm
));
Expand Down Expand Up @@ -96,5 +96,4 @@ protected function getDoctrine()
// )
// );
}

}
22 changes: 11 additions & 11 deletions tests/Khepin/Utils/BaseTestCaseOrm.php
Expand Up @@ -81,8 +81,8 @@ private function getMockAnnotatedConfig()
protected function getMetadataDriverImplementation()
{
return new AnnotationDriver(
$_ENV['annotation_reader'],
array(__DIR__.'/../Fixture/Entity')
$_ENV['annotation_reader'],
array(__DIR__.'/../Fixture/Entity')
);
}

Expand Down Expand Up @@ -111,21 +111,21 @@ protected function getDoctrine()
'Khepin\\Fixture\\Entity\\Owner'
);

$schema = array_map(function($class) use ($em) {
return $em->getClassMetadata($class);
}, $entities);
$schema = array_map(function ($class) use ($em) {
return $em->getClassMetadata($class);
}, $entities);

$schemaTool = new SchemaTool($em);
$schemaTool->dropSchema(array());
$schemaTool->createSchema($schema);

return $this->doctrine = m::mock(array(
'getEntityManager' => $em,
'getManager' => $em,
'getManagers' => array($em),
'getManagerForClass' => $em
return $this->doctrine = m::mock(
array(
'getEntityManager' => $em,
'getManager' => $em,
'getManagers' => array($em),
'getManagerForClass' => $em
)
);
}

}

0 comments on commit 5d75a95

Please sign in to comment.