@@ -839,7 +839,7 @@ |
||
839 | 839 | |
840 | 840 | case ($conn instanceof Connection): |
841 | 841 | if ($eventManager !== null && $conn->getEventManager() !== $eventManager) { |
842 | - throw ORMException::mismatchedEventManager(); |
|
842 | + throw ORMException::mismatchedEventManager(); |
|
843 | 843 | } |
844 | 844 | break; |
845 | 845 |
@@ -223,8 +223,8 @@ discard block |
||
223 | 223 | */ |
224 | 224 | public function transactional($func) |
225 | 225 | { |
226 | - if (!is_callable($func)) { |
|
227 | - throw new \InvalidArgumentException('Expected argument of type "callable", got "' . gettype($func) . '"'); |
|
226 | + if ( ! is_callable($func)) { |
|
227 | + throw new \InvalidArgumentException('Expected argument of type "callable", got "'.gettype($func).'"'); |
|
228 | 228 | } |
229 | 229 | |
230 | 230 | $this->conn->beginTransaction(); |
@@ -747,7 +747,7 @@ discard block |
||
747 | 747 | */ |
748 | 748 | public function isOpen() |
749 | 749 | { |
750 | - return (!$this->closed); |
|
750 | + return ( ! $this->closed); |
|
751 | 751 | } |
752 | 752 | |
753 | 753 | /** |
@@ -844,7 +844,7 @@ discard block |
||
844 | 844 | break; |
845 | 845 | |
846 | 846 | default: |
847 | - throw new \InvalidArgumentException("Invalid argument: " . $conn); |
|
847 | + throw new \InvalidArgumentException("Invalid argument: ".$conn); |
|
848 | 848 | } |
849 | 849 | |
850 | 850 | return new EntityManager($conn, $config, $conn->getEventManager()); |
@@ -101,15 +101,15 @@ |
||
101 | 101 | return new self("Unrecognized field: $field"); |
102 | 102 | } |
103 | 103 | |
104 | - /** |
|
105 | - * |
|
106 | - * @param string $class |
|
107 | - * @param string $association |
|
108 | - * @param string $given |
|
109 | - * @param string $expected |
|
110 | - * |
|
111 | - * @return \Shitty\ORM\ORMInvalidArgumentException |
|
112 | - */ |
|
104 | + /** |
|
105 | + * |
|
106 | + * @param string $class |
|
107 | + * @param string $association |
|
108 | + * @param string $given |
|
109 | + * @param string $expected |
|
110 | + * |
|
111 | + * @return \Shitty\ORM\ORMInvalidArgumentException |
|
112 | + */ |
|
113 | 113 | public static function unexpectedAssociationValue($class, $association, $given, $expected) |
114 | 114 | { |
115 | 115 | return new self(sprintf('Found entity of type %s on association %s#%s, but expecting %s', $given, $class, $association, $expected)); |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | */ |
47 | 47 | public static function namedQueryNotFound($queryName) |
48 | 48 | { |
49 | - return new self('Could not find a named query by the name "' . $queryName . '"'); |
|
49 | + return new self('Could not find a named query by the name "'.$queryName.'"'); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | /** |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | */ |
57 | 57 | public static function namedNativeQueryNotFound($nativeQueryName) |
58 | 58 | { |
59 | - return new self('Could not find a named native query by the name "' . $nativeQueryName . '"'); |
|
59 | + return new self('Could not find a named native query by the name "'.$nativeQueryName.'"'); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | /** |
@@ -68,10 +68,10 @@ discard block |
||
68 | 68 | public static function entityMissingForeignAssignedId($entity, $relatedEntity) |
69 | 69 | { |
70 | 70 | return new self( |
71 | - "Entity of type " . get_class($entity) . " has identity through a foreign entity " . get_class($relatedEntity) . ", " . |
|
72 | - "however this entity has no identity itself. You have to call EntityManager#persist() on the related entity " . |
|
73 | - "and make sure that an identifier was generated before trying to persist '" . get_class($entity) . "'. In case " . |
|
74 | - "of Post Insert ID Generation (such as MySQL Auto-Increment) this means you have to call " . |
|
71 | + "Entity of type ".get_class($entity)." has identity through a foreign entity ".get_class($relatedEntity).", ". |
|
72 | + "however this entity has no identity itself. You have to call EntityManager#persist() on the related entity ". |
|
73 | + "and make sure that an identifier was generated before trying to persist '".get_class($entity)."'. In case ". |
|
74 | + "of Post Insert ID Generation (such as MySQL Auto-Increment) this means you have to call ". |
|
75 | 75 | "EntityManager#flush() between both persist operations." |
76 | 76 | ); |
77 | 77 | } |
@@ -84,9 +84,9 @@ discard block |
||
84 | 84 | */ |
85 | 85 | public static function entityMissingAssignedIdForField($entity, $field) |
86 | 86 | { |
87 | - return new self("Entity of type " . get_class($entity) . " is missing an assigned ID for field '" . $field . "'. " . |
|
87 | + return new self("Entity of type ".get_class($entity)." is missing an assigned ID for field '".$field."'. ". |
|
88 | 88 | "The identifier generation strategy for this entity requires the ID field to be populated before ". |
89 | - "EntityManager#persist() is called. If you want automatically generated identifiers instead " . |
|
89 | + "EntityManager#persist() is called. If you want automatically generated identifiers instead ". |
|
90 | 90 | "you need to adjust the metadata mapping accordingly." |
91 | 91 | ); |
92 | 92 | } |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | */ |
124 | 124 | public static function invalidOrientation($className, $field) |
125 | 125 | { |
126 | - return new self("Invalid order by orientation specified for " . $className . "#" . $field); |
|
126 | + return new self("Invalid order by orientation specified for ".$className."#".$field); |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | /** |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | */ |
241 | 241 | public static function queryCacheUsesNonPersistentCache(CacheDriver $cache) |
242 | 242 | { |
243 | - return new self('Query Cache uses a non-persistent cache driver, ' . get_class($cache) . '.'); |
|
243 | + return new self('Query Cache uses a non-persistent cache driver, '.get_class($cache).'.'); |
|
244 | 244 | } |
245 | 245 | |
246 | 246 | /** |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | */ |
251 | 251 | public static function metadataCacheUsesNonPersistentCache(CacheDriver $cache) |
252 | 252 | { |
253 | - return new self('Metadata Cache uses a non-persistent cache driver, ' . get_class($cache) . '.'); |
|
253 | + return new self('Metadata Cache uses a non-persistent cache driver, '.get_class($cache).'.'); |
|
254 | 254 | } |
255 | 255 | |
256 | 256 | /** |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | */ |
292 | 292 | public static function missingIdentifierField($className, $fieldName) |
293 | 293 | { |
294 | - return new self("The identifier $fieldName is missing for a query of " . $className); |
|
294 | + return new self("The identifier $fieldName is missing for a query of ".$className); |
|
295 | 295 | } |
296 | 296 | |
297 | 297 | /** |
@@ -303,8 +303,8 @@ discard block |
||
303 | 303 | public static function unrecognizedIdentifierFields($className, $fieldNames) |
304 | 304 | { |
305 | 305 | return new self( |
306 | - "Unrecognized identifier fields: '" . implode("', '", $fieldNames) . "' " . |
|
307 | - "are not present on class '" . $className . "'." |
|
306 | + "Unrecognized identifier fields: '".implode("', '", $fieldNames)."' ". |
|
307 | + "are not present on class '".$className."'." |
|
308 | 308 | ); |
309 | 309 | } |
310 | 310 |