@@ -73,18 +73,18 @@ discard block |
||
| 73 | 73 | $connection->exec($sqlStmt); |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | - for ($i = 1; $i<200; $i++) { |
|
| 76 | + for ($i = 1; $i < 200; $i++) { |
|
| 77 | 77 | TDBMAbstractServiceTest::insert($connection, 'countries', [ |
| 78 | 78 | 'id' => $i, |
| 79 | 79 | 'label' => 'Country '.$i, |
| 80 | 80 | ]); |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | - for ($i = 1; $i<1000; $i++) { |
|
| 83 | + for ($i = 1; $i < 1000; $i++) { |
|
| 84 | 84 | TDBMAbstractServiceTest::insert($connection, 'users', [ |
| 85 | 85 | 'id' => $i, |
| 86 | 86 | 'name' => 'User '.$i, |
| 87 | - 'country_id' => ($i%199) +1, |
|
| 87 | + 'country_id' => ($i % 199) + 1, |
|
| 88 | 88 | ]); |
| 89 | 89 | } |
| 90 | 90 | } |
@@ -96,8 +96,8 @@ discard block |
||
| 96 | 96 | $schemaLockFileDumper = new SchemaLockFileDumper($connection, new ArrayCache(), Configuration::getDefaultLockFilePath()); |
| 97 | 97 | $tdbmSchemaAnalyzer = new TDBMSchemaAnalyzer($connection, new ArrayCache(), $schemaAnalyzer, $schemaLockFileDumper); |
| 98 | 98 | $tdbmDaoGenerator = new TDBMDaoGenerator(self::createConfiguration(), $tdbmSchemaAnalyzer); |
| 99 | - $rootPath = __DIR__ . '/../'; |
|
| 100 | - self::recursiveDelete(__DIR__. '/../../src/Test/Dao/'); |
|
| 99 | + $rootPath = __DIR__.'/../'; |
|
| 100 | + self::recursiveDelete(__DIR__.'/../../src/Test/Dao/'); |
|
| 101 | 101 | |
| 102 | 102 | $tdbmDaoGenerator->generateAllDaosAndBeans(); |
| 103 | 103 | } |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | if (is_file($str)) { |
| 114 | 114 | return @unlink($str); |
| 115 | 115 | } elseif (is_dir($str)) { |
| 116 | - $scan = glob(rtrim($str, '/') . '/*'); |
|
| 116 | + $scan = glob(rtrim($str, '/').'/*'); |
|
| 117 | 117 | foreach ($scan as $index => $path) { |
| 118 | 118 | self::recursiveDelete($path); |
| 119 | 119 | } |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | $this->assertEquals(null, $a->first()); |
| 26 | 26 | $this->assertEquals(null, isset($a[0])); //an empty resultIterator must implement arrayAccess |
| 27 | 27 | $this->assertEquals([], $a->toArray()); |
| 28 | - foreach ($a->map(function ($foo) { |
|
| 28 | + foreach ($a->map(function($foo) { |
|
| 29 | 29 | }) as $empty) { |
| 30 | 30 | throw new \LogicException("Not supposed to iterate on an empty iterator."); |
| 31 | 31 | } |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | $this->assertEquals(0, $b->count()); |
| 52 | 52 | $this->assertEquals([], $b->toArray()); |
| 53 | 53 | $this->assertEquals(0, $b->totalCount()); |
| 54 | - $c = $b->map(function ($foo) { |
|
| 54 | + $c = $b->map(function($foo) { |
|
| 55 | 55 | }); |
| 56 | 56 | foreach ($c as $empty) { |
| 57 | 57 | throw new \LogicException("Not supposed to iterate on an empty iterator."); |
@@ -12,8 +12,8 @@ |
||
| 12 | 12 | { |
| 13 | 13 | $params = [ |
| 14 | 14 | 'key1' => 'foo', |
| 15 | - 'key2' => [1,2,3], |
|
| 16 | - 'key3' => [1,2,'baz'], |
|
| 15 | + 'key2' => [1, 2, 3], |
|
| 16 | + 'key3' => [1, 2, 'baz'], |
|
| 17 | 17 | 'key4' => 1, |
| 18 | 18 | ]; |
| 19 | 19 | |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | { |
| 39 | 39 | return new ArrayIterator($this); |
| 40 | 40 | } |
| 41 | - }, function ($item) { |
|
| 41 | + }, function($item) { |
|
| 42 | 42 | return $item; |
| 43 | 43 | }); |
| 44 | 44 | |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | public function testConstructorException1(): void |
| 49 | 49 | { |
| 50 | 50 | $this->expectException('TheCodingMachine\TDBM\TDBMException'); |
| 51 | - $mapIterator = new MapIterator(new \DateTime(), function ($item) { |
|
| 51 | + $mapIterator = new MapIterator(new \DateTime(), function($item) { |
|
| 52 | 52 | return $item; |
| 53 | 53 | }); |
| 54 | 54 | } |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | public function testConstructorException2(): void |
| 57 | 57 | { |
| 58 | 58 | $this->expectException('TheCodingMachine\TDBM\TDBMException'); |
| 59 | - $mapIterator = new MapIterator(array(1, 2, 3), function () { |
|
| 59 | + $mapIterator = new MapIterator(array(1, 2, 3), function() { |
|
| 60 | 60 | return $item; |
| 61 | 61 | }); |
| 62 | 62 | } |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | public function testJsonSerialize(): void |
| 65 | 65 | { |
| 66 | 66 | $value = array(1, 2, 3); |
| 67 | - $mapIterator = new MapIterator($value, function ($item) { |
|
| 67 | + $mapIterator = new MapIterator($value, function($item) { |
|
| 68 | 68 | return $item; |
| 69 | 69 | }); |
| 70 | 70 | |
@@ -128,7 +128,7 @@ |
||
| 128 | 128 | |
| 129 | 129 | $alterableResultIterator = new AlterableResultIterator($iterator); |
| 130 | 130 | |
| 131 | - $map = $alterableResultIterator->map(function ($item) { |
|
| 131 | + $map = $alterableResultIterator->map(function($item) { |
|
| 132 | 132 | return $item->foo; |
| 133 | 133 | }); |
| 134 | 134 | |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | $objectStorage = new NativeWeakrefObjectStorage(); |
| 31 | 31 | $dbRow = $this->createMock(DbRow::class); |
| 32 | 32 | |
| 33 | - for ($i=0; $i<10001; $i++) { |
|
| 33 | + for ($i = 0; $i < 10001; $i++) { |
|
| 34 | 34 | $objectStorage->set('foo', $i, clone $dbRow); |
| 35 | 35 | } |
| 36 | 36 | $this->assertNull($objectStorage->get('foo', 42)); |
@@ -63,7 +63,7 @@ |
||
| 63 | 63 | public function getCacheKey(): string |
| 64 | 64 | { |
| 65 | 65 | if ($this->cacheKey === null) { |
| 66 | - $this->cacheKey = 'from__' . implode(',', $this->getUnquotedLocalColumns()) . '__to__table__' . $this->getForeignTableName() . '__columns__' . implode(',', $this->getUnquotedForeignColumns()); |
|
| 66 | + $this->cacheKey = 'from__'.implode(',', $this->getUnquotedLocalColumns()).'__to__table__'.$this->getForeignTableName().'__columns__'.implode(',', $this->getUnquotedForeignColumns()); |
|
| 67 | 67 | } |
| 68 | 68 | return $this->cacheKey; |
| 69 | 69 | } |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | */ |
| 40 | 40 | public function findAnnotations(string $annotationType): array |
| 41 | 41 | { |
| 42 | - return array_values(array_filter($this->annotations, function ($annotation) use ($annotationType) { |
|
| 42 | + return array_values(array_filter($this->annotations, function($annotation) use ($annotationType) { |
|
| 43 | 43 | return is_a($annotation, $annotationType); |
| 44 | 44 | })); |
| 45 | 45 | } |
@@ -71,7 +71,7 @@ |
||
| 71 | 71 | |
| 72 | 72 | // Let's add * in front of the line (otherwise, parsing is failing) |
| 73 | 73 | $lines = explode("\n", $comment); |
| 74 | - $lines = array_map(function (string $line) { |
|
| 74 | + $lines = array_map(function(string $line) { |
|
| 75 | 75 | return '* '.$line; |
| 76 | 76 | }, $lines); |
| 77 | 77 | $comment = implode("\n", $lines); |