@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | public function input(string $name, $data) |
| 51 | 51 | { |
| 52 | 52 | if (array_key_exists($name, $this->processor) && $this->processor[$name] === ObjectMiddleware::SERIALIZE) { |
| 53 | - return $data === null? $data : \serialize($data); |
|
| 53 | + return $data === null ? $data : \serialize($data); |
|
| 54 | 54 | } |
| 55 | 55 | return $data; |
| 56 | 56 | } |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | if ($doc = $property->getDocComment()) { |
| 97 | 97 | if (is_string($doc) && preg_match('/@var\s+(\w+)/i', $doc, $match)) { |
| 98 | 98 | $type = \strtolower($match[1]); |
| 99 | - if (\in_array($type, ['boolean', 'bool', 'integer', 'int' , 'float' , 'double', 'string'])) { |
|
| 99 | + if (\in_array($type, ['boolean', 'bool', 'integer', 'int', 'float', 'double', 'string'])) { |
|
| 100 | 100 | return ObjectMiddleware::RAW; |
| 101 | 101 | } |
| 102 | 102 | } |
@@ -60,7 +60,7 @@ |
||
| 60 | 60 | protected function prepareProcessorSet(string $object) |
| 61 | 61 | { |
| 62 | 62 | $reflectObject = new ReflectionClass($object); |
| 63 | - $classDoc = $reflectObject->getDocComment()?:''; |
|
| 63 | + $classDoc = $reflectObject->getDocComment() ?: ''; |
|
| 64 | 64 | $field = TableClassStructBuilder::readClassDocField($classDoc); |
| 65 | 65 | if ($field !== null) { |
| 66 | 66 | $this->createProccorFromStruct(); |
@@ -139,7 +139,7 @@ |
||
| 139 | 139 | if (is_string($doc) && preg_match('/@field\s+(\w+)(?:\((.+?)\))?\s+(.+)?$/im', $doc, $match)) { |
| 140 | 140 | $type = strtoupper($match[1]); |
| 141 | 141 | $length = static::parseLength($match[2] ?? ''); |
| 142 | - return [$type, $length , trim($match[3] ?? '')]; |
|
| 142 | + return [$type, $length, trim($match[3] ?? '')]; |
|
| 143 | 143 | } |
| 144 | 144 | } |
| 145 | 145 | return ['text', null, '']; |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | * @param strring $classDoc |
| 62 | 62 | * @return array|null |
| 63 | 63 | */ |
| 64 | - public static function readClassDocField(string $classDoc):?array |
|
| 64 | + public static function readClassDocField(string $classDoc): ?array |
|
| 65 | 65 | { |
| 66 | 66 | if (preg_match_all('/@field\s+(\w+)\s+(\w+)(?:\((.+?)\))?\s+(.+)?$/im', $classDoc, $match)) { |
| 67 | 67 | return $match; |
@@ -251,7 +251,7 @@ |
||
| 251 | 251 | protected function createDefaultMiddleware(string $object, TableStruct $struct) |
| 252 | 252 | { |
| 253 | 253 | $reflectObject = new ReflectionClass($object); |
| 254 | - $classDoc = $reflectObject->getDocComment()?:''; |
|
| 254 | + $classDoc = $reflectObject->getDocComment() ?: ''; |
|
| 255 | 255 | if (\preg_match('/@field-serialize\s+(\w+)/i', $classDoc, $matchs)) { |
| 256 | 256 | return new TableStructMiddleware($object, $struct); |
| 257 | 257 | } |