From 0400a6e402c5e155bb2c0177989099613496cb82 Mon Sep 17 00:00:00 2001 From: hrach Date: Tue, 21 Jul 2015 18:37:27 +0200 Subject: [PATCH] coding-style: added space after anonymous function keyword --- .../Dbal/StorageReflection/StorageReflection.php | 6 +++--- .../integration/Entity/entity.nullValidation.phpt | 10 +++++----- .../Repository/repository.magicMethods.phpt | 2 +- .../integration/Repository/repository.persistance.phpt | 2 +- tests/cases/unit/Entity/AbstractEntity.repository.phpt | 4 ++-- .../Reflection/AnnotationParser.parseDefault().phpt | 2 +- .../Reflection/AnnotationParser.parseEnum().phpt | 4 ++-- tests/cases/unit/Mapper/Dbal/DbalMapperTest.phpt | 2 +- .../cases/unit/Mapper/Dbal/QueryBuilderHelperTest.phpt | 4 ++-- .../cases/unit/Mapper/Dbal/StorageReflectionTest.phpt | 2 +- tests/cases/unit/Repository/IdentityMapTest.phpt | 2 +- tests/db/array-init.php | 2 +- 12 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/Mapper/Dbal/StorageReflection/StorageReflection.php b/src/Mapper/Dbal/StorageReflection/StorageReflection.php index 6c53ad41..3ed1dd85 100644 --- a/src/Mapper/Dbal/StorageReflection/StorageReflection.php +++ b/src/Mapper/Dbal/StorageReflection/StorageReflection.php @@ -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 => [], @@ -279,7 +279,7 @@ 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); }); } @@ -287,7 +287,7 @@ private function getColumns() 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); }); } diff --git a/tests/cases/integration/Entity/entity.nullValidation.phpt b/tests/cases/integration/Entity/entity.nullValidation.phpt index 027961e8..b944aece 100644 --- a/tests/cases/integration/Entity/entity.nullValidation.phpt +++ b/tests/cases/integration/Entity/entity.nullValidation.phpt @@ -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.'); @@ -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.'); @@ -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.'); } diff --git a/tests/cases/integration/Repository/repository.magicMethods.phpt b/tests/cases/integration/Repository/repository.magicMethods.phpt index a97a3e58..714b2edb 100644 --- a/tests/cases/integration/Repository/repository.magicMethods.phpt +++ b/tests/cases/integration/Repository/repository.magicMethods.phpt @@ -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'); } diff --git a/tests/cases/integration/Repository/repository.persistance.phpt b/tests/cases/integration/Repository/repository.persistance.phpt index 27d3c44a..e3d76720 100644 --- a/tests/cases/integration/Repository/repository.persistance.phpt +++ b/tests/cases/integration/Repository/repository.persistance.phpt @@ -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'; diff --git a/tests/cases/unit/Entity/AbstractEntity.repository.phpt b/tests/cases/unit/Entity/AbstractEntity.repository.phpt index a388754a..bf1339c1 100644 --- a/tests/cases/unit/Entity/AbstractEntity.repository.phpt +++ b/tests/cases/unit/Entity/AbstractEntity.repository.phpt @@ -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.'); @@ -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.'); } diff --git a/tests/cases/unit/Entity/Reflection/AnnotationParser.parseDefault().phpt b/tests/cases/unit/Entity/Reflection/AnnotationParser.parseDefault().phpt index b8e5985f..de2445b1 100644 --- a/tests/cases/unit/Entity/Reflection/AnnotationParser.parseDefault().phpt +++ b/tests/cases/unit/Entity/Reflection/AnnotationParser.parseDefault().phpt @@ -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); diff --git a/tests/cases/unit/Entity/Reflection/AnnotationParser.parseEnum().phpt b/tests/cases/unit/Entity/Reflection/AnnotationParser.parseEnum().phpt index baf54aa3..9f6ce5b7 100644 --- a/tests/cases/unit/Entity/Reflection/AnnotationParser.parseEnum().phpt +++ b/tests/cases/unit/Entity/Reflection/AnnotationParser.parseEnum().phpt @@ -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); diff --git a/tests/cases/unit/Mapper/Dbal/DbalMapperTest.phpt b/tests/cases/unit/Mapper/Dbal/DbalMapperTest.phpt index e2b41c4a..bf131c09 100644 --- a/tests/cases/unit/Mapper/Dbal/DbalMapperTest.phpt +++ b/tests/cases/unit/Mapper/Dbal/DbalMapperTest.phpt @@ -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'); } diff --git a/tests/cases/unit/Mapper/Dbal/QueryBuilderHelperTest.phpt b/tests/cases/unit/Mapper/Dbal/QueryBuilderHelperTest.phpt index d4176ed5..e84a5182 100644 --- a/tests/cases/unit/Mapper/Dbal/QueryBuilderHelperTest.phpt +++ b/tests/cases/unit/Mapper/Dbal/QueryBuilderHelperTest.phpt @@ -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); @@ -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); diff --git a/tests/cases/unit/Mapper/Dbal/StorageReflectionTest.phpt b/tests/cases/unit/Mapper/Dbal/StorageReflectionTest.phpt index 8d2b058c..1b9cf8a1 100644 --- a/tests/cases/unit/Mapper/Dbal/StorageReflectionTest.phpt +++ b/tests/cases/unit/Mapper/Dbal/StorageReflectionTest.phpt @@ -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', diff --git a/tests/cases/unit/Repository/IdentityMapTest.phpt b/tests/cases/unit/Repository/IdentityMapTest.phpt index acb0ff69..2fb32c2a 100644 --- a/tests/cases/unit/Repository/IdentityMapTest.phpt +++ b/tests/cases/unit/Repository/IdentityMapTest.phpt @@ -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."); } diff --git a/tests/db/array-init.php b/tests/db/array-init.php index 767661b1..3f92d961 100644 --- a/tests/db/array-init.php +++ b/tests/db/array-init.php @@ -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) {