optimized code to fit our coding guideline; made some small optimizations if possible
This commit is contained in:
parent
72d86162c8
commit
a0b5b74b36
5 changed files with 17 additions and 15 deletions
|
@ -7,9 +7,10 @@ use Neos\Flow\Annotations as Flow;
|
||||||
/**
|
/**
|
||||||
* SequenceInsert
|
* SequenceInsert
|
||||||
*
|
*
|
||||||
* @author fcool
|
|
||||||
* @Flow\Entity
|
* @Flow\Entity
|
||||||
* @ORM\Table(indexes={@ORM\Index(name="type_idx", columns={"type"})})
|
* @ORM\Table(indexes={
|
||||||
|
* @ORM\Index(name="type_idx", columns={"type"})
|
||||||
|
* })
|
||||||
*/
|
*/
|
||||||
class Insert
|
class Insert
|
||||||
{
|
{
|
||||||
|
|
|
@ -77,9 +77,7 @@ class SequenceGenerator
|
||||||
} catch (\PDOException $e) {
|
} catch (\PDOException $e) {
|
||||||
return false;
|
return false;
|
||||||
} catch (DBALException $e) {
|
} catch (DBALException $e) {
|
||||||
if ($e->getPrevious() && $e->getPrevious() instanceof \PDOException) {
|
if (! $e->getPrevious() instanceof \PDOException) {
|
||||||
// Do nothing, new Doctrine handling hides the above error
|
|
||||||
} else {
|
|
||||||
$this->systemLogger->logException($e);
|
$this->systemLogger->logException($e);
|
||||||
}
|
}
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
|
|
@ -1,18 +1,25 @@
|
||||||
<?php
|
<?php
|
||||||
namespace Neos\Flow\Persistence\Doctrine\Migrations;
|
namespace Neos\Flow\Persistence\Doctrine\Migrations;
|
||||||
|
|
||||||
use Doctrine\DBAL\Migrations\AbstractMigration,
|
use Doctrine\DBAL\Migrations\AbstractMigration;
|
||||||
Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Auto-generated Migration: Please modify to your need!
|
* Auto-generated Migration: Please modify to your needs! This block will be used as the migration description if getDescription() is not used.
|
||||||
*/
|
*/
|
||||||
class Version20140505093853 extends AbstractMigration
|
class Version20140505093853 extends AbstractMigration
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getDescription()
|
||||||
|
{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Schema $schema
|
* @param Schema $schema
|
||||||
*
|
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function up(Schema $schema)
|
public function up(Schema $schema)
|
||||||
|
@ -27,7 +34,6 @@ class Version20140505093853 extends AbstractMigration
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Schema $schema
|
* @param Schema $schema
|
||||||
*
|
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function down(Schema $schema)
|
public function down(Schema $schema)
|
||||||
|
|
|
@ -5,8 +5,7 @@ use Doctrine\DBAL\Migrations\AbstractMigration;
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Auto-generated Migration: Please modify to your needs! This block will be used as the migration description if
|
* Auto-generated Migration: Please modify to your needs! This block will be used as the migration description if getDescription() is not used.
|
||||||
* getDescription() is not used.
|
|
||||||
*/
|
*/
|
||||||
class Version20160624203903 extends AbstractMigration
|
class Version20160624203903 extends AbstractMigration
|
||||||
{
|
{
|
||||||
|
@ -21,7 +20,6 @@ class Version20160624203903 extends AbstractMigration
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Schema $schema
|
* @param Schema $schema
|
||||||
*
|
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function up(Schema $schema)
|
public function up(Schema $schema)
|
||||||
|
@ -37,7 +35,6 @@ class Version20160624203903 extends AbstractMigration
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Schema $schema
|
* @param Schema $schema
|
||||||
*
|
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function down(Schema $schema)
|
public function down(Schema $schema)
|
||||||
|
|
|
@ -32,7 +32,7 @@ class SequenceTest extends FunctionalTestCase
|
||||||
for ($j = 0; $j < 10; $j++) {
|
for ($j = 0; $j < 10; $j++) {
|
||||||
$sequenceGenerator->getNextNumberFor($sequenceGenerator);
|
$sequenceGenerator->getNextNumberFor($sequenceGenerator);
|
||||||
}
|
}
|
||||||
//making a hard exit to avoid phpunit having the tables cleaned up again
|
// making a hard exit to avoid phpunit having the tables cleaned up again
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue