Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Enable and configure no_extra_blank_lines fixer #70

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .php_cs.dist
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,23 @@ return PhpCsFixer\Config::create()
'array_syntax' => [
'syntax' => 'short',
],
'no_extra_blank_lines' => [
'tokens' => [
'break',
'case',
'continue',
'curly_brace_block',
'default',
'extra',
'parenthesis_brace_block',
'return',
'square_brace_block',
'switch',
'throw',
'use',
'use_trait',
],
],
'no_whitespace_in_blank_line' => true,
'php_unit_set_up_tear_down_visibility' => true,
'visibility_required' => [
Expand Down
2 changes: 0 additions & 2 deletions src/Provider/Doctrine/DBAL/Types/StatusArrayType.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,12 @@ public function convertToPHPValue($value, \Doctrine\DBAL\Platforms\AbstractPlatf
return null;
}


$ret = explode(';', $value);

array_walk($ret, function (&$unwashed) {
$unwashed = trim($unwashed, '[]');
});


return $ret;
}

Expand Down
1 change: 0 additions & 1 deletion src/Provider/Doctrine/DateIntervalHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ class DateIntervalHelper
*/
public $negative;


/**
* @param \DateTime $time
* @param bool|false $negative
Expand Down
4 changes: 0 additions & 4 deletions src/Provider/Doctrine/FixtureFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ class FixtureFactory
*/
protected $persist;


public function __construct(EntityManager $em)
{
$this->em = $em;
Expand All @@ -65,7 +64,6 @@ public function getEntityNamespace()
return $this->entityNamespace;
}


/**
* Get an entity and its dependencies.
*
Expand Down Expand Up @@ -107,15 +105,13 @@ public function get($name, array $fieldOverrides = [])
$config['afterCreate']($ent, $fieldValues);
}


if ($this->persist) {
$this->em->persist($ent);
}

return $ent;
}


/**
* Get an array of entities and their dependencies.
*
Expand Down
1 change: 0 additions & 1 deletion tests/Provider/Doctrine/FixtureFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Doctrine\ORM\EntityManager;
use FactoryGirl\Provider\Doctrine\EntityDefinitionUnavailable;
use FactoryGirl\Provider\Doctrine\FixtureFactory;

use PHPUnit\Framework;

/**
Expand Down
1 change: 0 additions & 1 deletion tests/Provider/Doctrine/Fixtures/TestEntity/Badge.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ class Badge
*/
protected $owner;


public function __construct($label, Person $owner)
{
$this->label = $label;
Expand Down
1 change: 0 additions & 1 deletion tests/Provider/Doctrine/Fixtures/TestEntity/Person.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ class Person
*/
protected $spaceShip;


public function __construct($name, SpaceShip $spaceShip = null)
{
$this->name = $name;
Expand Down
1 change: 0 additions & 1 deletion tests/Provider/Doctrine/Fixtures/TestEntity/SpaceShip.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class SpaceShip
*/
protected $constructorWasCalled = false;


public function __construct($name)
{
$this->name = $name;
Expand Down
8 changes: 0 additions & 8 deletions tests/Provider/Doctrine/Types/StatusArrayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ public function getNameShouldReturnExpectedName()
$this->assertSame('statusarray', $this->type->getName());
}


/**
* @test
*/
Expand All @@ -41,7 +40,6 @@ public function nullShouldAlwaysConvertToNull()
$this->assertNull($this->type->convertToPHPValue(null, $this->platform));
}


/**
* @test
*/
Expand All @@ -53,7 +51,6 @@ public function nonArrayOrNotNullShouldFailDatabaseConversion()
$this->type->convertToDatabaseValue($value, $this->platform);
}


public function provideStupidValues()
{
return [
Expand All @@ -63,7 +60,6 @@ public function provideStupidValues()
];
}


public function provideAcceptableValues()
{
return [
Expand All @@ -78,7 +74,6 @@ public function provideAcceptableValues()
];
}


/**
* @test
* @dataProvider provideStupidValues
Expand All @@ -91,7 +86,6 @@ public function invalidCharactersShouldFailDatabaseConversion($stupidValue)
$this->type->convertToDatabaseValue($value, $this->platform);
}


/**
* @test
* @dataProvider provideAcceptableValues
Expand All @@ -102,7 +96,6 @@ public function acceptableCharactersShouldPassDatabaseConversionAndReturnExpecte
$this->assertSame($expectedSerialization, $serialization);
}


public function provideSerializedValues()
{
return [
Expand All @@ -113,7 +106,6 @@ public function provideSerializedValues()
];
}


/**
* @test
* @dataProvider provideSerializedValues
Expand Down