@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | $this->_em->flush(); |
| 183 | 183 | $this->_em->clear(CmsUser::class); |
| 184 | 184 | |
| 185 | - $dql = 'SELECT u FROM ' . CmsUser::class . ' u WHERE u.id = ?1'; |
|
| 185 | + $dql = 'SELECT u FROM '.CmsUser::class.' u WHERE u.id = ?1'; |
|
| 186 | 186 | $query = $this->_em->createQuery($dql); |
| 187 | 187 | $query->setParameter(1, $user); |
| 188 | 188 | |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | |
| 227 | 227 | $this->_em->clear(CmsArticle::class); |
| 228 | 228 | |
| 229 | - $sql = 'UPDATE cms_articles SET version = version + 1 WHERE id = ' . $article->id; |
|
| 229 | + $sql = 'UPDATE cms_articles SET version = version + 1 WHERE id = '.$article->id; |
|
| 230 | 230 | $this->_em->getConnection()->executeUpdate($sql); |
| 231 | 231 | |
| 232 | 232 | $this->expectException(OptimisticLockException::class); |
@@ -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(); |
| 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 | } |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | $this->_em->persist($user); |
| 43 | 43 | $this->_em->flush(); |
| 44 | 44 | |
| 45 | - $repository = $this->_em->getRepository(__NAMESPACE__ . "\DDC2984User"); |
|
| 45 | + $repository = $this->_em->getRepository(__NAMESPACE__."\DDC2984User"); |
|
| 46 | 46 | |
| 47 | 47 | $sameUser = $repository->find(new DDC2984DomainUserId('unique_id_within_a_vo')); |
| 48 | 48 | |
@@ -224,8 +224,8 @@ discard block |
||
| 224 | 224 | */ |
| 225 | 225 | public function transactional($func) |
| 226 | 226 | { |
| 227 | - if (!is_callable($func)) { |
|
| 228 | - throw new \InvalidArgumentException('Expected argument of type "callable", got "' . gettype($func) . '"'); |
|
| 227 | + if ( ! is_callable($func)) { |
|
| 228 | + throw new \InvalidArgumentException('Expected argument of type "callable", got "'.gettype($func).'"'); |
|
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | $this->conn->beginTransaction(); |
@@ -355,7 +355,7 @@ discard block |
||
| 355 | 355 | { |
| 356 | 356 | if (func_num_args() !== 0) { |
| 357 | 357 | @trigger_error( |
| 358 | - 'Calling ' . __METHOD__ . '() with any arguments to flush specific entities is deprecated and will not be supported in Doctrine 3.0.', |
|
| 358 | + 'Calling '.__METHOD__.'() with any arguments to flush specific entities is deprecated and will not be supported in Doctrine 3.0.', |
|
| 359 | 359 | E_USER_DEPRECATED |
| 360 | 360 | ); |
| 361 | 361 | } |
@@ -664,7 +664,7 @@ discard block |
||
| 664 | 664 | */ |
| 665 | 665 | public function detach($entity) |
| 666 | 666 | { |
| 667 | - @trigger_error('Method ' . __METHOD__ . '() is deprecated and will be removed in Doctrine 3.0.', E_USER_DEPRECATED); |
|
| 667 | + @trigger_error('Method '.__METHOD__.'() is deprecated and will be removed in Doctrine 3.0.', E_USER_DEPRECATED); |
|
| 668 | 668 | |
| 669 | 669 | if ( ! is_object($entity)) { |
| 670 | 670 | throw ORMInvalidArgumentException::invalidObject('EntityManager#detach()', $entity); |
@@ -689,7 +689,7 @@ discard block |
||
| 689 | 689 | */ |
| 690 | 690 | public function merge($entity) |
| 691 | 691 | { |
| 692 | - @trigger_error('Method ' . __METHOD__ . '() is deprecated and will be removed in Doctrine 3.0.', E_USER_DEPRECATED); |
|
| 692 | + @trigger_error('Method '.__METHOD__.'() is deprecated and will be removed in Doctrine 3.0.', E_USER_DEPRECATED); |
|
| 693 | 693 | |
| 694 | 694 | if ( ! is_object($entity)) { |
| 695 | 695 | throw ORMInvalidArgumentException::invalidObject('EntityManager#merge()', $entity); |
@@ -707,7 +707,7 @@ discard block |
||
| 707 | 707 | */ |
| 708 | 708 | public function copy($entity, $deep = false) |
| 709 | 709 | { |
| 710 | - @trigger_error('Method ' . __METHOD__ . '() is deprecated and will be removed in Doctrine 3.0.', E_USER_DEPRECATED); |
|
| 710 | + @trigger_error('Method '.__METHOD__.'() is deprecated and will be removed in Doctrine 3.0.', E_USER_DEPRECATED); |
|
| 711 | 711 | |
| 712 | 712 | throw new \BadMethodCallException("Not implemented."); |
| 713 | 713 | } |
@@ -781,7 +781,7 @@ discard block |
||
| 781 | 781 | */ |
| 782 | 782 | public function isOpen() |
| 783 | 783 | { |
| 784 | - return (!$this->closed); |
|
| 784 | + return ( ! $this->closed); |
|
| 785 | 785 | } |
| 786 | 786 | |
| 787 | 787 | /** |
@@ -892,7 +892,7 @@ discard block |
||
| 892 | 892 | sprintf( |
| 893 | 893 | 'Invalid $connection argument of type %s given%s.', |
| 894 | 894 | is_object($connection) ? get_class($connection) : gettype($connection), |
| 895 | - is_object($connection) ? '' : ': "' . $connection . '"' |
|
| 895 | + is_object($connection) ? '' : ': "'.$connection.'"' |
|
| 896 | 896 | ) |
| 897 | 897 | ); |
| 898 | 898 | } |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | protected function execute(InputInterface $input, OutputInterface $output) |
| 62 | 62 | { |
| 63 | 63 | $ui = new SymfonyStyle($input, $output); |
| 64 | - $ui->warning('Command ' . $this->getName() . ' is deprecated and will be removed in Doctrine 3.0.'); |
|
| 64 | + $ui->warning('Command '.$this->getName().' is deprecated and will be removed in Doctrine 3.0.'); |
|
| 65 | 65 | |
| 66 | 66 | $em = $this->getHelper('em')->getEntityManager(); |
| 67 | 67 | |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | protected function execute(InputInterface $input, OutputInterface $output) |
| 121 | 121 | { |
| 122 | 122 | $ui = new SymfonyStyle($input, $output); |
| 123 | - $ui->warning('Command ' . $this->getName() . ' is deprecated and will be removed in Doctrine 3.0.'); |
|
| 123 | + $ui->warning('Command '.$this->getName().' is deprecated and will be removed in Doctrine 3.0.'); |
|
| 124 | 124 | |
| 125 | 125 | // Process source directories |
| 126 | 126 | $fromPaths = array_merge([$input->getArgument('from-path')], $input->getOption('from')); |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | $exporter->setMetadata($metadata); |
| 203 | 203 | $exporter->export(); |
| 204 | 204 | |
| 205 | - $output->writeln(PHP_EOL . sprintf( |
|
| 205 | + $output->writeln(PHP_EOL.sprintf( |
|
| 206 | 206 | 'Converting Doctrine 1.X schema to "<info>%s</info>" mapping type in "<info>%s</info>"', $toType, $destPath |
| 207 | 207 | )); |
| 208 | 208 | } else { |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | protected function execute(InputInterface $input, OutputInterface $output) |
| 90 | 90 | { |
| 91 | 91 | $ui = new SymfonyStyle($input, $output); |
| 92 | - $ui->warning('Command ' . $this->getName() . ' is deprecated and will be removed in Doctrine 3.0.'); |
|
| 92 | + $ui->warning('Command '.$this->getName().' is deprecated and will be removed in Doctrine 3.0.'); |
|
| 93 | 93 | |
| 94 | 94 | $em = $this->getHelper('em')->getEntityManager(); |
| 95 | 95 | |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | $entityGenerator->setRegenerateEntityIfExists($input->getOption('regenerate-entities')); |
| 126 | 126 | $entityGenerator->setUpdateEntityIfExists($input->getOption('update-entities')); |
| 127 | 127 | $entityGenerator->setNumSpaces($input->getOption('num-spaces')); |
| 128 | - $entityGenerator->setBackupExisting(!$input->getOption('no-backup')); |
|
| 128 | + $entityGenerator->setBackupExisting( ! $input->getOption('no-backup')); |
|
| 129 | 129 | |
| 130 | 130 | if (($extend = $input->getOption('extend')) !== null) { |
| 131 | 131 | $entityGenerator->setClassToExtend($extend); |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | |
| 43 | 43 | public function __construct() |
| 44 | 44 | { |
| 45 | - @trigger_error(self::class . ' is deprecated and will be removed in Doctrine 3.0', E_USER_DEPRECATED); |
|
| 45 | + @trigger_error(self::class.' is deprecated and will be removed in Doctrine 3.0', E_USER_DEPRECATED); |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | /** |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | */ |
| 60 | 60 | public function __construct($dir = null) |
| 61 | 61 | { |
| 62 | - @trigger_error(static::class . ' is deprecated and will be removed in Doctrine 3.0', E_USER_DEPRECATED); |
|
| 62 | + @trigger_error(static::class.' is deprecated and will be removed in Doctrine 3.0', E_USER_DEPRECATED); |
|
| 63 | 63 | |
| 64 | 64 | $this->_outputDir = $dir; |
| 65 | 65 | } |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | if ( ! is_dir($dir)) { |
| 146 | 146 | mkdir($dir, 0775, true); |
| 147 | 147 | } |
| 148 | - if (file_exists($path) && !$this->_overwriteExistingFiles) { |
|
| 148 | + if (file_exists($path) && ! $this->_overwriteExistingFiles) { |
|
| 149 | 149 | throw ExportException::attemptOverwriteExistingFile($path); |
| 150 | 150 | } |
| 151 | 151 | file_put_contents($path, $output); |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | */ |
| 164 | 164 | protected function _generateOutputPath(ClassMetadataInfo $metadata) |
| 165 | 165 | { |
| 166 | - return $this->_outputDir . '/' . str_replace('\\', '.', $metadata->name) . $this->_extension; |
|
| 166 | + return $this->_outputDir.'/'.str_replace('\\', '.', $metadata->name).$this->_extension; |
|
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | /** |