Passed
Pull Request — 2.7 (#7875)
by Luís
07:27
created
lib/Doctrine/ORM/Tools/Export/ClassMetadataExporter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
 
47 47
     public function __construct()
48 48
     {
49
-        @trigger_error(self::class . ' is deprecated and will be removed in Doctrine ORM 3.0', E_USER_DEPRECATED);
49
+        @trigger_error(self::class.' is deprecated and will be removed in Doctrine ORM 3.0', E_USER_DEPRECATED);
50 50
     }
51 51
 
52 52
     /**
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Export/Driver/AbstractExporter.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
      */
61 61
     public function __construct($dir = null)
62 62
     {
63
-        @trigger_error(static::class . ' is deprecated and will be removed in Doctrine ORM 3.0', E_USER_DEPRECATED);
63
+        @trigger_error(static::class.' is deprecated and will be removed in Doctrine ORM 3.0', E_USER_DEPRECATED);
64 64
 
65 65
         $this->_outputDir = $dir;
66 66
     }
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
                 if ( ! is_dir($dir)) {
147 147
                     mkdir($dir, 0775, true);
148 148
                 }
149
-                if (file_exists($path) && !$this->_overwriteExistingFiles) {
149
+                if (file_exists($path) && ! $this->_overwriteExistingFiles) {
150 150
                     throw ExportException::attemptOverwriteExistingFile($path);
151 151
                 }
152 152
                 file_put_contents($path, $output);
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
      */
165 165
     protected function _generateOutputPath(ClassMetadataInfo $metadata)
166 166
     {
167
-        return $this->_outputDir . '/' . str_replace('\\', '.', $metadata->name) . $this->_extension;
167
+        return $this->_outputDir.'/'.str_replace('\\', '.', $metadata->name).$this->_extension;
168 168
     }
169 169
 
170 170
     /**
Please login to merge, or discard this patch.
lib/Doctrine/ORM/EntityManager.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -227,8 +227,8 @@  discard block
 block discarded – undo
227 227
      */
228 228
     public function transactional($func)
229 229
     {
230
-        if (!is_callable($func)) {
231
-            throw new \InvalidArgumentException('Expected argument of type "callable", got "' . gettype($func) . '"');
230
+        if ( ! is_callable($func)) {
231
+            throw new \InvalidArgumentException('Expected argument of type "callable", got "'.gettype($func).'"');
232 232
         }
233 233
 
234 234
         $this->conn->beginTransaction();
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
     {
359 359
         if ($entity !== null) {
360 360
             @trigger_error(
361
-                'Calling ' . __METHOD__ . '() with any arguments to flush specific entities is deprecated and will not be supported in Doctrine ORM 3.0.',
361
+                'Calling '.__METHOD__.'() with any arguments to flush specific entities is deprecated and will not be supported in Doctrine ORM 3.0.',
362 362
                 E_USER_DEPRECATED
363 363
             );
364 364
         }
@@ -558,7 +558,7 @@  discard block
 block discarded – undo
558 558
 
559 559
         if ($entityName !== null) {
560 560
             @trigger_error(
561
-                'Calling ' . __METHOD__ . '() with any arguments to clear specific entities is deprecated and will not be supported in Doctrine ORM 3.0.',
561
+                'Calling '.__METHOD__.'() with any arguments to clear specific entities is deprecated and will not be supported in Doctrine ORM 3.0.',
562 562
                 E_USER_DEPRECATED
563 563
             );
564 564
         }
@@ -670,7 +670,7 @@  discard block
 block discarded – undo
670 670
      */
671 671
     public function detach($entity)
672 672
     {
673
-        @trigger_error('Method ' . __METHOD__ . '() is deprecated and will be removed in Doctrine ORM 3.0.', E_USER_DEPRECATED);
673
+        @trigger_error('Method '.__METHOD__.'() is deprecated and will be removed in Doctrine ORM 3.0.', E_USER_DEPRECATED);
674 674
 
675 675
         if ( ! is_object($entity)) {
676 676
             throw ORMInvalidArgumentException::invalidObject('EntityManager#detach()', $entity);
@@ -695,7 +695,7 @@  discard block
 block discarded – undo
695 695
      */
696 696
     public function merge($entity)
697 697
     {
698
-        @trigger_error('Method ' . __METHOD__ . '() is deprecated and will be removed in Doctrine ORM 3.0.', E_USER_DEPRECATED);
698
+        @trigger_error('Method '.__METHOD__.'() is deprecated and will be removed in Doctrine ORM 3.0.', E_USER_DEPRECATED);
699 699
 
700 700
         if ( ! is_object($entity)) {
701 701
             throw ORMInvalidArgumentException::invalidObject('EntityManager#merge()', $entity);
@@ -711,7 +711,7 @@  discard block
 block discarded – undo
711 711
      */
712 712
     public function copy($entity, $deep = false)
713 713
     {
714
-        @trigger_error('Method ' . __METHOD__ . '() is deprecated and will be removed in Doctrine ORM 3.0.', E_USER_DEPRECATED);
714
+        @trigger_error('Method '.__METHOD__.'() is deprecated and will be removed in Doctrine ORM 3.0.', E_USER_DEPRECATED);
715 715
 
716 716
         throw new \BadMethodCallException("Not implemented.");
717 717
     }
@@ -785,7 +785,7 @@  discard block
 block discarded – undo
785 785
      */
786 786
     public function isOpen()
787 787
     {
788
-        return (!$this->closed);
788
+        return ( ! $this->closed);
789 789
     }
790 790
 
791 791
     /**
@@ -896,7 +896,7 @@  discard block
 block discarded – undo
896 896
                 sprintf(
897 897
                     'Invalid $connection argument of type %s given%s.',
898 898
                     is_object($connection) ? get_class($connection) : gettype($connection),
899
-                    is_object($connection) ? '' : ': "' . $connection . '"'
899
+                    is_object($connection) ? '' : ': "'.$connection.'"'
900 900
                 )
901 901
             );
902 902
         }
@@ -946,13 +946,13 @@  discard block
 block discarded – undo
946 946
     {
947 947
         switch ($lockMode) {
948 948
             case LockMode::OPTIMISTIC:
949
-                if (!$class->isVersioned) {
949
+                if ( ! $class->isVersioned) {
950 950
                     throw OptimisticLockException::notVersioned($class->name);
951 951
                 }
952 952
                 break;
953 953
             case LockMode::PESSIMISTIC_READ:
954 954
             case LockMode::PESSIMISTIC_WRITE:
955
-                if (!$this->getConnection()->isTransactionActive()) {
955
+                if ( ! $this->getConnection()->isTransactionActive()) {
956 956
                     throw TransactionRequiredException::transactionRequired();
957 957
                 }
958 958
         }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Mapping/UnderscoreNamingStrategy.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
      */
61 61
     public function __construct($case = CASE_LOWER, bool $numberAware = false)
62 62
     {
63
-        if (! $numberAware) {
63
+        if ( ! $numberAware) {
64 64
             @trigger_error(
65
-                'Creating ' . self::class . ' without making it number aware is deprecated and will be removed in Doctrine ORM 3.0.',
65
+                'Creating '.self::class.' without making it number aware is deprecated and will be removed in Doctrine ORM 3.0.',
66 66
                 E_USER_DEPRECATED
67 67
             );
68 68
         }
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
      */
126 126
     public function referenceColumnName()
127 127
     {
128
-        return $this->case === CASE_UPPER ?  'ID' : 'id';
128
+        return $this->case === CASE_UPPER ? 'ID' : 'id';
129 129
     }
130 130
 
131 131
     /**
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
      */
134 134
     public function joinColumnName($propertyName, $className = null)
135 135
     {
136
-        return $this->underscore($propertyName) . '_' . $this->referenceColumnName();
136
+        return $this->underscore($propertyName).'_'.$this->referenceColumnName();
137 137
     }
138 138
 
139 139
     /**
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
      */
142 142
     public function joinTableName($sourceEntity, $targetEntity, $propertyName = null)
143 143
     {
144
-        return $this->classToTableName($sourceEntity) . '_' . $this->classToTableName($targetEntity);
144
+        return $this->classToTableName($sourceEntity).'_'.$this->classToTableName($targetEntity);
145 145
     }
146 146
 
147 147
     /**
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
      */
150 150
     public function joinKeyColumnName($entityName, $referencedColumnName = null)
151 151
     {
152
-        return $this->classToTableName($entityName) . '_' .
152
+        return $this->classToTableName($entityName).'_'.
153 153
                 ($referencedColumnName ?: $this->referenceColumnName());
154 154
     }
155 155
 
Please login to merge, or discard this patch.
tests/Doctrine/Tests/VerifyDeprecations.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
         $this->ignoredDeprecations  = [];
31 31
 
32 32
         $this->originalHandler = set_error_handler(
33
-            function (int $errorNumber, string $errorMessage) : void {
33
+            function(int $errorNumber, string $errorMessage) : void {
34 34
                 if (in_array($errorMessage, $this->ignoredDeprecations, true)) {
35 35
                     return;
36 36
                 }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/SchemaTool.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
                             $targetEntity = current(
227 227
                                 array_filter(
228 228
                                     $classes,
229
-                                    function (ClassMetadata $class) use ($idMapping) : bool {
229
+                                    function(ClassMetadata $class) use ($idMapping) : bool {
230 230
                                         return $class->name === $idMapping['targetEntity'];
231 231
                                     }
232 232
                                 )
@@ -646,8 +646,8 @@  discard block
 block discarded – undo
646 646
 
647 647
             if ( ! $definingClass) {
648 648
                 throw new \Doctrine\ORM\ORMException(
649
-                    'Column name `' . $joinColumn['referencedColumnName'] . '` referenced for relation from '
650
-                    . $mapping['sourceEntity'] . ' towards ' . $mapping['targetEntity'] . ' does not exist.'
649
+                    'Column name `'.$joinColumn['referencedColumnName'].'` referenced for relation from '
650
+                    . $mapping['sourceEntity'].' towards '.$mapping['targetEntity'].' does not exist.'
651 651
                 );
652 652
             }
653 653
 
@@ -742,7 +742,7 @@  discard block
 block discarded – undo
742 742
      */
743 743
     private function gatherColumnOptions(array $mapping) : array
744 744
     {
745
-        if (! isset($mapping['options'])) {
745
+        if ( ! isset($mapping['options'])) {
746 746
             return [];
747 747
         }
748 748
 
@@ -848,7 +848,7 @@  discard block
 block discarded – undo
848 848
                 if ($table->hasPrimaryKey()) {
849 849
                     $columns = $table->getPrimaryKey()->getColumns();
850 850
                     if (count($columns) == 1) {
851
-                        $checkSequence = $table->getName() . '_' . $columns[0] . '_seq';
851
+                        $checkSequence = $table->getName().'_'.$columns[0].'_seq';
852 852
                         if ($fullSchema->hasSequence($checkSequence)) {
853 853
                             $visitor->acceptSequence($fullSchema->getSequence($checkSequence));
854 854
                         }
@@ -922,7 +922,7 @@  discard block
 block discarded – undo
922 922
         }
923 923
 
924 924
         // whitelist assets we already know about in $toSchema, use the existing filter otherwise
925
-        $config->setSchemaAssetsFilter(static function ($asset) use ($previousFilter, $toSchema) : bool {
925
+        $config->setSchemaAssetsFilter(static function($asset) use ($previousFilter, $toSchema) : bool {
926 926
             $assetName = $asset instanceof AbstractAsset ? $asset->getName() : $asset;
927 927
 
928 928
             return $toSchema->hasTable($assetName) || $toSchema->hasSequence($assetName) || $previousFilter($asset);
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/Ticket/GH7875Test.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
      */
39 39
     private function filterCreateTable(array $sqls, string $tableName) : array
40 40
     {
41
-        return array_filter($sqls, static function (string $sql) use ($tableName) : bool {
41
+        return array_filter($sqls, static function(string $sql) use ($tableName) : bool {
42 42
             return strpos($sql, sprintf('CREATE TABLE %s (', $tableName)) === 0;
43 43
         });
44 44
     }
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 
55 55
         $this->_em->getConnection()->exec(current($sqls));
56 56
 
57
-        $sqls = array_filter($tool->getUpdateSchemaSql($classes), static function (string $sql) : bool {
57
+        $sqls = array_filter($tool->getUpdateSchemaSql($classes), static function(string $sql) : bool {
58 58
             return strpos($sql, ' gh7875_my_entity ') !== false;
59 59
         });
60 60
 
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
             ['/^(?!my_enti)/', null],
78 78
             [
79 79
                 null,
80
-                static function ($assetName) : bool {
80
+                static function($assetName) : bool {
81 81
                     return $assetName !== 'gh7875_my_entity';
82 82
                 },
83 83
             ],
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
         $previousFilter = $config->getSchemaAssetsFilter();
107 107
 
108 108
         $sqls = $tool->getUpdateSchemaSql($classes);
109
-        $sqls = array_filter($sqls, static function (string $sql) : bool {
109
+        $sqls = array_filter($sqls, static function(string $sql) : bool {
110 110
             return strpos($sql, ' gh7875_my_entity ') !== false;
111 111
         });
112 112
 
Please login to merge, or discard this patch.