Completed
Pull Request — master (#5626)
by Gary
09:09
created
lib/Shitty/ORM/Mapping/ClassMetadataInfo.php 3 patches
Doc Comments   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -667,7 +667,7 @@  discard block
 block discarded – undo
667 667
     /**
668 668
      * Gets the ReflectionProperties of the mapped class.
669 669
      *
670
-     * @return array An array of ReflectionProperty instances.
670
+     * @return \ReflectionProperty[] An array of ReflectionProperty instances.
671 671
      */
672 672
     public function getReflectionProperties()
673 673
     {
@@ -805,7 +805,7 @@  discard block
 block discarded – undo
805 805
      *      - reflClass (ReflectionClass)
806 806
      *      - reflFields (ReflectionProperty array)
807 807
      *
808
-     * @return array The names of all the fields that should be serialized.
808
+     * @return string[] The names of all the fields that should be serialized.
809 809
      */
810 810
     public function __sleep()
811 811
     {
@@ -1838,7 +1838,7 @@  discard block
 block discarded – undo
1838 1838
      * Sets the mapped identifier/primary key fields of this class.
1839 1839
      * Mainly used by the ClassMetadataFactory to assign inherited identifiers.
1840 1840
      *
1841
-     * @param array $identifier
1841
+     * @param string[] $identifier
1842 1842
      *
1843 1843
      * @return void
1844 1844
      */
@@ -1867,7 +1867,7 @@  discard block
 block discarded – undo
1867 1867
     /**
1868 1868
      * Gets an array containing all the column names.
1869 1869
      *
1870
-     * @param array|null $fieldNames
1870
+     * @param string[] $fieldNames
1871 1871
      *
1872 1872
      * @return array
1873 1873
      */
@@ -2085,7 +2085,7 @@  discard block
 block discarded – undo
2085 2085
     /**
2086 2086
      * Sets the mapped subclasses of this class.
2087 2087
      *
2088
-     * @param array $subclasses The names of all mapped subclasses.
2088
+     * @param string[] $subclasses The names of all mapped subclasses.
2089 2089
      *
2090 2090
      * @return void
2091 2091
      */
@@ -2101,7 +2101,7 @@  discard block
 block discarded – undo
2101 2101
      * Assumes that the class names in the passed array are in the order:
2102 2102
      * directParent -> directParentParent -> directParentParentParent ... -> root.
2103 2103
      *
2104
-     * @param array $classNames
2104
+     * @param string[] $classNames
2105 2105
      *
2106 2106
      * @return void
2107 2107
      */
@@ -2638,7 +2638,7 @@  discard block
 block discarded – undo
2638 2638
      * @deprecated Deprecated since version 2.4 in favor of \Doctrine\ORM\Event\ListenersInvoker
2639 2639
      *
2640 2640
      * @param string $lifecycleEvent The lifecycle event.
2641
-     * @param object $entity         The Entity on which the event occurred.
2641
+     * @param \Shitty\Tests\ORM\Functional\Ticket\DDC1707Child $entity         The Entity on which the event occurred.
2642 2642
      *
2643 2643
      * @return void
2644 2644
      */
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1431,7 +1431,7 @@
 block discarded – undo
1431 1431
 
1432 1432
         if (Type::hasType($mapping['type']) && Type::getType($mapping['type'])->canRequireSQLConversion()) {
1433 1433
             if (isset($mapping['id']) && $mapping['id'] === true) {
1434
-                 throw MappingException::sqlConversionNotAllowedForIdentifiers($this->name, $mapping['fieldName'], $mapping['type']);
1434
+                    throw MappingException::sqlConversionNotAllowedForIdentifiers($this->name, $mapping['fieldName'], $mapping['type']);
1435 1435
             }
1436 1436
 
1437 1437
             $mapping['requireSQLConversion'] = true;
Please login to merge, or discard this patch.
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -696,7 +696,7 @@  discard block
 block discarded – undo
696 696
     public function getSingleIdReflectionProperty()
697 697
     {
698 698
         if ($this->isIdentifierComposite) {
699
-            throw new BadMethodCallException("Class " . $this->name . " has a composite identifier.");
699
+            throw new BadMethodCallException("Class ".$this->name." has a composite identifier.");
700 700
         }
701 701
 
702 702
         return $this->reflFields[$this->identifier[0]];
@@ -791,7 +791,7 @@  discard block
 block discarded – undo
791 791
      */
792 792
     public function __toString()
793 793
     {
794
-        return __CLASS__ . '@' . spl_object_hash($this);
794
+        return __CLASS__.'@'.spl_object_hash($this);
795 795
     }
796 796
 
797 797
     /**
@@ -1020,7 +1020,7 @@  discard block
 block discarded – undo
1020 1020
     public function validateAssociations()
1021 1021
     {
1022 1022
         foreach ($this->associationMappings as $mapping) {
1023
-            if ( ! ClassLoader::classExists($mapping['targetEntity']) ) {
1023
+            if ( ! ClassLoader::classExists($mapping['targetEntity'])) {
1024 1024
                 throw MappingException::invalidTargetEntityClass($mapping['targetEntity'], $this->name, $mapping['fieldName']);
1025 1025
             }
1026 1026
         }
@@ -1080,7 +1080,7 @@  discard block
 block discarded – undo
1080 1080
      */
1081 1081
     public function enableAssociationCache($fieldName, array $cache)
1082 1082
     {
1083
-        $this->associationMappings[$fieldName]['cache'] = $this->getAssociationCacheDefaults ($fieldName, $cache);
1083
+        $this->associationMappings[$fieldName]['cache'] = $this->getAssociationCacheDefaults($fieldName, $cache);
1084 1084
     }
1085 1085
 
1086 1086
     /**
@@ -1098,7 +1098,7 @@  discard block
 block discarded – undo
1098 1098
         }
1099 1099
 
1100 1100
         if ( ! isset($cache['region'])) {
1101
-            $cache['region'] = strtolower(str_replace('\\', '_', $this->rootEntityName)) . '__' . $fieldName;
1101
+            $cache['region'] = strtolower(str_replace('\\', '_', $this->rootEntityName)).'__'.$fieldName;
1102 1102
         }
1103 1103
 
1104 1104
         return $cache;
@@ -1461,7 +1461,7 @@  discard block
 block discarded – undo
1461 1461
         $mapping['isOwningSide'] = true; // assume owning side until we hit mappedBy
1462 1462
 
1463 1463
         // unset optional indexBy attribute if its empty
1464
-        if ( ! isset($mapping['indexBy']) || !$mapping['indexBy']) {
1464
+        if ( ! isset($mapping['indexBy']) || ! $mapping['indexBy']) {
1465 1465
             unset($mapping['indexBy']);
1466 1466
         }
1467 1467
 
@@ -1500,7 +1500,7 @@  discard block
 block discarded – undo
1500 1500
                 $this->isIdentifierComposite = true;
1501 1501
             }
1502 1502
 
1503
-            if ($this->cache && !isset($mapping['cache'])) {
1503
+            if ($this->cache && ! isset($mapping['cache'])) {
1504 1504
                 throw CacheException::nonCacheableEntityAssociation($this->name, $mapping['fieldName']);
1505 1505
             }
1506 1506
         }
@@ -1632,7 +1632,7 @@  discard block
 block discarded – undo
1632 1632
                     throw new RuntimeException("ClassMetadataInfo::setTable() has to be called before defining a one to one relationship.");
1633 1633
                 }
1634 1634
 
1635
-                $this->table['uniqueConstraints'][$mapping['fieldName'] . "_uniq"] = array(
1635
+                $this->table['uniqueConstraints'][$mapping['fieldName']."_uniq"] = array(
1636 1636
                     'columns' => $uniqueConstraintColumns
1637 1637
                 );
1638 1638
             }
@@ -1647,7 +1647,7 @@  discard block
 block discarded – undo
1647 1647
             unset($mapping['unique']);
1648 1648
         }
1649 1649
 
1650
-        if (isset($mapping['id']) && $mapping['id'] === true && !$mapping['isOwningSide']) {
1650
+        if (isset($mapping['id']) && $mapping['id'] === true && ! $mapping['isOwningSide']) {
1651 1651
             throw MappingException::illegalInverseIdentifierAssociation($this->name, $mapping['fieldName']);
1652 1652
         }
1653 1653
 
@@ -1705,7 +1705,7 @@  discard block
 block discarded – undo
1705 1705
             }
1706 1706
 
1707 1707
             $selfReferencingEntityWithoutJoinColumns = $mapping['sourceEntity'] == $mapping['targetEntity']
1708
-                && (! (isset($mapping['joinTable']['joinColumns']) || isset($mapping['joinTable']['inverseJoinColumns'])));
1708
+                && ( ! (isset($mapping['joinTable']['joinColumns']) || isset($mapping['joinTable']['inverseJoinColumns'])));
1709 1709
 
1710 1710
             if ( ! isset($mapping['joinTable']['joinColumns'])) {
1711 1711
                 $mapping['joinTable']['joinColumns'] = array(
@@ -1898,7 +1898,7 @@  discard block
 block discarded – undo
1898 1898
 
1899 1899
             // Association defined as Id field
1900 1900
             $joinColumns      = $this->associationMappings[$idProperty]['joinColumns'];
1901
-            $assocColumnNames = array_map(function ($joinColumn) { return $joinColumn['name']; }, $joinColumns);
1901
+            $assocColumnNames = array_map(function($joinColumn) { return $joinColumn['name']; }, $joinColumns);
1902 1902
 
1903 1903
             $columnNames = array_merge($columnNames, $assocColumnNames);
1904 1904
         }
@@ -2079,7 +2079,7 @@  discard block
 block discarded – undo
2079 2079
     public function getTemporaryIdTableName()
2080 2080
     {
2081 2081
         // replace dots with underscores because PostgreSQL creates temporary tables in a special schema
2082
-        return str_replace('.', '_', $this->getTableName() . '_id_tmp');
2082
+        return str_replace('.', '_', $this->getTableName().'_id_tmp');
2083 2083
     }
2084 2084
 
2085 2085
     /**
@@ -2408,7 +2408,7 @@  discard block
 block discarded – undo
2408 2408
      */
2409 2409
     public function addNamedQuery(array $queryMapping)
2410 2410
     {
2411
-        if (!isset($queryMapping['name'])) {
2411
+        if ( ! isset($queryMapping['name'])) {
2412 2412
             throw MappingException::nameIsMandatoryForQueryMapping($this->name);
2413 2413
         }
2414 2414
 
@@ -2416,7 +2416,7 @@  discard block
 block discarded – undo
2416 2416
             throw MappingException::duplicateQueryMapping($this->name, $queryMapping['name']);
2417 2417
         }
2418 2418
 
2419
-        if (!isset($queryMapping['query'])) {
2419
+        if ( ! isset($queryMapping['query'])) {
2420 2420
             throw MappingException::emptyQueryMapping($this->name, $queryMapping['name']);
2421 2421
         }
2422 2422
 
@@ -2443,7 +2443,7 @@  discard block
 block discarded – undo
2443 2443
      */
2444 2444
     public function addNamedNativeQuery(array $queryMapping)
2445 2445
     {
2446
-        if (!isset($queryMapping['name'])) {
2446
+        if ( ! isset($queryMapping['name'])) {
2447 2447
             throw MappingException::nameIsMandatoryForQueryMapping($this->name);
2448 2448
         }
2449 2449
 
@@ -2451,11 +2451,11 @@  discard block
 block discarded – undo
2451 2451
             throw MappingException::duplicateQueryMapping($this->name, $queryMapping['name']);
2452 2452
         }
2453 2453
 
2454
-        if (!isset($queryMapping['query'])) {
2454
+        if ( ! isset($queryMapping['query'])) {
2455 2455
             throw MappingException::emptyQueryMapping($this->name, $queryMapping['name']);
2456 2456
         }
2457 2457
 
2458
-        if (!isset($queryMapping['resultClass']) && !isset($queryMapping['resultSetMapping'])) {
2458
+        if ( ! isset($queryMapping['resultClass']) && ! isset($queryMapping['resultSetMapping'])) {
2459 2459
             throw MappingException::missingQueryMapping($this->name, $queryMapping['name']);
2460 2460
         }
2461 2461
 
@@ -2487,7 +2487,7 @@  discard block
 block discarded – undo
2487 2487
      */
2488 2488
     public function addSqlResultSetMapping(array $resultMapping)
2489 2489
     {
2490
-        if (!isset($resultMapping['name'])) {
2490
+        if ( ! isset($resultMapping['name'])) {
2491 2491
             throw MappingException::nameIsMandatoryForSqlResultSetMapping($this->name);
2492 2492
         }
2493 2493
 
@@ -2497,7 +2497,7 @@  discard block
 block discarded – undo
2497 2497
 
2498 2498
         if (isset($resultMapping['entities'])) {
2499 2499
             foreach ($resultMapping['entities'] as $key => $entityResult) {
2500
-                if (!isset($entityResult['entityClass'])) {
2500
+                if ( ! isset($entityResult['entityClass'])) {
2501 2501
                     throw MappingException::missingResultSetMappingEntity($this->name, $resultMapping['name']);
2502 2502
                 }
2503 2503
 
@@ -2516,11 +2516,11 @@  discard block
 block discarded – undo
2516 2516
 
2517 2517
                 if (isset($entityResult['fields'])) {
2518 2518
                     foreach ($entityResult['fields'] as $k => $field) {
2519
-                        if (!isset($field['name'])) {
2519
+                        if ( ! isset($field['name'])) {
2520 2520
                             throw MappingException::missingResultSetMappingFieldName($this->name, $resultMapping['name']);
2521 2521
                         }
2522 2522
 
2523
-                        if (!isset($field['column'])) {
2523
+                        if ( ! isset($field['column'])) {
2524 2524
                             $fieldName = $field['name'];
2525 2525
                             if (strpos($fieldName, '.')) {
2526 2526
                                 list(, $fieldName) = explode('.', $fieldName);
@@ -3011,7 +3011,7 @@  discard block
 block discarded – undo
3011 3011
         }
3012 3012
 
3013 3013
         if ($definition['sequenceName'][0] == '`') {
3014
-            $definition['sequenceName']   = trim($definition['sequenceName'], '`');
3014
+            $definition['sequenceName'] = trim($definition['sequenceName'], '`');
3015 3015
             $definition['quoted'] = true;
3016 3016
         }
3017 3017
 
@@ -3103,7 +3103,7 @@  discard block
 block discarded – undo
3103 3103
     public function getAssociationTargetClass($assocName)
3104 3104
     {
3105 3105
         if ( ! isset($this->associationMappings[$assocName])) {
3106
-            throw new InvalidArgumentException("Association name expected, '" . $assocName ."' is not an association.");
3106
+            throw new InvalidArgumentException("Association name expected, '".$assocName."' is not an association.");
3107 3107
         }
3108 3108
 
3109 3109
         return $this->associationMappings[$assocName]['targetEntity'];
@@ -3142,7 +3142,7 @@  discard block
 block discarded – undo
3142 3142
             // Association defined as Id field
3143 3143
             $joinColumns            = $this->associationMappings[$idProperty]['joinColumns'];
3144 3144
             $assocQuotedColumnNames = array_map(
3145
-                function ($joinColumn) use ($platform) {
3145
+                function($joinColumn) use ($platform) {
3146 3146
                     return isset($joinColumn['quoted'])
3147 3147
                         ? $platform->quoteIdentifier($joinColumn['name'])
3148 3148
                         : $joinColumn['name'];
@@ -3253,7 +3253,7 @@  discard block
 block discarded – undo
3253 3253
         }
3254 3254
 
3255 3255
         if ($className !== null && strpos($className, '\\') === false && strlen($this->namespace) > 0) {
3256
-            return $this->namespace . '\\' . $className;
3256
+            return $this->namespace.'\\'.$className;
3257 3257
         }
3258 3258
 
3259 3259
         return $className;
@@ -3307,15 +3307,15 @@  discard block
 block discarded – undo
3307 3307
                 ? $fieldMapping['originalClass']
3308 3308
                 : $embeddable->name;
3309 3309
             $fieldMapping['declaredField'] = isset($fieldMapping['declaredField'])
3310
-                ? $property . '.' . $fieldMapping['declaredField']
3310
+                ? $property.'.'.$fieldMapping['declaredField']
3311 3311
                 : $property;
3312 3312
             $fieldMapping['originalField'] = isset($fieldMapping['originalField'])
3313 3313
                 ? $fieldMapping['originalField']
3314 3314
                 : $fieldMapping['fieldName'];
3315
-            $fieldMapping['fieldName'] = $property . "." . $fieldMapping['fieldName'];
3315
+            $fieldMapping['fieldName'] = $property.".".$fieldMapping['fieldName'];
3316 3316
 
3317
-            if (! empty($this->embeddedClasses[$property]['columnPrefix'])) {
3318
-                $fieldMapping['columnName'] = $this->embeddedClasses[$property]['columnPrefix'] . $fieldMapping['columnName'];
3317
+            if ( ! empty($this->embeddedClasses[$property]['columnPrefix'])) {
3318
+                $fieldMapping['columnName'] = $this->embeddedClasses[$property]['columnPrefix'].$fieldMapping['columnName'];
3319 3319
             } elseif ($this->embeddedClasses[$property]['columnPrefix'] !== false) {
3320 3320
                 $fieldMapping['columnName'] = $this->namingStrategy
3321 3321
                     ->embeddedFieldToColumnName(
@@ -3356,7 +3356,7 @@  discard block
 block discarded – undo
3356 3356
     {
3357 3357
         $sequencePrefix = $this->getSequencePrefix($platform);
3358 3358
         $columnName     = $this->getSingleIdentifierColumnName();
3359
-        $sequenceName   = $sequencePrefix . '_' . $columnName . '_seq';
3359
+        $sequenceName   = $sequencePrefix.'_'.$columnName.'_seq';
3360 3360
 
3361 3361
         return $sequenceName;
3362 3362
     }
@@ -3376,10 +3376,10 @@  discard block
 block discarded – undo
3376 3376
 
3377 3377
         // Prepend the schema name to the table name if there is one
3378 3378
         if ($schemaName = $this->getSchemaName()) {
3379
-            $sequencePrefix = $schemaName . '.' . $tableName;
3379
+            $sequencePrefix = $schemaName.'.'.$tableName;
3380 3380
 
3381 3381
             if ( ! $platform->supportsSchemas() && $platform->canEmulateSchemas()) {
3382
-                $sequencePrefix = $schemaName . '__' . $tableName;
3382
+                $sequencePrefix = $schemaName.'__'.$tableName;
3383 3383
             }
3384 3384
         }
3385 3385
 
Please login to merge, or discard this patch.
lib/Shitty/ORM/Mapping/Driver/AnnotationDriver.php 2 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -49,6 +49,7 @@
 block discarded – undo
49 49
 
50 50
     /**
51 51
      * {@inheritDoc}
52
+     * @param string $className
52 53
      */
53 54
     public function loadMetadataForClass($className, ClassMetadata $metadata)
54 55
     {
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
             $cacheAnnot = $classAnnotations['Doctrine\ORM\Mapping\Cache'];
151 151
             $cacheMap   = array(
152 152
                 'region' => $cacheAnnot->region,
153
-                'usage'  => constant('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_' . $cacheAnnot->usage),
153
+                'usage'  => constant('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_'.$cacheAnnot->usage),
154 154
             );
155 155
 
156 156
             $metadata->enableCache($cacheMap);
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
             $inheritanceTypeAnnot = $classAnnotations['Doctrine\ORM\Mapping\InheritanceType'];
233 233
 
234 234
             $metadata->setInheritanceType(
235
-                constant('Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_' . $inheritanceTypeAnnot->value)
235
+                constant('Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_'.$inheritanceTypeAnnot->value)
236 236
             );
237 237
 
238 238
             if ($metadata->inheritanceType != \Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_NONE) {
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
         // Evaluate DoctrineChangeTrackingPolicy annotation
263 263
         if (isset($classAnnotations['Doctrine\ORM\Mapping\ChangeTrackingPolicy'])) {
264 264
             $changeTrackingAnnot = $classAnnotations['Doctrine\ORM\Mapping\ChangeTrackingPolicy'];
265
-            $metadata->setChangeTrackingPolicy(constant('Doctrine\ORM\Mapping\ClassMetadata::CHANGETRACKING_' . $changeTrackingAnnot->value));
265
+            $metadata->setChangeTrackingPolicy(constant('Doctrine\ORM\Mapping\ClassMetadata::CHANGETRACKING_'.$changeTrackingAnnot->value));
266 266
         }
267 267
 
268 268
         // Evaluate annotations on properties/fields
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
             // Evaluate @Cache annotation
285 285
             if (($cacheAnnot = $this->reader->getPropertyAnnotation($property, 'Doctrine\ORM\Mapping\Cache')) !== null) {
286 286
                 $mapping['cache'] = $metadata->getAssociationCacheDefaults($mapping['fieldName'], array(
287
-                        'usage'         => constant('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_' . $cacheAnnot->usage),
287
+                        'usage'         => constant('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_'.$cacheAnnot->usage),
288 288
                         'region'        => $cacheAnnot->region,
289 289
                 ));
290 290
             }
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
                 }
314 314
 
315 315
                 if ($generatedValueAnnot = $this->reader->getPropertyAnnotation($property, 'Doctrine\ORM\Mapping\GeneratedValue')) {
316
-                    $metadata->setIdGeneratorType(constant('Doctrine\ORM\Mapping\ClassMetadata::GENERATOR_TYPE_' . $generatedValueAnnot->strategy));
316
+                    $metadata->setIdGeneratorType(constant('Doctrine\ORM\Mapping\ClassMetadata::GENERATOR_TYPE_'.$generatedValueAnnot->strategy));
317 317
                 }
318 318
 
319 319
                 if ($this->reader->getPropertyAnnotation($property, 'Doctrine\ORM\Mapping\Version')) {
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
                 }
498 498
 
499 499
                 // Evaluate the listener using naming convention.
500
-                if ( ! $hasMapping ) {
500
+                if ( ! $hasMapping) {
501 501
                     EntityListenerBuilder::bindEntityListener($metadata, $listenerClassName);
502 502
                 }
503 503
             }
@@ -526,11 +526,11 @@  discard block
 block discarded – undo
526 526
      */
527 527
     private function getFetchMode($className, $fetchMode)
528 528
     {
529
-        if ( ! defined('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . $fetchMode)) {
529
+        if ( ! defined('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.$fetchMode)) {
530 530
             throw MappingException::invalidFetchMode($className, $fetchMode);
531 531
         }
532 532
 
533
-        return constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . $fetchMode);
533
+        return constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.$fetchMode);
534 534
     }
535 535
 
536 536
     /**
Please login to merge, or discard this patch.
lib/Shitty/ORM/Mapping/Driver/XmlDriver.php 3 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -50,6 +50,7 @@
 block discarded – undo
50 50
 
51 51
     /**
52 52
      * {@inheritDoc}
53
+     * @param string $className
53 54
      */
54 55
     public function loadMetadataForClass($className, ClassMetadata $metadata)
55 56
     {
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -707,13 +707,13 @@
 block discarded – undo
707 707
         return $joinColumn;
708 708
     }
709 709
 
710
-     /**
711
-     * Parses the given field as array.
712
-     *
713
-     * @param SimpleXMLElement $fieldMapping
714
-     *
715
-     * @return array
716
-     */
710
+        /**
711
+         * Parses the given field as array.
712
+         *
713
+         * @param SimpleXMLElement $fieldMapping
714
+         *
715
+         * @return array
716
+         */
717 717
     private function columnToArray(SimpleXMLElement $fieldMapping)
718 718
     {
719 719
         $mapping = array(
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 
158 158
         if (isset($xmlRoot['inheritance-type'])) {
159 159
             $inheritanceType = (string) $xmlRoot['inheritance-type'];
160
-            $metadata->setInheritanceType(constant('Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_' . $inheritanceType));
160
+            $metadata->setInheritanceType(constant('Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_'.$inheritanceType));
161 161
 
162 162
             if ($metadata->inheritanceType != \Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_NONE) {
163 163
                 // Evaluate <discriminator-column...>
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
                 }
355 355
 
356 356
                 if (isset($oneToOneElement['fetch'])) {
357
-                    $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . (string) $oneToOneElement['fetch']);
357
+                    $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.(string) $oneToOneElement['fetch']);
358 358
                 }
359 359
 
360 360
                 if (isset($oneToOneElement['mapped-by'])) {
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
                 );
404 404
 
405 405
                 if (isset($oneToManyElement['fetch'])) {
406
-                    $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . (string) $oneToManyElement['fetch']);
406
+                    $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.(string) $oneToManyElement['fetch']);
407 407
                 }
408 408
 
409 409
                 if (isset($oneToManyElement->cascade)) {
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
                 }
451 451
 
452 452
                 if (isset($manyToOneElement['fetch'])) {
453
-                    $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . (string) $manyToOneElement['fetch']);
453
+                    $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.(string) $manyToOneElement['fetch']);
454 454
                 }
455 455
 
456 456
                 if (isset($manyToOneElement['inversed-by'])) {
@@ -492,7 +492,7 @@  discard block
 block discarded – undo
492 492
                 );
493 493
 
494 494
                 if (isset($manyToManyElement['fetch'])) {
495
-                    $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . (string) $manyToManyElement['fetch']);
495
+                    $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.(string) $manyToManyElement['fetch']);
496 496
                 }
497 497
 
498 498
                 if (isset($manyToManyElement['orphan-removal'])) {
@@ -617,7 +617,7 @@  discard block
 block discarded – undo
617 617
         // Evaluate <lifecycle-callbacks...>
618 618
         if (isset($xmlRoot->{'lifecycle-callbacks'})) {
619 619
             foreach ($xmlRoot->{'lifecycle-callbacks'}->{'lifecycle-callback'} as $lifecycleCallback) {
620
-                $metadata->addLifecycleCallback((string) $lifecycleCallback['method'], constant('Doctrine\ORM\Events::' . (string) $lifecycleCallback['type']));
620
+                $metadata->addLifecycleCallback((string) $lifecycleCallback['method'], constant('Doctrine\ORM\Events::'.(string) $lifecycleCallback['type']));
621 621
             }
622 622
         }
623 623
 
@@ -775,12 +775,12 @@  discard block
 block discarded – undo
775 775
         $region = isset($cacheMapping['region']) ? (string) $cacheMapping['region'] : null;
776 776
         $usage  = isset($cacheMapping['usage']) ? strtoupper($cacheMapping['usage']) : null;
777 777
 
778
-        if ($usage && ! defined('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_' . $usage)) {
778
+        if ($usage && ! defined('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_'.$usage)) {
779 779
             throw new \InvalidArgumentException(sprintf('Invalid cache usage "%s"', $usage));
780 780
         }
781 781
 
782 782
         if ($usage) {
783
-            $usage = constant('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_' . $usage);
783
+            $usage = constant('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_'.$usage);
784 784
         }
785 785
 
786 786
         return array(
Please login to merge, or discard this patch.
lib/Shitty/ORM/Mapping/NamingStrategy.php 1 patch
Doc Comments   -2 removed lines patch added patch discarded remove patch
@@ -70,8 +70,6 @@
 block discarded – undo
70 70
      * Returns a join column name for a property.
71 71
      *
72 72
      * @param string $propertyName A property name.
73
-     * @param string|null $className    The fully-qualified class name.
74
-     *                                  This parameter is omitted from the signature due to BC
75 73
      *
76 74
      * @return string A join column name.
77 75
      */
Please login to merge, or discard this patch.
lib/Shitty/ORM/NativeQuery.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
     /**
50 50
      * Gets the SQL query.
51 51
      *
52
-     * @return mixed The built SQL query or an array of all SQL queries.
52
+     * @return string The built SQL query or an array of all SQL queries.
53 53
      *
54 54
      * @override
55 55
      */
Please login to merge, or discard this patch.
lib/Shitty/ORM/PersistentCollection.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -579,7 +579,7 @@
 block discarded – undo
579 579
      * Internal note: Tried to implement Serializable first but that did not work well
580 580
      *                with circular references. This solution seems simpler and works well.
581 581
      *
582
-     * @return array
582
+     * @return string[]
583 583
      */
584 584
     public function __sleep()
585 585
     {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
      */
404 404
     public function containsKey($key)
405 405
     {
406
-        if (! $this->initialized && $this->association['fetch'] === ClassMetadata::FETCH_EXTRA_LAZY
406
+        if ( ! $this->initialized && $this->association['fetch'] === ClassMetadata::FETCH_EXTRA_LAZY
407 407
             && isset($this->association['indexBy'])) {
408 408
             $persister = $this->em->getUnitOfWork()->getCollectionPersister($this->association);
409 409
 
@@ -436,7 +436,7 @@  discard block
 block discarded – undo
436 436
             && $this->association['fetch'] === ClassMetadata::FETCH_EXTRA_LAZY
437 437
             && isset($this->association['indexBy'])
438 438
         ) {
439
-            if (!$this->typeClass->isIdentifierComposite && $this->typeClass->isIdentifier($this->association['indexBy'])) {
439
+            if ( ! $this->typeClass->isIdentifierComposite && $this->typeClass->isIdentifier($this->association['indexBy'])) {
440 440
                 return $this->em->find($this->typeClass->name, $key);
441 441
             }
442 442
 
Please login to merge, or discard this patch.
lib/Shitty/ORM/Persisters/Entity/CachedPersisterContext.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@
 block discarded – undo
86 86
     public $handlesLimits;
87 87
 
88 88
     /**
89
-     * @param ClassMetadata    $class
89
+     * @param \Shitty\ORM\Mapping\ClassMetadata    $class
90 90
      * @param ResultSetMapping $rsm
91 91
      * @param bool             $handlesLimits
92 92
      */
Please login to merge, or discard this patch.
lib/Shitty/ORM/Persisters/Entity/JoinedSubclassPersister.php 2 patches
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -20,11 +20,8 @@
 block discarded – undo
20 20
 namespace Shitty\ORM\Persisters\Entity;
21 21
 
22 22
 use Shitty\ORM\Mapping\ClassMetadata;
23
-use Shitty\ORM\Query\ResultSetMapping;
24
-
25 23
 use Shitty\DBAL\LockMode;
26 24
 use Shitty\DBAL\Types\Type;
27
-
28 25
 use Shitty\Common\Collections\Criteria;
29 26
 use Shitty\ORM\Utility\PersisterHelper;
30 27
 
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
                 }
209 209
 
210 210
                 foreach ($data as $columnName => $value) {
211
-                    if (!is_array($id) || !isset($id[$columnName])) {
211
+                    if ( ! is_array($id) || ! isset($id[$columnName])) {
212 212
                         $stmt->bindValue($paramIndex++, $value, $this->columnTypes[$columnName]);
213 213
                     }
214 214
                 }
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
         // If the current class in the root entity, add the filters
324 324
         if ($filterSql = $this->generateFilterConditionSQL($this->em->getClassMetadata($this->class->rootEntityName), $this->getSQLTableAlias($this->class->rootEntityName))) {
325 325
             $conditionSql .= $conditionSql
326
-                ? ' AND ' . $filterSql
326
+                ? ' AND '.$filterSql
327 327
                 : $filterSql;
328 328
         }
329 329
 
@@ -342,29 +342,29 @@  discard block
 block discarded – undo
342 342
         switch ($lockMode) {
343 343
             case LockMode::PESSIMISTIC_READ:
344 344
 
345
-                $lockSql = ' ' . $this->platform->getReadLockSql();
345
+                $lockSql = ' '.$this->platform->getReadLockSql();
346 346
 
347 347
                 break;
348 348
 
349 349
             case LockMode::PESSIMISTIC_WRITE:
350 350
 
351
-                $lockSql = ' ' . $this->platform->getWriteLockSql();
351
+                $lockSql = ' '.$this->platform->getWriteLockSql();
352 352
 
353 353
                 break;
354 354
         }
355 355
 
356 356
         $tableName  = $this->quoteStrategy->getTableName($this->class, $this->platform);
357
-        $from       = ' FROM ' . $tableName . ' ' . $baseTableAlias;
358
-        $where      = $conditionSql != '' ? ' WHERE ' . $conditionSql : '';
357
+        $from       = ' FROM '.$tableName.' '.$baseTableAlias;
358
+        $where      = $conditionSql != '' ? ' WHERE '.$conditionSql : '';
359 359
         $lock       = $this->platform->appendLockHint($from, $lockMode);
360 360
         $columnList = $this->getSelectColumnsSQL();
361
-        $query      = 'SELECT '  . $columnList
361
+        $query      = 'SELECT '.$columnList
362 362
                     . $lock
363 363
                     . $joinSql
364 364
                     . $where
365 365
                     . $orderBySql;
366 366
 
367
-        return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql;
367
+        return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql;
368 368
     }
369 369
 
370 370
     /**
@@ -384,14 +384,14 @@  discard block
 block discarded – undo
384 384
 
385 385
         if ('' !== $filterSql) {
386 386
             $conditionSql = $conditionSql
387
-                ? $conditionSql . ' AND ' . $filterSql
387
+                ? $conditionSql.' AND '.$filterSql
388 388
                 : $filterSql;
389 389
         }
390 390
 
391 391
         $sql = 'SELECT COUNT(*) '
392
-            . 'FROM ' . $tableName . ' ' . $baseTableAlias
392
+            . 'FROM '.$tableName.' '.$baseTableAlias
393 393
             . $joinSql
394
-            . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql);
394
+            . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql);
395 395
 
396 396
         return $sql;
397 397
     }
@@ -410,16 +410,16 @@  discard block
 block discarded – undo
410 410
             $conditions     = array();
411 411
             $tableAlias     = $this->getSQLTableAlias($parentClassName);
412 412
             $parentClass    = $this->em->getClassMetadata($parentClassName);
413
-            $joinSql       .= ' INNER JOIN ' . $this->quoteStrategy->getTableName($parentClass, $this->platform) . ' ' . $tableAlias . ' ON ';
413
+            $joinSql       .= ' INNER JOIN '.$this->quoteStrategy->getTableName($parentClass, $this->platform).' '.$tableAlias.' ON ';
414 414
 
415 415
             foreach ($identifierColumns as $idColumn) {
416
-                $conditions[] = $baseTableAlias . '.' . $idColumn . ' = ' . $tableAlias . '.' . $idColumn;
416
+                $conditions[] = $baseTableAlias.'.'.$idColumn.' = '.$tableAlias.'.'.$idColumn;
417 417
             }
418 418
 
419 419
             $joinSql .= implode(' AND ', $conditions);
420 420
         }
421 421
 
422
-        return parent::getLockTablesSql($lockMode) . $joinSql;
422
+        return parent::getLockTablesSql($lockMode).$joinSql;
423 423
     }
424 424
 
425 425
     /**
@@ -488,7 +488,7 @@  discard block
 block discarded – undo
488 488
             ? $baseTableAlias
489 489
             : $this->getSQLTableAlias($this->class->rootEntityName);
490 490
 
491
-        $columnList[] = $tableAlias . '.' . $discrColumn;
491
+        $columnList[] = $tableAlias.'.'.$discrColumn;
492 492
 
493 493
         // sub tables
494 494
         foreach ($this->class->subClasses as $subClassName) {
@@ -603,11 +603,11 @@  discard block
 block discarded – undo
603 603
             $conditions   = array();
604 604
             $parentClass  = $this->em->getClassMetadata($parentClassName);
605 605
             $tableAlias   = $this->getSQLTableAlias($parentClassName);
606
-            $joinSql     .= ' INNER JOIN ' . $this->quoteStrategy->getTableName($parentClass, $this->platform) . ' ' . $tableAlias . ' ON ';
606
+            $joinSql     .= ' INNER JOIN '.$this->quoteStrategy->getTableName($parentClass, $this->platform).' '.$tableAlias.' ON ';
607 607
 
608 608
 
609 609
             foreach ($identifierColumn as $idColumn) {
610
-                $conditions[] = $baseTableAlias . '.' . $idColumn . ' = ' . $tableAlias . '.' . $idColumn;
610
+                $conditions[] = $baseTableAlias.'.'.$idColumn.' = '.$tableAlias.'.'.$idColumn;
611 611
             }
612 612
 
613 613
             $joinSql .= implode(' AND ', $conditions);
@@ -618,10 +618,10 @@  discard block
 block discarded – undo
618 618
             $conditions  = array();
619 619
             $subClass    = $this->em->getClassMetadata($subClassName);
620 620
             $tableAlias  = $this->getSQLTableAlias($subClassName);
621
-            $joinSql    .= ' LEFT JOIN ' . $this->quoteStrategy->getTableName($subClass, $this->platform) . ' ' . $tableAlias . ' ON ';
621
+            $joinSql    .= ' LEFT JOIN '.$this->quoteStrategy->getTableName($subClass, $this->platform).' '.$tableAlias.' ON ';
622 622
 
623 623
             foreach ($identifierColumn as $idColumn) {
624
-                $conditions[] = $baseTableAlias . '.' . $idColumn . ' = ' . $tableAlias . '.' . $idColumn;
624
+                $conditions[] = $baseTableAlias.'.'.$idColumn.' = '.$tableAlias.'.'.$idColumn;
625 625
             }
626 626
 
627 627
             $joinSql .= implode(' AND ', $conditions);
Please login to merge, or discard this patch.
lib/Shitty/ORM/Query.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -620,7 +620,7 @@
 block discarded – undo
620 620
      * Executes the query and returns an IterableResult that can be used to incrementally
621 621
      * iterated over the result.
622 622
      *
623
-     * @param ArrayCollection|array|null $parameters    The query parameters.
623
+     * @param null|ArrayCollection $parameters    The query parameters.
624 624
      * @param integer                    $hydrationMode The hydration mode to use.
625 625
      *
626 626
      * @return \Doctrine\ORM\Internal\Hydration\IterableResult
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -715,9 +715,9 @@
 block discarded – undo
715 715
         );
716 716
     }
717 717
 
718
-     /**
719
-     * {@inheritdoc}
720
-     */
718
+        /**
719
+         * {@inheritdoc}
720
+         */
721 721
     protected function getHash()
722 722
     {
723 723
         return sha1(parent::getHash(). '-'. $this->_firstResult . '-' . $this->_maxResults);
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
     /**
41 41
      * A query object is in CLEAN state when it has NO unparsed/unprocessed DQL parts.
42 42
      */
43
-    const STATE_CLEAN  = 1;
43
+    const STATE_CLEAN = 1;
44 44
 
45 45
     /**
46 46
      * A query object is in state DIRTY when it has DQL parts that have not yet been
@@ -707,11 +707,11 @@  discard block
 block discarded – undo
707 707
             ->getName();
708 708
 
709 709
         return md5(
710
-            $this->getDql() . serialize($this->_hints) .
711
-            '&platform=' . $platform .
712
-            ($this->_em->hasFilters() ? $this->_em->getFilters()->getHash() : '') .
713
-            '&firstResult=' . $this->_firstResult . '&maxResult=' . $this->_maxResults .
714
-            '&hydrationMode=' . $this->_hydrationMode . '&types=' . serialize($this->_parsedTypes) . 'DOCTRINE_QUERY_CACHE_SALT'
710
+            $this->getDql().serialize($this->_hints).
711
+            '&platform='.$platform.
712
+            ($this->_em->hasFilters() ? $this->_em->getFilters()->getHash() : '').
713
+            '&firstResult='.$this->_firstResult.'&maxResult='.$this->_maxResults.
714
+            '&hydrationMode='.$this->_hydrationMode.'&types='.serialize($this->_parsedTypes).'DOCTRINE_QUERY_CACHE_SALT'
715 715
         );
716 716
     }
717 717
 
@@ -720,7 +720,7 @@  discard block
 block discarded – undo
720 720
      */
721 721
     protected function getHash()
722 722
     {
723
-        return sha1(parent::getHash(). '-'. $this->_firstResult . '-' . $this->_maxResults);
723
+        return sha1(parent::getHash().'-'.$this->_firstResult.'-'.$this->_maxResults);
724 724
     }
725 725
 
726 726
     /**
Please login to merge, or discard this patch.