@@ -200,6 +200,9 @@ discard block |
||
| 200 | 200 | */ |
| 201 | 201 | public $address; |
| 202 | 202 | |
| 203 | + /** |
|
| 204 | + * @param string $address |
|
| 205 | + */ |
|
| 203 | 206 | public function __construct($address) |
| 204 | 207 | { |
| 205 | 208 | $this->address = $address; |
@@ -226,6 +229,9 @@ discard block |
||
| 226 | 229 | */ |
| 227 | 230 | public $name; |
| 228 | 231 | |
| 232 | + /** |
|
| 233 | + * @param string $name |
|
| 234 | + */ |
|
| 229 | 235 | public function __construct($name) |
| 230 | 236 | { |
| 231 | 237 | $this->name = $name; |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | |
| 163 | 163 | $this->addresses = $addresses; |
| 164 | 164 | |
| 165 | - $addresses->map(function ($address) use ($self) { |
|
| 165 | + $addresses->map(function($address) use ($self) { |
|
| 166 | 166 | $address->user = $self; |
| 167 | 167 | }); |
| 168 | 168 | } |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | |
| 174 | 174 | $this->pets = $pets; |
| 175 | 175 | |
| 176 | - $pets->map(function ($pet) use ($self) { |
|
| 176 | + $pets->map(function($pet) use ($self) { |
|
| 177 | 177 | $pet->owner = $self; |
| 178 | 178 | }); |
| 179 | 179 | } |
@@ -151,6 +151,9 @@ discard block |
||
| 151 | 151 | $this->books = new \Doctrine\Common\Collections\ArrayCollection; |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | + /** |
|
| 155 | + * @param string $title |
|
| 156 | + */ |
|
| 154 | 157 | public function addBook($title) |
| 155 | 158 | { |
| 156 | 159 | $book = new DDC618Book($title, $this); |
@@ -175,6 +178,9 @@ discard block |
||
| 175 | 178 | /** @ManyToOne(targetEntity="DDC618Author", inversedBy="books") */ |
| 176 | 179 | public $author; |
| 177 | 180 | |
| 181 | + /** |
|
| 182 | + * @param DDC618Author $author |
|
| 183 | + */ |
|
| 178 | 184 | function __construct($title, $author) |
| 179 | 185 | { |
| 180 | 186 | $this->title = $title; |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | public function testIndexByJoin() |
| 72 | 72 | { |
| 73 | 73 | $dql = 'SELECT A, B FROM Doctrine\Tests\ORM\Functional\Ticket\DDC618Author A '. |
| 74 | - 'INNER JOIN A.books B INDEX BY B.title ORDER BY A.name ASC'; |
|
| 74 | + 'INNER JOIN A.books B INDEX BY B.title ORDER BY A.name ASC'; |
|
| 75 | 75 | $result = $this->_em->createQuery($dql)->getResult(\Doctrine\ORM\Query::HYDRATE_OBJECT); |
| 76 | 76 | |
| 77 | 77 | $this->assertEquals(3, count($result[0]->books)); // Alice, Joe doesn't appear because he has no books. |
@@ -95,14 +95,14 @@ discard block |
||
| 95 | 95 | public function testIndexByToOneJoinSilentlyIgnored() |
| 96 | 96 | { |
| 97 | 97 | $dql = 'SELECT B, A FROM Doctrine\Tests\ORM\Functional\Ticket\DDC618Book B '. |
| 98 | - 'INNER JOIN B.author A INDEX BY A.name ORDER BY A.name ASC'; |
|
| 98 | + 'INNER JOIN B.author A INDEX BY A.name ORDER BY A.name ASC'; |
|
| 99 | 99 | $result = $this->_em->createQuery($dql)->getResult(\Doctrine\ORM\Query::HYDRATE_OBJECT); |
| 100 | 100 | |
| 101 | 101 | $this->assertInstanceOf(DDC618Book::class, $result[0]); |
| 102 | 102 | $this->assertInstanceOf(DDC618Author::class, $result[0]->author); |
| 103 | 103 | |
| 104 | 104 | $dql = 'SELECT B, A FROM Doctrine\Tests\ORM\Functional\Ticket\DDC618Book B '. |
| 105 | - 'INNER JOIN B.author A INDEX BY A.name ORDER BY A.name ASC'; |
|
| 105 | + 'INNER JOIN B.author A INDEX BY A.name ORDER BY A.name ASC'; |
|
| 106 | 106 | $result = $this->_em->createQuery($dql)->getResult(\Doctrine\ORM\Query::HYDRATE_ARRAY); |
| 107 | 107 | |
| 108 | 108 | $this->assertEquals("Alice", $result[0]['author']['name']); |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | public function testCombineIndexBy() |
| 115 | 115 | { |
| 116 | 116 | $dql = 'SELECT A, B FROM Doctrine\Tests\ORM\Functional\Ticket\DDC618Author A INDEX BY A.id '. |
| 117 | - 'INNER JOIN A.books B INDEX BY B.title ORDER BY A.name ASC'; |
|
| 117 | + 'INNER JOIN A.books B INDEX BY B.title ORDER BY A.name ASC'; |
|
| 118 | 118 | $result = $this->_em->createQuery($dql)->getResult(\Doctrine\ORM\Query::HYDRATE_OBJECT); |
| 119 | 119 | |
| 120 | 120 | $this->assertArrayHasKey(11, $result); // Alice |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | |
| 37 | 37 | $this->_em->flush(); |
| 38 | 38 | $this->_em->clear(); |
| 39 | - } catch(\Exception $e) { |
|
| 39 | + } catch (\Exception $e) { |
|
| 40 | 40 | |
| 41 | 41 | } |
| 42 | 42 | } |
@@ -76,17 +76,17 @@ discard block |
||
| 76 | 76 | |
| 77 | 77 | $this->assertEquals(3, count($result[0]->books)); // Alice, Joe doesn't appear because he has no books. |
| 78 | 78 | $this->assertEquals('Alice', $result[0]->name); |
| 79 | - $this->assertTrue( isset($result[0]->books["In Wonderland"] ), "Indexing by title should have books by title."); |
|
| 80 | - $this->assertTrue( isset($result[0]->books["Reloaded"] ), "Indexing by title should have books by title."); |
|
| 81 | - $this->assertTrue( isset($result[0]->books["Test"] ), "Indexing by title should have books by title."); |
|
| 79 | + $this->assertTrue(isset($result[0]->books["In Wonderland"]), "Indexing by title should have books by title."); |
|
| 80 | + $this->assertTrue(isset($result[0]->books["Reloaded"]), "Indexing by title should have books by title."); |
|
| 81 | + $this->assertTrue(isset($result[0]->books["Test"]), "Indexing by title should have books by title."); |
|
| 82 | 82 | |
| 83 | 83 | $result = $this->_em->createQuery($dql)->getResult(\Doctrine\ORM\Query::HYDRATE_ARRAY); |
| 84 | 84 | |
| 85 | 85 | $this->assertEquals(3, count($result[0]['books'])); // Alice, Joe doesn't appear because he has no books. |
| 86 | 86 | $this->assertEquals('Alice', $result[0]['name']); |
| 87 | - $this->assertTrue( isset($result[0]['books']["In Wonderland"] ), "Indexing by title should have books by title."); |
|
| 88 | - $this->assertTrue( isset($result[0]['books']["Reloaded"] ), "Indexing by title should have books by title."); |
|
| 89 | - $this->assertTrue( isset($result[0]['books']["Test"] ), "Indexing by title should have books by title."); |
|
| 87 | + $this->assertTrue(isset($result[0]['books']["In Wonderland"]), "Indexing by title should have books by title."); |
|
| 88 | + $this->assertTrue(isset($result[0]['books']["Reloaded"]), "Indexing by title should have books by title."); |
|
| 89 | + $this->assertTrue(isset($result[0]['books']["Test"]), "Indexing by title should have books by title."); |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | /** |
@@ -121,9 +121,9 @@ discard block |
||
| 121 | 121 | |
| 122 | 122 | $this->assertEquals(3, count($result[11]->books)); // Alice, Joe doesn't appear because he has no books. |
| 123 | 123 | $this->assertEquals('Alice', $result[11]->name); |
| 124 | - $this->assertTrue( isset($result[11]->books["In Wonderland"] ), "Indexing by title should have books by title."); |
|
| 125 | - $this->assertTrue( isset($result[11]->books["Reloaded"] ), "Indexing by title should have books by title."); |
|
| 126 | - $this->assertTrue( isset($result[11]->books["Test"] ), "Indexing by title should have books by title."); |
|
| 124 | + $this->assertTrue(isset($result[11]->books["In Wonderland"]), "Indexing by title should have books by title."); |
|
| 125 | + $this->assertTrue(isset($result[11]->books["Reloaded"]), "Indexing by title should have books by title."); |
|
| 126 | + $this->assertTrue(isset($result[11]->books["Test"]), "Indexing by title should have books by title."); |
|
| 127 | 127 | } |
| 128 | 128 | } |
| 129 | 129 | |
@@ -66,6 +66,9 @@ discard block |
||
| 66 | 66 | return $this->name; |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | + /** |
|
| 70 | + * @param string $name |
|
| 71 | + */ |
|
| 69 | 72 | public function setName($name) { |
| 70 | 73 | $this->name = $name; |
| 71 | 74 | } |
@@ -74,6 +77,9 @@ discard block |
||
| 74 | 77 | return $this->type; |
| 75 | 78 | } |
| 76 | 79 | |
| 80 | + /** |
|
| 81 | + * @param string $type |
|
| 82 | + */ |
|
| 77 | 83 | public function setType($type) { |
| 78 | 84 | $this->type = $type; |
| 79 | 85 | } |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | $this->_em->getClassMetadata(DDC656Entity::class) |
| 14 | 14 | ] |
| 15 | 15 | ); |
| 16 | - } catch(\Exception $e) { |
|
| 16 | + } catch (\Exception $e) { |
|
| 17 | 17 | |
| 18 | 18 | } |
| 19 | 19 | } |
@@ -137,6 +137,9 @@ discard block |
||
| 137 | 137 | */ |
| 138 | 138 | public $version; |
| 139 | 139 | |
| 140 | + /** |
|
| 141 | + * @param string $word |
|
| 142 | + */ |
|
| 140 | 143 | public function __construct($word) |
| 141 | 144 | { |
| 142 | 145 | $this->word = $word; |
@@ -166,6 +169,9 @@ discard block |
||
| 166 | 169 | */ |
| 167 | 170 | public $version; |
| 168 | 171 | |
| 172 | + /** |
|
| 173 | + * @param string $name |
|
| 174 | + */ |
|
| 169 | 175 | public function __construct($name) |
| 170 | 176 | { |
| 171 | 177 | $this->name = $name; |
@@ -183,6 +189,11 @@ discard block |
||
| 183 | 189 | /** @Column(type="integer") */ |
| 184 | 190 | public $rgt; |
| 185 | 191 | |
| 192 | + /** |
|
| 193 | + * @param string $name |
|
| 194 | + * @param integer $lft |
|
| 195 | + * @param integer $rgt |
|
| 196 | + */ |
|
| 186 | 197 | public function __construct($name, $lft, $rgt) |
| 187 | 198 | { |
| 188 | 199 | $this->name = $name; |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | $this->_em->getClassMetadata(DDC832Like::class), |
| 25 | 25 | ] |
| 26 | 26 | ); |
| 27 | - } catch(\Exception $e) { |
|
| 27 | + } catch (\Exception $e) { |
|
| 28 | 28 | } |
| 29 | 29 | } |
| 30 | 30 | |
@@ -118,6 +118,9 @@ discard block |
||
| 118 | 118 | return $this->name; |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | + /** |
|
| 122 | + * @param string $name |
|
| 123 | + */ |
|
| 121 | 124 | public function setName($name) |
| 122 | 125 | { |
| 123 | 126 | $this->name = $name; |
@@ -155,6 +158,9 @@ discard block |
||
| 155 | 158 | $this->calls = new \Doctrine\Common\Collections\ArrayCollection(); |
| 156 | 159 | } |
| 157 | 160 | |
| 161 | + /** |
|
| 162 | + * @param integer $id |
|
| 163 | + */ |
|
| 158 | 164 | public function setId($id) |
| 159 | 165 | { |
| 160 | 166 | $this->id = $id; |
@@ -165,6 +171,9 @@ discard block |
||
| 165 | 171 | $this->user = $user; |
| 166 | 172 | } |
| 167 | 173 | |
| 174 | + /** |
|
| 175 | + * @param string $phoneNumber |
|
| 176 | + */ |
|
| 168 | 177 | public function setPhoneNumber($phoneNumber) |
| 169 | 178 | { |
| 170 | 179 | $this->phonenumber = $phoneNumber; |
@@ -80,14 +80,14 @@ |
||
| 80 | 80 | $this->_em->clear(); |
| 81 | 81 | |
| 82 | 82 | // fetch-join that foreign-key/primary-key entity association |
| 83 | - $dql = "SELECT c, p FROM " . DDC881PhoneCall::class . " c JOIN c.phonenumber p"; |
|
| 83 | + $dql = "SELECT c, p FROM ".DDC881PhoneCall::class." c JOIN c.phonenumber p"; |
|
| 84 | 84 | $calls = $this->_em->createQuery($dql)->getResult(); |
| 85 | 85 | |
| 86 | 86 | $this->assertEquals(2, count($calls)); |
| 87 | 87 | $this->assertNotInstanceOf(Proxy::class, $calls[0]->getPhoneNumber()); |
| 88 | 88 | $this->assertNotInstanceOf(Proxy::class, $calls[1]->getPhoneNumber()); |
| 89 | 89 | |
| 90 | - $dql = "SELECT p, c FROM " . DDC881PhoneNumber::class . " p JOIN p.calls c"; |
|
| 90 | + $dql = "SELECT p, c FROM ".DDC881PhoneNumber::class." p JOIN p.calls c"; |
|
| 91 | 91 | $numbers = $this->_em->createQuery($dql)->getResult(); |
| 92 | 92 | |
| 93 | 93 | $this->assertEquals(2, count($numbers)); |
@@ -78,11 +78,17 @@ |
||
| 78 | 78 | */ |
| 79 | 79 | private $name; |
| 80 | 80 | |
| 81 | + /** |
|
| 82 | + * @param string $name |
|
| 83 | + */ |
|
| 81 | 84 | public function __construct($name) |
| 82 | 85 | { |
| 83 | 86 | $this->name = $name; |
| 84 | 87 | } |
| 85 | 88 | |
| 89 | + /** |
|
| 90 | + * @param string $name |
|
| 91 | + */ |
|
| 86 | 92 | public function setName($name) |
| 87 | 93 | { |
| 88 | 94 | $this->name = $name; |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | $this->_em->getClassMetadata(DDC960Child::class) |
| 17 | 17 | ] |
| 18 | 18 | ); |
| 19 | - } catch(\Exception $e) { |
|
| 19 | + } catch (\Exception $e) { |
|
| 20 | 20 | |
| 21 | 21 | } |
| 22 | 22 | } |
@@ -240,7 +240,7 @@ |
||
| 240 | 240 | |
| 241 | 241 | /** |
| 242 | 242 | * |
| 243 | - * @return Phrase |
|
| 243 | + * @return Lemma |
|
| 244 | 244 | */ |
| 245 | 245 | public function getParent() { |
| 246 | 246 | return $this->parent; |
@@ -86,7 +86,7 @@ |
||
| 86 | 86 | $this->assertInstanceOf(Lemma::class, $lemma); |
| 87 | 87 | $relations = $lemma->getRelations(); |
| 88 | 88 | |
| 89 | - foreach($relations as $relation) { |
|
| 89 | + foreach ($relations as $relation) { |
|
| 90 | 90 | $this->assertInstanceOf(Relation::class, $relation); |
| 91 | 91 | $this->assertTrue($relation->getType()->getType() != ''); |
| 92 | 92 | } |
@@ -339,6 +339,9 @@ discard block |
||
| 339 | 339 | /** @Embedded(class = "DDC93Timestamps") */ |
| 340 | 340 | public $timestamps; |
| 341 | 341 | |
| 342 | + /** |
|
| 343 | + * @param string $name |
|
| 344 | + */ |
|
| 342 | 345 | public function __construct($name = null, DDC93Address $address = null) |
| 343 | 346 | { |
| 344 | 347 | $this->name = $name; |
@@ -403,6 +406,9 @@ discard block |
||
| 403 | 406 | */ |
| 404 | 407 | public $name; |
| 405 | 408 | |
| 409 | + /** |
|
| 410 | + * @param string $name |
|
| 411 | + */ |
|
| 406 | 412 | public function __construct($name = null) |
| 407 | 413 | { |
| 408 | 414 | $this->name = $name; |
@@ -431,6 +437,11 @@ discard block |
||
| 431 | 437 | /** @Embedded(class = "DDC93Country") */ |
| 432 | 438 | public $country; |
| 433 | 439 | |
| 440 | + /** |
|
| 441 | + * @param string $street |
|
| 442 | + * @param string $zip |
|
| 443 | + * @param string $city |
|
| 444 | + */ |
|
| 434 | 445 | public function __construct($street = null, $zip = null, $city = null, DDC93Country $country = null) |
| 435 | 446 | { |
| 436 | 447 | $this->street = $street; |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | $this->_em->getClassMetadata(DDC3027Dog::class), |
| 28 | 28 | ] |
| 29 | 29 | ); |
| 30 | - } catch(\Exception $e) { |
|
| 30 | + } catch (\Exception $e) { |
|
| 31 | 31 | } |
| 32 | 32 | } |
| 33 | 33 | |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | $this->assertEquals('United States of America', $person->address->country->name); |
| 83 | 83 | |
| 84 | 84 | // 4. check deleting works |
| 85 | - $personId = $person->id;; |
|
| 85 | + $personId = $person->id; ; |
|
| 86 | 86 | $this->_em->remove($person); |
| 87 | 87 | $this->_em->flush(); |
| 88 | 88 | |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | $this->_em->flush(); |
| 107 | 107 | $this->_em->clear(); |
| 108 | 108 | |
| 109 | - $dql = "SELECT p FROM " . __NAMESPACE__ . "\DDC93Person p"; |
|
| 109 | + $dql = "SELECT p FROM ".__NAMESPACE__."\DDC93Person p"; |
|
| 110 | 110 | $persons = $this->_em->createQuery($dql)->getResult(); |
| 111 | 111 | |
| 112 | 112 | $this->assertCount(3, $persons); |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | $this->assertEquals('United States of America', $person->address->country->name); |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | - $dql = "SELECT p FROM " . __NAMESPACE__ . "\DDC93Person p"; |
|
| 122 | + $dql = "SELECT p FROM ".__NAMESPACE__."\DDC93Person p"; |
|
| 123 | 123 | $persons = $this->_em->createQuery($dql)->getArrayResult(); |
| 124 | 124 | |
| 125 | 125 | foreach ($persons as $person) { |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | $this->_em->flush($person); |
| 145 | 145 | |
| 146 | 146 | // SELECT |
| 147 | - $selectDql = "SELECT p FROM " . __NAMESPACE__ ."\\DDC93Person p WHERE p.address.city = :city AND p.address.country.name = :country"; |
|
| 147 | + $selectDql = "SELECT p FROM ".__NAMESPACE__."\\DDC93Person p WHERE p.address.city = :city AND p.address.country.name = :country"; |
|
| 148 | 148 | $loadedPerson = $this->_em->createQuery($selectDql) |
| 149 | 149 | ->setParameter('city', 'Karlsruhe') |
| 150 | 150 | ->setParameter('country', 'Germany') |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | ); |
| 160 | 160 | |
| 161 | 161 | // UPDATE |
| 162 | - $updateDql = "UPDATE " . __NAMESPACE__ . "\\DDC93Person p SET p.address.street = :street, p.address.country.name = :country WHERE p.address.city = :city"; |
|
| 162 | + $updateDql = "UPDATE ".__NAMESPACE__."\\DDC93Person p SET p.address.street = :street, p.address.country.name = :country WHERE p.address.city = :city"; |
|
| 163 | 163 | $this->_em->createQuery($updateDql) |
| 164 | 164 | ->setParameter('street', 'Boo') |
| 165 | 165 | ->setParameter('country', 'DE') |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | $this->assertEquals('DE', $person->address->country->name); |
| 172 | 172 | |
| 173 | 173 | // DELETE |
| 174 | - $this->_em->createQuery("DELETE " . __NAMESPACE__ . "\\DDC93Person p WHERE p.address.city = :city AND p.address.country.name = :country") |
|
| 174 | + $this->_em->createQuery("DELETE ".__NAMESPACE__."\\DDC93Person p WHERE p.address.city = :city AND p.address.country.name = :country") |
|
| 175 | 175 | ->setParameter('city', 'Karlsruhe') |
| 176 | 176 | ->setParameter('country', 'DE') |
| 177 | 177 | ->execute(); |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | $this->_em->clear(); |
| 189 | 189 | |
| 190 | 190 | // Prove that the entity was persisted correctly. |
| 191 | - $dql = "SELECT p FROM " . __NAMESPACE__ ."\\DDC93Person p WHERE p.name = :name"; |
|
| 191 | + $dql = "SELECT p FROM ".__NAMESPACE__."\\DDC93Person p WHERE p.name = :name"; |
|
| 192 | 192 | |
| 193 | 193 | $person = $this->_em->createQuery($dql) |
| 194 | 194 | ->setParameter('name', 'Karl') |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | // Clear the EM and prove that the embeddable can be the subject of a partial query. |
| 203 | 203 | $this->_em->clear(); |
| 204 | 204 | |
| 205 | - $dql = "SELECT PARTIAL p.{id,address.city} FROM " . __NAMESPACE__ ."\\DDC93Person p WHERE p.name = :name"; |
|
| 205 | + $dql = "SELECT PARTIAL p.{id,address.city} FROM ".__NAMESPACE__."\\DDC93Person p WHERE p.name = :name"; |
|
| 206 | 206 | |
| 207 | 207 | $person = $this->_em->createQuery($dql) |
| 208 | 208 | ->setParameter('name', 'Karl') |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | // Clear the EM and prove that the embeddable can be the subject of a partial query regardless of attributes positions. |
| 219 | 219 | $this->_em->clear(); |
| 220 | 220 | |
| 221 | - $dql = "SELECT PARTIAL p.{address.city, id} FROM " . __NAMESPACE__ ."\\DDC93Person p WHERE p.name = :name"; |
|
| 221 | + $dql = "SELECT PARTIAL p.{address.city, id} FROM ".__NAMESPACE__."\\DDC93Person p WHERE p.name = :name"; |
|
| 222 | 222 | |
| 223 | 223 | $person = $this->_em->createQuery($dql) |
| 224 | 224 | ->setParameter('name', 'Karl') |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | $this->expectException(QueryException::class); |
| 238 | 238 | $this->expectExceptionMessage('no field or association named address.asdfasdf'); |
| 239 | 239 | |
| 240 | - $this->_em->createQuery("SELECT p FROM " . __NAMESPACE__ . "\\DDC93Person p WHERE p.address.asdfasdf IS NULL") |
|
| 240 | + $this->_em->createQuery("SELECT p FROM ".__NAMESPACE__."\\DDC93Person p WHERE p.address.asdfasdf IS NULL") |
|
| 241 | 241 | ->execute(); |
| 242 | 242 | } |
| 243 | 243 | |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | $this->expectException(QueryException::class); |
| 247 | 247 | $this->expectExceptionMessage("no mapped field named 'address.asdfasdf'"); |
| 248 | 248 | |
| 249 | - $this->_em->createQuery("SELECT PARTIAL p.{id,address.asdfasdf} FROM " . __NAMESPACE__ . "\\DDC93Person p") |
|
| 249 | + $this->_em->createQuery("SELECT PARTIAL p.{id,address.asdfasdf} FROM ".__NAMESPACE__."\\DDC93Person p") |
|
| 250 | 250 | ->execute(); |
| 251 | 251 | } |
| 252 | 252 | |
@@ -308,15 +308,15 @@ discard block |
||
| 308 | 308 | $this->expectException(MappingException::class); |
| 309 | 309 | $this->expectExceptionMessage( |
| 310 | 310 | sprintf( |
| 311 | - 'Infinite nesting detected for embedded property %s::nested. ' . |
|
| 311 | + 'Infinite nesting detected for embedded property %s::nested. '. |
|
| 312 | 312 | 'You cannot embed an embeddable from the same type inside an embeddable.', |
| 313 | - __NAMESPACE__ . '\\' . $declaredEmbeddableClassName |
|
| 313 | + __NAMESPACE__.'\\'.$declaredEmbeddableClassName |
|
| 314 | 314 | ) |
| 315 | 315 | ); |
| 316 | 316 | |
| 317 | 317 | $this->_schemaTool->createSchema( |
| 318 | 318 | [ |
| 319 | - $this->_em->getClassMetadata(__NAMESPACE__ . '\\' . $embeddableClassName), |
|
| 319 | + $this->_em->getClassMetadata(__NAMESPACE__.'\\'.$embeddableClassName), |
|
| 320 | 320 | ] |
| 321 | 321 | ); |
| 322 | 322 | } |
@@ -124,6 +124,9 @@ discard block |
||
| 124 | 124 | $this->assertEquals(503, $this->countQuery($em)); |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | + /** |
|
| 128 | + * @param string $label |
|
| 129 | + */ |
|
| 127 | 130 | private function queryEntity(EntityManagerInterface $em, $label) |
| 128 | 131 | { |
| 129 | 132 | $times = 100; |
@@ -155,6 +158,9 @@ discard block |
||
| 155 | 158 | printf("\n%s\n", str_repeat('-', 50)); |
| 156 | 159 | } |
| 157 | 160 | |
| 161 | + /** |
|
| 162 | + * @param string $label |
|
| 163 | + */ |
|
| 158 | 164 | public function findEntityOneToMany(EntityManagerInterface $em, $label) |
| 159 | 165 | { |
| 160 | 166 | $times = 50; |
@@ -214,6 +220,9 @@ discard block |
||
| 214 | 220 | printf("\n%s\n", str_repeat('-', 50)); |
| 215 | 221 | } |
| 216 | 222 | |
| 223 | + /** |
|
| 224 | + * @param string $label |
|
| 225 | + */ |
|
| 217 | 226 | private function findEntity(EntityManagerInterface $em, $label) |
| 218 | 227 | { |
| 219 | 228 | $times = 10; |
@@ -249,6 +258,9 @@ discard block |
||
| 249 | 258 | printf("\n%s\n", str_repeat('-', 50)); |
| 250 | 259 | } |
| 251 | 260 | |
| 261 | + /** |
|
| 262 | + * @param string $label |
|
| 263 | + */ |
|
| 252 | 264 | private function findAllEntity(EntityManagerInterface $em, $label) |
| 253 | 265 | { |
| 254 | 266 | $times = 100; |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | $size = 500; |
| 131 | 131 | $startPersist = microtime(true); |
| 132 | 132 | |
| 133 | - echo PHP_EOL . $label; |
|
| 133 | + echo PHP_EOL.$label; |
|
| 134 | 134 | |
| 135 | 135 | for ($i = 0; $i < $size; $i++) { |
| 136 | 136 | $em->persist(new Country("Country $i")); |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | $startPersist = microtime(true); |
| 165 | 165 | $country = new Country("Country"); |
| 166 | 166 | |
| 167 | - echo PHP_EOL . $label; |
|
| 167 | + echo PHP_EOL.$label; |
|
| 168 | 168 | |
| 169 | 169 | $em->persist($country); |
| 170 | 170 | $em->flush(); |
@@ -194,9 +194,9 @@ discard block |
||
| 194 | 194 | $em->flush(); |
| 195 | 195 | $em->clear(); |
| 196 | 196 | |
| 197 | - printf("\n[%s] persist %s states and %s cities", number_format( microtime(true) - $startPersist, 6), count($states), count($cities)); |
|
| 197 | + printf("\n[%s] persist %s states and %s cities", number_format(microtime(true) - $startPersist, 6), count($states), count($cities)); |
|
| 198 | 198 | |
| 199 | - $startFind = microtime(true); |
|
| 199 | + $startFind = microtime(true); |
|
| 200 | 200 | |
| 201 | 201 | for ($i = 0; $i < $times; $i++) { |
| 202 | 202 | |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | $countries = []; |
| 222 | 222 | $startPersist = microtime(true); |
| 223 | 223 | |
| 224 | - echo PHP_EOL . $label; |
|
| 224 | + echo PHP_EOL.$label; |
|
| 225 | 225 | |
| 226 | 226 | for ($i = 0; $i < $size; $i++) { |
| 227 | 227 | $country = new Country("Country $i"); |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | |
| 237 | 237 | printf("\n[%s] persist %s countries", number_format(microtime(true) - $startPersist, 6), $size); |
| 238 | 238 | |
| 239 | - $startFind = microtime(true); |
|
| 239 | + $startFind = microtime(true); |
|
| 240 | 240 | |
| 241 | 241 | for ($i = 0; $i <= $times; $i++) { |
| 242 | 242 | foreach ($countries as $country) { |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | $startPersist = microtime(true); |
| 257 | 257 | $rep = $em->getRepository(Country::class); |
| 258 | 258 | |
| 259 | - echo PHP_EOL . $label; |
|
| 259 | + echo PHP_EOL.$label; |
|
| 260 | 260 | |
| 261 | 261 | for ($i = 0; $i < $size; $i++) { |
| 262 | 262 | $em->persist(new Country("Country $i")); |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | |
| 268 | 268 | printf("\n[%s] persist %s countries", number_format(microtime(true) - $startPersist, 6), $size); |
| 269 | 269 | |
| 270 | - $startFind = microtime(true); |
|
| 270 | + $startFind = microtime(true); |
|
| 271 | 271 | |
| 272 | 272 | for ($i = 0; $i <= $times; $i++) { |
| 273 | 273 | $list = $rep->findAll(); |