@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | /** |
| 130 | - * @param field_type $fooTitle |
|
| 130 | + * @param string $fooTitle |
|
| 131 | 131 | */ |
| 132 | 132 | public function setFooTitle($fooTitle) |
| 133 | 133 | { |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | /** |
| 208 | - * @param field_type $barTitle |
|
| 208 | + * @param string $barTitle |
|
| 209 | 209 | */ |
| 210 | 210 | public function setBarTitle($barTitle) |
| 211 | 211 | { |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\Tests\ORM\Functional\Ticket; |
| 6 | 6 | |
@@ -148,6 +148,9 @@ discard block |
||
| 148 | 148 | ); |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | + /** |
|
| 152 | + * @param string $dql |
|
| 153 | + */ |
|
| 151 | 154 | protected function asyncDqlWithLock($dql, $params, $lockMode) |
| 152 | 155 | { |
| 153 | 156 | $this->startJob('dqlWithLock', [ |
@@ -168,6 +171,9 @@ discard block |
||
| 168 | 171 | ); |
| 169 | 172 | } |
| 170 | 173 | |
| 174 | + /** |
|
| 175 | + * @param string $fn |
|
| 176 | + */ |
|
| 171 | 177 | protected function startJob($fn, $fixture) |
| 172 | 178 | { |
| 173 | 179 | $this->gearman->addTask($fn, serialize( |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\Tests\ORM\Functional\Locking; |
| 6 | 6 | |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | protected function setUp() |
| 21 | 21 | { |
| 22 | - if (!class_exists('GearmanClient', false)) { |
|
| 22 | + if ( ! class_exists('GearmanClient', false)) { |
|
| 23 | 23 | $this->markTestSkipped('pecl/gearman is required for this test to run.'); |
| 24 | 24 | } |
| 25 | 25 | |
@@ -135,11 +135,11 @@ discard block |
||
| 135 | 135 | $this->gearman->runTasks(); |
| 136 | 136 | |
| 137 | 137 | self::assertTrue($this->maxRunTime > $forTime, |
| 138 | - "Because of locking this tests should have run at least " . $forTime . " seconds, ". |
|
| 139 | - "but only did for " . $this->maxRunTime . " seconds."); |
|
| 138 | + "Because of locking this tests should have run at least ".$forTime." seconds, ". |
|
| 139 | + "but only did for ".$this->maxRunTime." seconds."); |
|
| 140 | 140 | self::assertTrue($this->maxRunTime < $notLongerThan, |
| 141 | - "The longest task should not run longer than " . $notLongerThan . " seconds, ". |
|
| 142 | - "but did for " . $this->maxRunTime . " seconds." |
|
| 141 | + "The longest task should not run longer than ".$notLongerThan." seconds, ". |
|
| 142 | + "but did for ".$this->maxRunTime." seconds." |
|
| 143 | 143 | ); |
| 144 | 144 | } |
| 145 | 145 | |
@@ -3,7 +3,6 @@ |
||
| 3 | 3 | namespace Doctrine\Tests\ORM\Functional; |
| 4 | 4 | |
| 5 | 5 | use Doctrine\DBAL\Types\Type as DBALType; |
| 6 | -use Doctrine\ORM\Mapping\AssociationMapping; |
|
| 7 | 6 | use Doctrine\Tests\Models\Generic\BooleanModel; |
| 8 | 7 | use Doctrine\Tests\Models\Generic\DateTimeModel; |
| 9 | 8 | use Doctrine\Tests\Models\Generic\DecimalModel; |
@@ -167,12 +167,12 @@ |
||
| 167 | 167 | $this->em->clear(); |
| 168 | 168 | |
| 169 | 169 | $dateTimeDb = $this->em->createQueryBuilder() |
| 170 | - ->select('d') |
|
| 171 | - ->from(DateTimeModel::class, 'd') |
|
| 172 | - ->where('d.datetime = ?1') |
|
| 173 | - ->setParameter(1, $date, DBALType::DATETIME) |
|
| 174 | - ->getQuery() |
|
| 175 | - ->getSingleResult(); |
|
| 170 | + ->select('d') |
|
| 171 | + ->from(DateTimeModel::class, 'd') |
|
| 172 | + ->where('d.datetime = ?1') |
|
| 173 | + ->setParameter(1, $date, DBALType::DATETIME) |
|
| 174 | + ->getQuery() |
|
| 175 | + ->getSingleResult(); |
|
| 176 | 176 | |
| 177 | 177 | self::assertInstanceOf(\DateTime::class, $dateTimeDb->datetime); |
| 178 | 178 | self::assertSame('2009-10-02 20:10:52', $dateTimeDb->datetime->format('Y-m-d H:i:s')); |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\Tests\ORM\Functional; |
| 6 | 6 | |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | $this->em->flush(); |
| 32 | 32 | $this->em->clear(); |
| 33 | 33 | |
| 34 | - $dql = 'SELECT d FROM ' . DecimalModel::class . ' d'; |
|
| 34 | + $dql = 'SELECT d FROM '.DecimalModel::class.' d'; |
|
| 35 | 35 | $decimal = $this->em->createQuery($dql)->getSingleResult(); |
| 36 | 36 | |
| 37 | 37 | self::assertSame('0.15', $decimal->decimal); |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | $this->em->flush(); |
| 52 | 52 | $this->em->clear(); |
| 53 | 53 | |
| 54 | - $dql = 'SELECT b FROM ' . BooleanModel::class . ' b WHERE b.booleanField = true'; |
|
| 54 | + $dql = 'SELECT b FROM '.BooleanModel::class.' b WHERE b.booleanField = true'; |
|
| 55 | 55 | $bool = $this->em->createQuery($dql)->getSingleResult(); |
| 56 | 56 | |
| 57 | 57 | self::assertTrue($bool->booleanField); |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | $this->em->flush(); |
| 62 | 62 | $this->em->clear(); |
| 63 | 63 | |
| 64 | - $dql = 'SELECT b FROM ' . BooleanModel::class . ' b WHERE b.booleanField = false'; |
|
| 64 | + $dql = 'SELECT b FROM '.BooleanModel::class.' b WHERE b.booleanField = false'; |
|
| 65 | 65 | $bool = $this->em->createQuery($dql)->getSingleResult(); |
| 66 | 66 | |
| 67 | 67 | self::assertFalse($bool->booleanField); |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | $this->em->flush(); |
| 78 | 78 | $this->em->clear(); |
| 79 | 79 | |
| 80 | - $dql = 'SELECT s FROM ' . SerializationModel::class . ' s'; |
|
| 80 | + $dql = 'SELECT s FROM '.SerializationModel::class.' s'; |
|
| 81 | 81 | $serialize = $this->em->createQuery($dql)->getSingleResult(); |
| 82 | 82 | |
| 83 | 83 | self::assertSame(["foo" => "bar", "bar" => "baz"], $serialize->array); |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | $this->em->flush(); |
| 93 | 93 | $this->em->clear(); |
| 94 | 94 | |
| 95 | - $dql = 'SELECT s FROM ' . SerializationModel::class . ' s'; |
|
| 95 | + $dql = 'SELECT s FROM '.SerializationModel::class.' s'; |
|
| 96 | 96 | $serialize = $this->em->createQuery($dql)->getSingleResult(); |
| 97 | 97 | |
| 98 | 98 | self::assertInstanceOf('stdClass', $serialize->object); |
@@ -5,8 +5,8 @@ discard block |
||
| 5 | 5 | |
| 6 | 6 | // Path to composer autoloader. You can use different provided by your favorite framework, |
| 7 | 7 | // if you want to. |
| 8 | -$loaderPath = __DIR__ . '/../../vendor/autoload.php'; |
|
| 9 | -if(!is_readable($loaderPath)){ |
|
| 8 | +$loaderPath = __DIR__.'/../../vendor/autoload.php'; |
|
| 9 | +if ( ! is_readable($loaderPath)) { |
|
| 10 | 10 | throw new LogicException('Run php composer.phar install at first'); |
| 11 | 11 | } |
| 12 | 12 | $loader = require $loaderPath; |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | $config = new \Doctrine\ORM\Configuration(); |
| 20 | 20 | |
| 21 | 21 | // Set up Metadata Drivers |
| 22 | -$driverImpl = $config->newDefaultAnnotationDriver([__DIR__ . "/Entities"]); |
|
| 22 | +$driverImpl = $config->newDefaultAnnotationDriver([__DIR__."/Entities"]); |
|
| 23 | 23 | $config->setMetadataDriverImpl($driverImpl); |
| 24 | 24 | |
| 25 | 25 | // Set up caches, depending on $debug variable. |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | $config->setQueryCacheImpl($cache); |
| 30 | 30 | |
| 31 | 31 | // Proxy configuration |
| 32 | -$config->setProxyDir(__DIR__ . '/Proxies'); |
|
| 32 | +$config->setProxyDir(__DIR__.'/Proxies'); |
|
| 33 | 33 | $config->setProxyNamespace('Proxies'); |
| 34 | 34 | |
| 35 | 35 | // Database connection information |
@@ -146,6 +146,12 @@ discard block |
||
| 146 | 146 | return [$user1, $user2, $user3]; |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | + /** |
|
| 150 | + * @param string $name |
|
| 151 | + * @param string $username |
|
| 152 | + * @param string $status |
|
| 153 | + * @param CmsAddress $address |
|
| 154 | + */ |
|
| 149 | 155 | public function buildUser($name, $username, $status, $address) |
| 150 | 156 | { |
| 151 | 157 | $user = new CmsUser(); |
@@ -160,6 +166,12 @@ discard block |
||
| 160 | 166 | return $user; |
| 161 | 167 | } |
| 162 | 168 | |
| 169 | + /** |
|
| 170 | + * @param string $country |
|
| 171 | + * @param string $city |
|
| 172 | + * @param string $street |
|
| 173 | + * @param string $zip |
|
| 174 | + */ |
|
| 163 | 175 | public function buildAddress($country, $city, $street, $zip) |
| 164 | 176 | { |
| 165 | 177 | $address = new CmsAddress(); |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | */ |
| 311 | 311 | public function testExceptionIsThrownWhenCallingFindByWithoutParameter() { |
| 312 | 312 | $this->em->getRepository(CmsUser::class) |
| 313 | - ->findByStatus(); |
|
| 313 | + ->findByStatus(); |
|
| 314 | 314 | } |
| 315 | 315 | |
| 316 | 316 | /** |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | */ |
| 319 | 319 | public function testExceptionIsThrownWhenUsingInvalidFieldName() { |
| 320 | 320 | $this->em->getRepository(CmsUser::class) |
| 321 | - ->findByThisFieldDoesNotExist('testvalue'); |
|
| 321 | + ->findByThisFieldDoesNotExist('testvalue'); |
|
| 322 | 322 | } |
| 323 | 323 | |
| 324 | 324 | /** |
@@ -330,7 +330,7 @@ discard block |
||
| 330 | 330 | $this->expectException(TransactionRequiredException::class); |
| 331 | 331 | |
| 332 | 332 | $this->em->getRepository(CmsUser::class) |
| 333 | - ->find(1, LockMode::PESSIMISTIC_READ); |
|
| 333 | + ->find(1, LockMode::PESSIMISTIC_READ); |
|
| 334 | 334 | } |
| 335 | 335 | |
| 336 | 336 | /** |
@@ -342,7 +342,7 @@ discard block |
||
| 342 | 342 | $this->expectException(TransactionRequiredException::class); |
| 343 | 343 | |
| 344 | 344 | $this->em->getRepository(CmsUser::class) |
| 345 | - ->find(1, LockMode::PESSIMISTIC_WRITE); |
|
| 345 | + ->find(1, LockMode::PESSIMISTIC_WRITE); |
|
| 346 | 346 | } |
| 347 | 347 | |
| 348 | 348 | /** |
@@ -354,7 +354,7 @@ discard block |
||
| 354 | 354 | $this->expectException(OptimisticLockException::class); |
| 355 | 355 | |
| 356 | 356 | $this->em->getRepository(CmsUser::class) |
| 357 | - ->find(1, LockMode::OPTIMISTIC); |
|
| 357 | + ->find(1, LockMode::OPTIMISTIC); |
|
| 358 | 358 | } |
| 359 | 359 | |
| 360 | 360 | /** |
@@ -435,13 +435,13 @@ discard block |
||
| 435 | 435 | */ |
| 436 | 436 | public function testFindOneByOrderBy() |
| 437 | 437 | { |
| 438 | - $this->loadFixture(); |
|
| 438 | + $this->loadFixture(); |
|
| 439 | 439 | |
| 440 | - $repos = $this->em->getRepository(CmsUser::class); |
|
| 441 | - $userAsc = $repos->findOneBy([], ["username" => "ASC"]); |
|
| 442 | - $userDesc = $repos->findOneBy([], ["username" => "DESC"]); |
|
| 440 | + $repos = $this->em->getRepository(CmsUser::class); |
|
| 441 | + $userAsc = $repos->findOneBy([], ["username" => "ASC"]); |
|
| 442 | + $userDesc = $repos->findOneBy([], ["username" => "DESC"]); |
|
| 443 | 443 | |
| 444 | - self::assertNotSame($userAsc, $userDesc); |
|
| 444 | + self::assertNotSame($userAsc, $userDesc); |
|
| 445 | 445 | } |
| 446 | 446 | |
| 447 | 447 | /** |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\Tests\ORM\Functional; |
| 6 | 6 | |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | $repos = $this->em->getRepository(CmsUser::class); |
| 183 | 183 | |
| 184 | 184 | $user = $repos->find($user1Id); |
| 185 | - self::assertInstanceOf(CmsUser::class,$user); |
|
| 185 | + self::assertInstanceOf(CmsUser::class, $user); |
|
| 186 | 186 | self::assertEquals('Roman', $user->name); |
| 187 | 187 | self::assertEquals('freak', $user->status); |
| 188 | 188 | } |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | |
| 195 | 195 | $users = $repos->findBy(['status' => 'dev']); |
| 196 | 196 | self::assertEquals(2, count($users)); |
| 197 | - self::assertInstanceOf(CmsUser::class,$users[0]); |
|
| 197 | + self::assertInstanceOf(CmsUser::class, $users[0]); |
|
| 198 | 198 | self::assertEquals('Guilherme', $users[0]->name); |
| 199 | 199 | self::assertEquals('dev', $users[0]->status); |
| 200 | 200 | } |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | $addresses = $repository->findBy(['user' => [$user1->getId(), $user2->getId()]]); |
| 221 | 221 | |
| 222 | 222 | self::assertEquals(2, count($addresses)); |
| 223 | - self::assertInstanceOf(CmsAddress::class,$addresses[0]); |
|
| 223 | + self::assertInstanceOf(CmsAddress::class, $addresses[0]); |
|
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | public function testFindByAssociationWithObjectAsParameter() |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | $addresses = $repository->findBy(['user' => [$user1, $user2]]); |
| 245 | 245 | |
| 246 | 246 | self::assertEquals(2, count($addresses)); |
| 247 | - self::assertInstanceOf(CmsAddress::class,$addresses[0]); |
|
| 247 | + self::assertInstanceOf(CmsAddress::class, $addresses[0]); |
|
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | public function testFindFieldByMagicCall() |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | |
| 255 | 255 | $users = $repos->findByStatus('dev'); |
| 256 | 256 | self::assertEquals(2, count($users)); |
| 257 | - self::assertInstanceOf(CmsUser::class,$users[0]); |
|
| 257 | + self::assertInstanceOf(CmsUser::class, $users[0]); |
|
| 258 | 258 | self::assertEquals('Guilherme', $users[0]->name); |
| 259 | 259 | self::assertEquals('dev', $users[0]->status); |
| 260 | 260 | } |
@@ -594,7 +594,7 @@ discard block |
||
| 594 | 594 | self::assertEquals(2, count($usersAsc)); |
| 595 | 595 | self::assertEquals(2, count($usersDesc)); |
| 596 | 596 | |
| 597 | - self::assertInstanceOf(CmsUser::class,$usersAsc[0]); |
|
| 597 | + self::assertInstanceOf(CmsUser::class, $usersAsc[0]); |
|
| 598 | 598 | self::assertEquals('Alexander', $usersAsc[0]->name); |
| 599 | 599 | self::assertEquals('dev', $usersAsc[0]->status); |
| 600 | 600 | |
@@ -675,7 +675,7 @@ discard block |
||
| 675 | 675 | public function testCanRetrieveRepositoryFromClassNameWithLeadingBackslash() |
| 676 | 676 | { |
| 677 | 677 | self::assertSame( |
| 678 | - $this->em->getRepository('\\' . CmsUser::class), |
|
| 678 | + $this->em->getRepository('\\'.CmsUser::class), |
|
| 679 | 679 | $this->em->getRepository(CmsUser::class) |
| 680 | 680 | ); |
| 681 | 681 | } |
@@ -713,7 +713,7 @@ discard block |
||
| 713 | 713 | $data = $repo->findBy(['user' => [1, 2, 3]]); |
| 714 | 714 | |
| 715 | 715 | $query = array_pop($this->sqlLoggerStack->queries); |
| 716 | - self::assertEquals([1,2,3], $query['params'][0]); |
|
| 716 | + self::assertEquals([1, 2, 3], $query['params'][0]); |
|
| 717 | 717 | self::assertEquals(Connection::PARAM_INT_ARRAY, $query['types'][0]); |
| 718 | 718 | } |
| 719 | 719 | |
@@ -173,6 +173,10 @@ discard block |
||
| 173 | 173 | */ |
| 174 | 174 | public $phones; |
| 175 | 175 | |
| 176 | + /** |
|
| 177 | + * @param string $email |
|
| 178 | + * @param string $name |
|
| 179 | + */ |
|
| 176 | 180 | public function __construct($email, $name, array $numbers = []) |
| 177 | 181 | { |
| 178 | 182 | $this->name = $name; |
@@ -208,6 +212,9 @@ discard block |
||
| 208 | 212 | */ |
| 209 | 213 | public $user; |
| 210 | 214 | |
| 215 | + /** |
|
| 216 | + * @param DDC1335User $user |
|
| 217 | + */ |
|
| 211 | 218 | public function __construct($user, $number) |
| 212 | 219 | { |
| 213 | 220 | $this->user = $user; |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\Tests\ORM\Functional\Ticket; |
| 6 | 6 | |
@@ -22,14 +22,14 @@ discard block |
||
| 22 | 22 | ] |
| 23 | 23 | ); |
| 24 | 24 | $this->loadFixture(); |
| 25 | - } catch(\Exception $e) { |
|
| 25 | + } catch (\Exception $e) { |
|
| 26 | 26 | } |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | |
| 30 | 30 | public function testDql() |
| 31 | 31 | { |
| 32 | - $dql = 'SELECT u FROM ' . __NAMESPACE__ . '\DDC1335User u INDEX BY u.id'; |
|
| 32 | + $dql = 'SELECT u FROM '.__NAMESPACE__.'\DDC1335User u INDEX BY u.id'; |
|
| 33 | 33 | $query = $this->em->createQuery($dql); |
| 34 | 34 | $result = $query->getResult(); |
| 35 | 35 | |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | self::assertArrayHasKey(2, $result); |
| 39 | 39 | self::assertArrayHasKey(3, $result); |
| 40 | 40 | |
| 41 | - $dql = 'SELECT u, p FROM '.__NAMESPACE__ . '\DDC1335User u INDEX BY u.email INNER JOIN u.phones p INDEX BY p.id'; |
|
| 41 | + $dql = 'SELECT u, p FROM '.__NAMESPACE__.'\DDC1335User u INDEX BY u.email INNER JOIN u.phones p INDEX BY p.id'; |
|
| 42 | 42 | $query = $this->em->createQuery($dql); |
| 43 | 43 | $result = $query->getResult(); |
| 44 | 44 | |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | self::assertArrayHasKey(1, $result); |
| 81 | 81 | self::assertArrayHasKey(2, $result); |
| 82 | 82 | self::assertArrayHasKey(3, $result); |
| 83 | - self::assertEquals('SELECT u FROM ' . __NAMESPACE__ . '\DDC1335User u INDEX BY u.id', $dql); |
|
| 83 | + self::assertEquals('SELECT u FROM '.__NAMESPACE__.'\DDC1335User u INDEX BY u.id', $dql); |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | public function testIndexByUnique() |
@@ -95,13 +95,13 @@ discard block |
||
| 95 | 95 | self::assertArrayHasKey('[email protected]', $result); |
| 96 | 96 | self::assertArrayHasKey('[email protected]', $result); |
| 97 | 97 | self::assertArrayHasKey('[email protected]', $result); |
| 98 | - self::assertEquals('SELECT u FROM ' . __NAMESPACE__ . '\DDC1335User u INDEX BY u.email', $dql); |
|
| 98 | + self::assertEquals('SELECT u FROM '.__NAMESPACE__.'\DDC1335User u INDEX BY u.email', $dql); |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | public function testIndexWithJoin() |
| 102 | 102 | { |
| 103 | 103 | $builder = $this->em->createQueryBuilder(); |
| 104 | - $builder->select('u','p') |
|
| 104 | + $builder->select('u', 'p') |
|
| 105 | 105 | ->from(DDC1335User::class, 'u', 'u.email') |
| 106 | 106 | ->join('u.phones', 'p', null, null, 'p.id'); |
| 107 | 107 | |
@@ -129,18 +129,18 @@ discard block |
||
| 129 | 129 | self::assertArrayHasKey(8, $result['[email protected]']->phones->toArray()); |
| 130 | 130 | self::assertArrayHasKey(9, $result['[email protected]']->phones->toArray()); |
| 131 | 131 | |
| 132 | - self::assertEquals('SELECT u, p FROM '.__NAMESPACE__ . '\DDC1335User u INDEX BY u.email INNER JOIN u.phones p INDEX BY p.id', $dql); |
|
| 132 | + self::assertEquals('SELECT u, p FROM '.__NAMESPACE__.'\DDC1335User u INDEX BY u.email INNER JOIN u.phones p INDEX BY p.id', $dql); |
|
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | private function loadFixture() |
| 136 | 136 | { |
| 137 | - $p1 = ['11 xxxx-xxxx','11 yyyy-yyyy','11 zzzz-zzzz']; |
|
| 138 | - $p2 = ['22 xxxx-xxxx','22 yyyy-yyyy','22 zzzz-zzzz']; |
|
| 139 | - $p3 = ['33 xxxx-xxxx','33 yyyy-yyyy','33 zzzz-zzzz']; |
|
| 137 | + $p1 = ['11 xxxx-xxxx', '11 yyyy-yyyy', '11 zzzz-zzzz']; |
|
| 138 | + $p2 = ['22 xxxx-xxxx', '22 yyyy-yyyy', '22 zzzz-zzzz']; |
|
| 139 | + $p3 = ['33 xxxx-xxxx', '33 yyyy-yyyy', '33 zzzz-zzzz']; |
|
| 140 | 140 | |
| 141 | - $u1 = new DDC1335User("[email protected]", "Foo",$p1); |
|
| 142 | - $u2 = new DDC1335User("[email protected]", "Bar",$p2); |
|
| 143 | - $u3 = new DDC1335User("[email protected]", "Foo Bar",$p3); |
|
| 141 | + $u1 = new DDC1335User("[email protected]", "Foo", $p1); |
|
| 142 | + $u2 = new DDC1335User("[email protected]", "Bar", $p2); |
|
| 143 | + $u3 = new DDC1335User("[email protected]", "Foo Bar", $p3); |
|
| 144 | 144 | |
| 145 | 145 | $this->em->persist($u1); |
| 146 | 146 | $this->em->persist($u2); |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | $this->phones = new \Doctrine\Common\Collections\ArrayCollection(); |
| 185 | 185 | |
| 186 | 186 | foreach ($numbers as $number) { |
| 187 | - $this->phones->add(new DDC1335Phone($this,$number)); |
|
| 187 | + $this->phones->add(new DDC1335Phone($this, $number)); |
|
| 188 | 188 | } |
| 189 | 189 | } |
| 190 | 190 | } |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | |
| 215 | 215 | public function __construct($user, $number) |
| 216 | 216 | { |
| 217 | - $this->user = $user; |
|
| 218 | - $this->numericalValue = $number; |
|
| 217 | + $this->user = $user; |
|
| 218 | + $this->numericalValue = $number; |
|
| 219 | 219 | } |
| 220 | 220 | } |
@@ -119,6 +119,10 @@ discard block |
||
| 119 | 119 | */ |
| 120 | 120 | public $driverRides; |
| 121 | 121 | |
| 122 | + /** |
|
| 123 | + * @param integer $id |
|
| 124 | + * @param string $name |
|
| 125 | + */ |
|
| 122 | 126 | public function __construct($id, $name) |
| 123 | 127 | { |
| 124 | 128 | $this->driverRides = new ArrayCollection(); |
@@ -181,6 +185,10 @@ discard block |
||
| 181 | 185 | */ |
| 182 | 186 | public $carRides; |
| 183 | 187 | |
| 188 | + /** |
|
| 189 | + * @param string $brand |
|
| 190 | + * @param string $model |
|
| 191 | + */ |
|
| 184 | 192 | public function __construct($brand, $model) |
| 185 | 193 | { |
| 186 | 194 | $this->carRides = new ArrayCollection(); |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\Tests\ORM\Functional\Ticket; |
| 6 | 6 | |
@@ -38,6 +38,10 @@ |
||
| 38 | 38 | return $query->getSql(); |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | + /** |
|
| 42 | + * @param string $dqlToBeTested |
|
| 43 | + * @param string $sqlToBeConfirmed |
|
| 44 | + */ |
|
| 41 | 45 | public function assertSqlGeneration($dqlToBeTested, $sqlToBeConfirmed, $treeWalkers = [], $outputWalker = null) |
| 42 | 46 | { |
| 43 | 47 | try { |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\Tests\ORM\Functional; |
| 6 | 6 | |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | try { |
| 46 | 46 | $sqlGenerated = $this->generateSql($dqlToBeTested, $treeWalkers, $outputWalker); |
| 47 | 47 | } catch (\Exception $e) { |
| 48 | - $this->fail($e->getMessage() . ' at "' . $e->getFile() . '" on line ' . $e->getLine()); |
|
| 48 | + $this->fail($e->getMessage().' at "'.$e->getFile().'" on line '.$e->getLine()); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | self::assertEquals($sqlToBeConfirmed, $sqlGenerated); |
@@ -205,9 +205,9 @@ discard block |
||
| 205 | 205 | { |
| 206 | 206 | $rangeVariableDecl = $identificationVariableDecl->rangeVariableDeclaration; |
| 207 | 207 | $joinAssocPathExpression = new Query\AST\JoinAssociationPathExpression($rangeVariableDecl->aliasIdentificationVariable, 'address'); |
| 208 | - $joinAssocDeclaration = new Query\AST\JoinAssociationDeclaration($joinAssocPathExpression, $rangeVariableDecl->aliasIdentificationVariable . 'a', null); |
|
| 208 | + $joinAssocDeclaration = new Query\AST\JoinAssociationDeclaration($joinAssocPathExpression, $rangeVariableDecl->aliasIdentificationVariable.'a', null); |
|
| 209 | 209 | $join = new Query\AST\Join(Query\AST\Join::JOIN_TYPE_LEFT, $joinAssocDeclaration); |
| 210 | - $selectExpression = new Query\AST\SelectExpression($rangeVariableDecl->aliasIdentificationVariable . 'a', null, false); |
|
| 210 | + $selectExpression = new Query\AST\SelectExpression($rangeVariableDecl->aliasIdentificationVariable.'a', null, false); |
|
| 211 | 211 | |
| 212 | 212 | $identificationVariableDecl->joins[] = $join; |
| 213 | 213 | $selectStatement->selectClause->selectExpressions[] = $selectExpression; |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | $userMetadata = $entityManager->getClassMetadata(CmsUser::class); |
| 217 | 217 | $addressMetadata = $entityManager->getClassMetadata(CmsAddress::class); |
| 218 | 218 | |
| 219 | - $this->setQueryComponent($rangeVariableDecl->aliasIdentificationVariable . 'a', |
|
| 219 | + $this->setQueryComponent($rangeVariableDecl->aliasIdentificationVariable.'a', |
|
| 220 | 220 | [ |
| 221 | 221 | 'metadata' => $addressMetadata, |
| 222 | 222 | 'parent' => $rangeVariableDecl->aliasIdentificationVariable, |
@@ -41,9 +41,9 @@ discard block |
||
| 41 | 41 | */ |
| 42 | 42 | abstract class AbstractEntityPersister implements CachedEntityPersister |
| 43 | 43 | { |
| 44 | - /** |
|
| 45 | - * @var \Doctrine\ORM\UnitOfWork |
|
| 46 | - */ |
|
| 44 | + /** |
|
| 45 | + * @var \Doctrine\ORM\UnitOfWork |
|
| 46 | + */ |
|
| 47 | 47 | protected $uow; |
| 48 | 48 | |
| 49 | 49 | /** |
@@ -61,9 +61,9 @@ discard block |
||
| 61 | 61 | */ |
| 62 | 62 | protected $class; |
| 63 | 63 | |
| 64 | - /** |
|
| 65 | - * @var array |
|
| 66 | - */ |
|
| 64 | + /** |
|
| 65 | + * @var array |
|
| 66 | + */ |
|
| 67 | 67 | protected $queuedCache = []; |
| 68 | 68 | |
| 69 | 69 | /** |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | /** |
| 286 | 286 | * Generates a string of currently query |
| 287 | 287 | * |
| 288 | - * @param array $query |
|
| 288 | + * @param string $query |
|
| 289 | 289 | * @param string $criteria |
| 290 | 290 | * @param array $orderBy |
| 291 | 291 | * @param integer $limit |
@@ -352,6 +352,7 @@ discard block |
||
| 352 | 352 | |
| 353 | 353 | /** |
| 354 | 354 | * {@inheritdoc} |
| 355 | + * @param string $fieldName |
|
| 355 | 356 | */ |
| 356 | 357 | public function getOwningTable($fieldName) |
| 357 | 358 | { |
@@ -376,6 +377,7 @@ discard block |
||
| 376 | 377 | |
| 377 | 378 | /** |
| 378 | 379 | * {@inheritdoc} |
| 380 | + * @param \Doctrine\Tests\Models\Cache\Country $entity |
|
| 379 | 381 | */ |
| 380 | 382 | public function insert($entity) |
| 381 | 383 | { |
@@ -676,7 +678,7 @@ discard block |
||
| 676 | 678 | } |
| 677 | 679 | |
| 678 | 680 | /** |
| 679 | - * @param array $association |
|
| 681 | + * @param AssociationMetadata $association |
|
| 680 | 682 | * @param array $ownerId |
| 681 | 683 | * |
| 682 | 684 | * @return CollectionCacheKey |
@@ -34,12 +34,10 @@ |
||
| 34 | 34 | use Doctrine\ORM\Mapping\FetchMode; |
| 35 | 35 | use Doctrine\ORM\Mapping\ManyToManyAssociationMetadata; |
| 36 | 36 | use Doctrine\ORM\Mapping\OneToManyAssociationMetadata; |
| 37 | -use Doctrine\ORM\Mapping\OneToOneAssociationMetadata; |
|
| 38 | 37 | use Doctrine\ORM\Mapping\ToOneAssociationMetadata; |
| 39 | 38 | use Doctrine\ORM\PersistentCollection; |
| 40 | 39 | use Doctrine\ORM\EntityManagerInterface; |
| 41 | 40 | use Doctrine\ORM\Persisters\Entity\EntityPersister; |
| 42 | - |
|
| 43 | 41 | use Doctrine\Common\Util\ClassUtils; |
| 44 | 42 | use Doctrine\Common\Collections\Criteria; |
| 45 | 43 | |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | |
| 4 | -declare(strict_types=1); |
|
| 4 | +declare(strict_types = 1); |
|
| 5 | 5 | |
| 6 | 6 | namespace Doctrine\ORM\Cache\Persister\Entity; |
| 7 | 7 | |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | ? $this->persister->expandCriteriaParameters($criteria) |
| 283 | 283 | : $this->persister->expandParameters($criteria); |
| 284 | 284 | |
| 285 | - return sha1($query . serialize($params) . serialize($orderBy) . $limit . $offset); |
|
| 285 | + return sha1($query.serialize($params).serialize($orderBy).$limit.$offset); |
|
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 | /** |