Failed Conditions
Push — master ( ddccd4...8ad3df )
by Marco
13:34
created
lib/Doctrine/ORM/ORMInvalidArgumentException.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@
 block discarded – undo
83 83
 
84 84
     /**
85 85
      * @param array[][]|object[][] $newEntitiesWithAssociations non-empty an array
86
- *                                                              of [array $associationMapping, object $entity] pairs
86
+     *                                                              of [array $associationMapping, object $entity] pairs
87 87
      *
88 88
      * @return ORMInvalidArgumentException
89 89
      */
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
      */
35 35
     static public function scheduleInsertForManagedEntity($entity)
36 36
     {
37
-        return new self("A managed+dirty entity " . self::objToStr($entity) . " can not be scheduled for insertion.");
37
+        return new self("A managed+dirty entity ".self::objToStr($entity)." can not be scheduled for insertion.");
38 38
     }
39 39
 
40 40
     /**
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
      */
45 45
     static public function scheduleInsertForRemovedEntity($entity)
46 46
     {
47
-        return new self("Removed entity " . self::objToStr($entity) . " can not be scheduled for insertion.");
47
+        return new self("Removed entity ".self::objToStr($entity)." can not be scheduled for insertion.");
48 48
     }
49 49
 
50 50
     /**
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
      */
55 55
     static public function scheduleInsertTwice($entity)
56 56
     {
57
-        return new self("Entity " . self::objToStr($entity) . " can not be scheduled for insertion twice.");
57
+        return new self("Entity ".self::objToStr($entity)." can not be scheduled for insertion twice.");
58 58
     }
59 59
 
60 60
     /**
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
     static public function entityWithoutIdentity($className, $entity)
67 67
     {
68 68
         return new self(
69
-            "The given entity of type '" . $className . "' (".self::objToStr($entity).") has no identity/no " .
69
+            "The given entity of type '".$className."' (".self::objToStr($entity).") has no identity/no ".
70 70
             "id values set. It cannot be added to the identity map."
71 71
         );
72 72
     }
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
      */
79 79
     static public function readOnlyRequiresManagedEntity($entity)
80 80
     {
81
-        return new self("Only managed entities can be marked or checked as read only. But " . self::objToStr($entity) . " is not");
81
+        return new self("Only managed entities can be marked or checked as read only. But ".self::objToStr($entity)." is not");
82 82
     }
83 83
 
84 84
     /**
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
     static public function newEntitiesFoundThroughRelationships($newEntitiesWithAssociations)
91 91
     {
92 92
         $errorMessages = array_map(
93
-            function (array $newEntityWithAssociation) : string {
93
+            function(array $newEntityWithAssociation) : string {
94 94
                 [$associationMapping, $entity] = $newEntityWithAssociation;
95 95
 
96 96
                 return self::newEntityFoundThroughRelationshipMessage($associationMapping, $entity);
@@ -128,8 +128,8 @@  discard block
 block discarded – undo
128 128
      */
129 129
     static public function detachedEntityFoundThroughRelationship(array $assoc, $entry)
130 130
     {
131
-        return new self("A detached entity of type " . $assoc['targetEntity'] . " (" . self::objToStr($entry) . ") "
132
-            . " was found through the relationship '" . $assoc['sourceEntity'] . "#" . $assoc['fieldName'] . "' "
131
+        return new self("A detached entity of type ".$assoc['targetEntity']." (".self::objToStr($entry).") "
132
+            . " was found through the relationship '".$assoc['sourceEntity']."#".$assoc['fieldName']."' "
133 133
             . "during cascading a persist operation.");
134 134
     }
135 135
 
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
      */
141 141
     static public function entityNotManaged($entity)
142 142
     {
143
-        return new self("Entity " . self::objToStr($entity) . " is not managed. An entity is managed if its fetched " .
143
+        return new self("Entity ".self::objToStr($entity)." is not managed. An entity is managed if its fetched ".
144 144
             "from the database or registered as new through EntityManager#persist");
145 145
     }
146 146
 
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
      */
153 153
     static public function entityHasNoIdentity($entity, $operation)
154 154
     {
155
-        return new self("Entity has no identity, therefore " . $operation ." cannot be performed. " . self::objToStr($entity));
155
+        return new self("Entity has no identity, therefore ".$operation." cannot be performed. ".self::objToStr($entity));
156 156
     }
157 157
 
158 158
     /**
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
      */
164 164
     static public function entityIsRemoved($entity, $operation)
165 165
     {
166
-        return new self("Entity is removed, therefore " . $operation ." cannot be performed. " . self::objToStr($entity));
166
+        return new self("Entity is removed, therefore ".$operation." cannot be performed. ".self::objToStr($entity));
167 167
     }
168 168
 
169 169
     /**
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
      */
175 175
     static public function detachedEntityCannot($entity, $operation)
176 176
     {
177
-        return new self("Detached entity " . self::objToStr($entity) . " cannot be " . $operation);
177
+        return new self("Detached entity ".self::objToStr($entity)." cannot be ".$operation);
178 178
     }
179 179
 
180 180
     /**
@@ -186,8 +186,8 @@  discard block
 block discarded – undo
186 186
      */
187 187
     public static function invalidObject($context, $given, $parameterIndex = 1)
188 188
     {
189
-        return new self($context . ' expects parameter ' . $parameterIndex .
190
-            ' to be an entity object, '. gettype($given) . ' given.');
189
+        return new self($context.' expects parameter '.$parameterIndex.
190
+            ' to be an entity object, '.gettype($given).' given.');
191 191
     }
192 192
 
193 193
     /**
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
      */
196 196
     public static function invalidCompositeIdentifier()
197 197
     {
198
-        return new self("Binding an entity with a composite primary key to a query is not supported. " .
198
+        return new self("Binding an entity with a composite primary key to a query is not supported. ".
199 199
             "You should split the parameter into the explicit fields and bind them separately.");
200 200
     }
201 201
 
@@ -262,15 +262,15 @@  discard block
 block discarded – undo
262 262
     private static function newEntityFoundThroughRelationshipMessage(array $associationMapping, $entity) : string
263 263
     {
264 264
         return 'A new entity was found through the relationship \''
265
-            . $associationMapping['sourceEntity'] . '#' . $associationMapping['fieldName'] . '\' that was not'
266
-            . ' configured to cascade persist operations for entity: ' . self::objToStr($entity) . '.'
265
+            . $associationMapping['sourceEntity'].'#'.$associationMapping['fieldName'].'\' that was not'
266
+            . ' configured to cascade persist operations for entity: '.self::objToStr($entity).'.'
267 267
             . ' To solve this issue: Either explicitly call EntityManager#persist()'
268 268
             . ' on this unknown entity or configure cascade persist'
269 269
             . ' this association in the mapping for example @ManyToOne(..,cascade={"persist"}).'
270 270
             . (method_exists($entity, '__toString')
271 271
                 ? ''
272 272
                 : ' If you cannot find out which entity causes the problem implement \''
273
-                . $associationMapping['targetEntity'] . '#__toString()\' to get a clue.'
273
+                . $associationMapping['targetEntity'].'#__toString()\' to get a clue.'
274 274
             );
275 275
     }
276 276
 }
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/ORMInvalidArgumentExceptionTest.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -81,12 +81,12 @@  discard block
 block discarded – undo
81 81
             'fieldName'    => 'bar1',
82 82
             'targetEntity' => 'baz1',
83 83
         ];
84
-        $association2  = [
84
+        $association2 = [
85 85
             'sourceEntity' => 'foo2',
86 86
             'fieldName'    => 'bar2',
87 87
             'targetEntity' => 'baz2',
88 88
         ];
89
-        $association3  = [
89
+        $association3 = [
90 90
             'sourceEntity' => 'foo3',
91 91
             'fieldName'    => 'bar3',
92 92
             'targetEntity' => 'baz3',
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
                     ],
104 104
                 ],
105 105
                 'A new entity was found through the relationship \'foo1#bar1\' that was not configured to cascade '
106
-                . 'persist operations for entity: stdClass@' . spl_object_hash($entity1)
106
+                . 'persist operations for entity: stdClass@'.spl_object_hash($entity1)
107 107
                 . '. To solve this issue: Either explicitly call EntityManager#persist() on this unknown entity '
108 108
                 . 'or configure cascade persist this association in the mapping for example '
109 109
                 . '@ManyToOne(..,cascade={"persist"}). If you cannot find out which entity causes the problem '
@@ -120,15 +120,15 @@  discard block
 block discarded – undo
120 120
                         $entity2,
121 121
                     ],
122 122
                 ],
123
-                'Multiple non-persisted new entities were found through the given association graph:' . "\n\n"
123
+                'Multiple non-persisted new entities were found through the given association graph:'."\n\n"
124 124
                 . ' * A new entity was found through the relationship \'foo1#bar1\' that was not configured to '
125
-                . 'cascade persist operations for entity: stdClass@' . spl_object_hash($entity1) . '. '
125
+                . 'cascade persist operations for entity: stdClass@'.spl_object_hash($entity1).'. '
126 126
                 . 'To solve this issue: Either explicitly call EntityManager#persist() on this unknown entity '
127 127
                 . 'or configure cascade persist this association in the mapping for example '
128 128
                 . '@ManyToOne(..,cascade={"persist"}). If you cannot find out which entity causes the problem '
129
-                . 'implement \'baz1#__toString()\' to get a clue.' . "\n"
129
+                . 'implement \'baz1#__toString()\' to get a clue.'."\n"
130 130
                 . ' * A new entity was found through the relationship \'foo2#bar2\' that was not configured to '
131
-                . 'cascade persist operations for entity: stdClass@' . spl_object_hash($entity2) . '. To solve '
131
+                . 'cascade persist operations for entity: stdClass@'.spl_object_hash($entity2).'. To solve '
132 132
                 . 'this issue: Either explicitly call EntityManager#persist() on this unknown entity or '
133 133
                 . 'configure cascade persist this association in the mapping for example '
134 134
                 . '@ManyToOne(..,cascade={"persist"}). If you cannot find out which entity causes the problem '
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
                     ],
143 143
                 ],
144 144
                 'A new entity was found through the relationship \'foo3#bar3\' that was not configured to cascade '
145
-                . 'persist operations for entity: ' . $stringEntity3
145
+                . 'persist operations for entity: '.$stringEntity3
146 146
                 . '. To solve this issue: Either explicitly call EntityManager#persist() on this unknown entity '
147 147
                 . 'or configure cascade persist this association in the mapping for example '
148 148
                 . '@ManyToOne(..,cascade={"persist"}).',
Please login to merge, or discard this patch.