Skip to content

Commit

Permalink
Update CS and configs
Browse files Browse the repository at this point in the history
  • Loading branch information
fre5h committed Nov 28, 2015
1 parent 40ad8b7 commit 1f51570
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 26 deletions.
8 changes: 8 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Files and directories which won't be included in .zip archive during running `composer install --prefer-dist`

/.gitattributes export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/phpunit.xml.dist export-ignore
/.scrutinizer.yml export-ignore
/Tests export-ignore
2 changes: 1 addition & 1 deletion DependencyInjection/FreshDoctrineEnumExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class FreshDoctrineEnumExtension extends Extension
*/
public function load(array $configs, ContainerBuilder $container)
{
$loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.yml');
}
}
2 changes: 1 addition & 1 deletion Fixtures/DBAL/Types/BasketballPositionType.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ class BasketballPositionType extends AbstractEnumType
self::SHOOTING_GUARD => 'Shooting guard',
self::SMALL_FORWARD => 'Small forward',
self::POWER_FORWARD => 'Power forward',
self::CENTER => 'Center'
self::CENTER => 'Center',
);
}
2 changes: 1 addition & 1 deletion Fixtures/DBAL/Types/MapLocationType.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ class MapLocationType extends AbstractEnumType
self::NORTH_WEST => 'Northwest',
self::NORTH_EAST => 'Northeast',
self::SOUTH_WEST => 'Southwest',
self::SOUTH_EAST => 'Southeast'
self::SOUTH_EAST => 'Southeast',
);
}
2 changes: 1 addition & 1 deletion Form/EnumTypeGuesser.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function guessType($class, $property)
// Get the choices from the fully qualified class name
$parameters = array(
'choices' => $enumTypeFullClassName::getChoices(),
'required' => !$metadata->isNullable($property)
'required' => !$metadata->isNullable($property),
);

return new TypeGuess('choice', $parameters, Guess::VERY_HIGH_CONFIDENCE);
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ Provides support of **ENUM type** for Doctrine in Symfony applications.
## Requirements

* PHP 5.3 *and later*
* Symfony 2.5 *and later*
* Symfony 2.3 *and later*
* Doctrine 2.2 *and later*

## Installation

### Install via Composer

```php composer.phar require fresh/doctrine-enum-bundle='v3.1'```
```php composer.phar require fresh/doctrine-enum-bundle='v2.6'```

### Register the bundle

Expand Down
6 changes: 3 additions & 3 deletions Tests/DBAL/Types/AbstractEnumTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ public function platformProvider()
array(
array('name' => 'position'),
new MySqlPlatform(),
"ENUM('PG', 'SG', 'SF', 'PF', 'C')"
"ENUM('PG', 'SG', 'SF', 'PF', 'C')",
),
array(
array('name' => 'position'),
new SqlitePlatform(),
"TEXT CHECK(position IN ('PG', 'SG', 'SF', 'PF', 'C'))"
)
"TEXT CHECK(position IN ('PG', 'SG', 'SF', 'PF', 'C'))",
),
);
}
}
10 changes: 3 additions & 7 deletions Tests/Twig/Extension/ReadableEnumValueExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,8 @@ class ReadableEnumValueExtensionTest extends \PHPUnit_Framework_TestCase
public function setUp()
{
$this->readableEnumValueExtension = new ReadableEnumValueExtension(array(
'BasketballPositionType' => array(
'class' => 'Fresh\DoctrineEnumBundle\Fixtures\DBAL\Types\BasketballPositionType'
),
'MapLocationType' => array(
'class' => 'Fresh\DoctrineEnumBundle\Fixtures\DBAL\Types\MapLocationType'
)
'BasketballPositionType' => array('class' => 'Fresh\DoctrineEnumBundle\Fixtures\DBAL\Types\BasketballPositionType'),
'MapLocationType' => array('class' => 'Fresh\DoctrineEnumBundle\Fixtures\DBAL\Types\MapLocationType'),
));
}

Expand Down Expand Up @@ -68,7 +64,7 @@ public function dataProviderForGetReadableEnumValueTest()
return array(
array('Point guard', BasketballPositionType::POINT_GUARD, 'BasketballPositionType'),
array('Center', BasketballPositionType::CENTER, 'BasketballPositionType'),
array('Center', MapLocationType::CENTER, 'MapLocationType')
array('Center', MapLocationType::CENTER, 'MapLocationType'),
);
}

Expand Down
8 changes: 2 additions & 6 deletions Tests/Validator/EnumValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ public function testExceptionEntityNotSpecified()
*/
public function testValidBasketballPositionType()
{
$constraint = new Enum(array(
'entity' => 'Fresh\DoctrineEnumBundle\Fixtures\DBAL\Types\BasketballPositionType'
));
$constraint = new Enum(array('entity' => 'Fresh\DoctrineEnumBundle\Fixtures\DBAL\Types\BasketballPositionType'));

$this->context
->expects($this->never())
Expand All @@ -76,9 +74,7 @@ public function testValidBasketballPositionType()
*/
public function testInvalidBasketballPositionType()
{
$constraint = new Enum(array(
'entity' => 'Fresh\DoctrineEnumBundle\Fixtures\DBAL\Types\BasketballPositionType'
));
$constraint = new Enum(array('entity' => 'Fresh\DoctrineEnumBundle\Fixtures\DBAL\Types\BasketballPositionType'));

$this->context
->expects($this->once())
Expand Down
2 changes: 1 addition & 1 deletion Validator/Constraints/EnumValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ public function validate($value, Constraint $constraint)
$entity = $constraint->entity;
$constraint->choices = $entity::getValues();

return parent::validate($value, $constraint);
parent::validate($value, $constraint);
}
}
8 changes: 5 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@
"issues": "https://github.com/fre5h/DoctrineEnumBundle/issues"
},
"require": {
"php": ">=5.3.3",
"symfony/symfony": "~2.5",
"php": ">=5.3.9",
"symfony/symfony": "~2.3",
"doctrine/orm": "~2.2"
},
"require-dev": {
"phpunit/phpunit": "~4.0"
"phpunit/phpunit": "~4.8",
"squizlabs/php_codesniffer": "*",
"escapestudios/symfony2-coding-standard": "*"
},
"minimum-stability": "stable",
"autoload": {
Expand Down

0 comments on commit 1f51570

Please sign in to comment.