Skip to content

Commit

Permalink
coding-style: added space after anonymous function keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
hrach committed Jul 21, 2015
1 parent b7ae979 commit 0400a6e
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 21 deletions.
6 changes: 3 additions & 3 deletions src/Mapper/Dbal/StorageReflection/StorageReflection.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ private function invalidateCache()
*/
private function getDefaultMappings()
{
return $this->cache->load($this->storageName . '.mappings', function() {
return $this->cache->load($this->storageName . '.mappings', function () {
$this->mappings = [
self::TO_STORAGE => [],
self::TO_ENTITY => [],
Expand Down Expand Up @@ -279,15 +279,15 @@ private function getDefaultMappings()

private function getColumns()
{
return $this->cache->load($this->storageName . '.columns', function() {
return $this->cache->load($this->storageName . '.columns', function () {
return $this->connection->getPlatform()->getColumns($this->storageName);
});
}


private function getForeignKeys($table)
{
return $this->cache->load($table . '.fkeys', function() use ($table) {
return $this->cache->load($table . '.fkeys', function () use ($table) {
return $this->connection->getPlatform()->getForeignKeys($table);
});
}
Expand Down
10 changes: 5 additions & 5 deletions tests/cases/integration/Entity/entity.nullValidation.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ class EntityNullValidationTest extends TestCase

public function testSetNull()
{
Assert::throws(function() {
Assert::throws(function () {
$book = new Book();
$book->title = NULL;
}, 'Nextras\Orm\InvalidArgumentException', 'Value for NextrasTests\Orm\Book::$title property is invalid.');

Assert::throws(function() {
Assert::throws(function () {
$book = new Book();
$book->author = NULL;
}, 'Nextras\Orm\NullValueException', 'Property NextrasTests\Orm\Book::$author is not nullable.');
Expand All @@ -36,12 +36,12 @@ class EntityNullValidationTest extends TestCase

public function testGetNull()
{
Assert::throws(function() {
Assert::throws(function () {
$book = new Book();
$book->title;
}, 'Nextras\Orm\InvalidStateException', 'Property NextrasTests\Orm\Book::$title is not set.');

Assert::throws(function() {
Assert::throws(function () {
$book = new Book();
$book->author;
}, 'Nextras\Orm\NullValueException', 'Property NextrasTests\Orm\Book::$author is not nullable.');
Expand All @@ -62,7 +62,7 @@ class EntityNullValidationTest extends TestCase
$book = new Book();
$book->hasValue('author');

Assert::throws(function() use ($book) {
Assert::throws(function () use ($book) {
$book->author;
}, 'Nextras\Orm\NullValueException', 'Property NextrasTests\Orm\Book::$author is not nullable.');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class RepositoryMagicMethodsTest extends DataTestCase
$book = $this->orm->books->getByTitle('Book 10');
Assert::null($book);

Assert::throws(function() {
Assert::throws(function () {
$this->orm->books->findByTitle('Book 1');
}, 'Nette\MemberAccessException');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class RepositoryPersistanceTest extends TestCase

public function testUnsettedNotNullProperty()
{
Assert::throws(function() {
Assert::throws(function () {
$author = new Author();
$author->name = 'Author';
$author->web = 'localhost';
Expand Down
4 changes: 2 additions & 2 deletions tests/cases/unit/Entity/AbstractEntity.repository.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class AbstractEntityRepositoryTest extends TestCase
$entity = Mockery::mock('Nextras\Orm\Entity\AbstractEntity')->makePartial();
$entity->fireEvent('onAttach', [$repository, $metadata]);

Assert::throws(function() use ($entity, $metadata) {
Assert::throws(function () use ($entity, $metadata) {
$entity->fireEvent('onAttach', [Mockery::mock('Nextras\Orm\Repository\IRepository'), $metadata]);
}, 'Nextras\Orm\InvalidStateException', 'Entity is already attached.');

Expand All @@ -59,7 +59,7 @@ class AbstractEntityRepositoryTest extends TestCase

$entity->fireEvent('onAfterRemove');
Assert::null($entity->getRepository(FALSE));
Assert::throws(function() use ($entity) {
Assert::throws(function () use ($entity) {
$entity->getRepository();
}, 'Nextras\Orm\InvalidStateException', 'Entity is not attached to repository.');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class AnnotationParserParseDefaultTest extends TestCase

public function testUnknown()
{
Assert::throws(function() {
Assert::throws(function () {
$dependencies = [];
$parser = new AnnotationParser([]);
$parser->parseMetadata('NextrasTests\Orm\Entity\Reflection\DefaultUnknown', $dependencies);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ class AnnotationParserParseEnumTest extends TestCase

public function testUnknown()
{
Assert::throws(function() {
Assert::throws(function () {
$dependencies = [];
$parser = new AnnotationParser([]);
$parser->parseMetadata('NextrasTests\Orm\Entity\Reflection\EnumUnknown1', $dependencies);
}, 'Nextras\Orm\InvalidArgumentException', 'Constant NextrasTests\Orm\Entity\Reflection\EnumTestEntity::TYPE_UNKNOWN required by enum macro in NextrasTests\Orm\Entity\Reflection\EnumUnknown1::$test not found.');

Assert::throws(function() {
Assert::throws(function () {
$dependencies = [];
$parser = new AnnotationParser([]);
$parser->parseMetadata('NextrasTests\Orm\Entity\Reflection\EnumUnknown2', $dependencies);
Expand Down
2 changes: 1 addition & 1 deletion tests/cases/unit/Mapper/Dbal/DbalMapperTest.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class DbalMapperTest extends TestCase
Assert::equal((object) ['id' => 3], $data[2]);


Assert::throws(function() use ($mapper) {
Assert::throws(function () use ($mapper) {
$mapper->toCollection(new ArrayCollection([], $this->orm->authors));
}, 'Nextras\Orm\InvalidArgumentException');
}
Expand Down
4 changes: 2 additions & 2 deletions tests/cases/unit/Mapper/Dbal/QueryBuilderHelperTest.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class QueryBuilderHelperTest extends TestCase

public function testNotEntityProperty()
{
Assert::throws(function() {
Assert::throws(function () {
$this->mapper->shouldReceive('getRepository')->once()->andReturn($this->mapper);
$this->mapper->shouldReceive('getEntityClassNames')->once()->andReturn(['EntityClass']);
$this->metadataStorage->shouldReceive('get')->once()->with('EntityClass')->andReturn($this->entityMetadata);
Expand All @@ -176,7 +176,7 @@ class QueryBuilderHelperTest extends TestCase
}, 'Nextras\Orm\InvalidArgumentException');


Assert::throws(function() {
Assert::throws(function () {
$this->mapper->shouldReceive('getRepository')->once()->andReturn($this->mapper);
$this->mapper->shouldReceive('getEntityClassNames')->once()->andReturn(['EntityClass']);
$this->metadataStorage->shouldReceive('get')->once()->with('EntityClass')->andReturn($this->entityMetadata);
Expand Down
2 changes: 1 addition & 1 deletion tests/cases/unit/Mapper/Dbal/StorageReflectionTest.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class StorageReflectionTest extends TestCase

$cacheStorage = new DevNullStorage();

Assert::throws(function() use ($connection, $cacheStorage) {
Assert::throws(function () use ($connection, $cacheStorage) {
new UnderscoredStorageReflection(
$connection,
'table_name',
Expand Down
2 changes: 1 addition & 1 deletion tests/cases/unit/Repository/IdentityMapTest.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class IdentityMapTest extends TestCase
$map = new IdentityMap($repository);
$map->check($this->e('NextrasTests\Orm\Author'));

Assert::throws(function() use ($map) {
Assert::throws(function () use ($map) {
$map->check($this->e('NextrasTests\Orm\Book'));
}, 'Nextras\Orm\InvalidArgumentException', "Entity 'NextrasTests\\Orm\\Book' is not accepted by 'Mockery_0_Nextras_Orm_Repository_IRepository' repository.");
}
Expand Down
2 changes: 1 addition & 1 deletion tests/db/array-init.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

/** @var Model $orm */

$orm->books->getMapper()->addMethod('findBooksWithEvenId', function() use ($orm) {
$orm->books->getMapper()->addMethod('findBooksWithEvenId', function () use ($orm) {
$books = [];
foreach ($orm->books->findAll() as $book) {
if ($book->id % 2 === 0) {
Expand Down

0 comments on commit 0400a6e

Please sign in to comment.