@@ -8,12 +8,12 @@ |
||
| 8 | 8 | { |
| 9 | 9 | public function __construct($value) |
| 10 | 10 | { |
| 11 | - parent::__construct("X'" . str_replace("-", "", $value) . "'"); |
|
| 11 | + parent::__construct("X'".str_replace("-", "", $value)."'"); |
|
| 12 | 12 | } |
| 13 | 13 | |
| 14 | 14 | public static function getUuidFromLiteral($literal): string |
| 15 | 15 | { |
| 16 | 16 | $value = $literal->__toString(); |
| 17 | - return substr($value, 2, 8) . "-" . substr($value, 10, 4) . "-" . substr($value, 14, 4) . "-" . substr($value, 18, 4) . "-" . substr($value, 22, 12); |
|
| 17 | + return substr($value, 2, 8)."-".substr($value, 10, 4)."-".substr($value, 14, 4)."-".substr($value, 18, 4)."-".substr($value, 22, 12); |
|
| 18 | 18 | } |
| 19 | 19 | } |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | * @throws \ByJG\MicroOrm\Exception\InvalidArgumentException |
| 64 | 64 | * @throws InvalidArgumentException |
| 65 | 65 | */ |
| 66 | - public function list(?int $page = 0, int $size = 20, $orderBy = null, $filter = null): array |
|
| 66 | + public function list(?int $page = 0, int $size = 20, $orderBy = null, $filter = null) : array |
|
| 67 | 67 | { |
| 68 | 68 | if (empty($page)) { |
| 69 | 69 | $page = 0; |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | |
| 76 | 76 | $query = Query::getInstance() |
| 77 | 77 | ->table($this->repository->getMapper()->getTable()) |
| 78 | - ->limit($page*$size, $size); |
|
| 78 | + ->limit($page * $size, $size); |
|
| 79 | 79 | |
| 80 | 80 | if (!empty($orderBy)) { |
| 81 | 81 | if (!is_array($orderBy)) { |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | |
| 105 | 105 | $query = Query::getInstance() |
| 106 | 106 | ->table($tableName) |
| 107 | - ->limit($page*$size, $size); |
|
| 107 | + ->limit($page * $size, $size); |
|
| 108 | 108 | |
| 109 | 109 | if (!empty($orderBy)) { |
| 110 | 110 | if (!is_array($orderBy)) { |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | |
| 133 | 133 | protected function getClosureNewUUID(): Literal |
| 134 | 134 | { |
| 135 | - return new Literal("X'" . $this->repository->getDbDriver()->getScalar("SELECT hex(uuid_to_bin(uuid()))") . "'"); |
|
| 135 | + return new Literal("X'".$this->repository->getDbDriver()->getScalar("SELECT hex(uuid_to_bin(uuid()))")."'"); |
|
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | public static function getUuid() |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | protected function setClosureFixBinaryUUID(Mapper $mapper, string $pkFieldName = 'id', string $modelField = 'uuid') |
| 150 | 150 | { |
| 151 | 151 | $mapper->addFieldMapping(FieldMapping::create($pkFieldName) |
| 152 | - ->withUpdateFunction(function ($value, $instance) { |
|
| 152 | + ->withUpdateFunction(function($value, $instance) { |
|
| 153 | 153 | if (empty($value)) { |
| 154 | 154 | return null; |
| 155 | 155 | } |
@@ -158,8 +158,8 @@ discard block |
||
| 158 | 158 | } |
| 159 | 159 | return $value; |
| 160 | 160 | }) |
| 161 | - ->withSelectFunction(function ($value, $instance) use ($modelField) { |
|
| 162 | - return str_replace('-', '', $instance->{'get' . $modelField}()); |
|
| 161 | + ->withSelectFunction(function($value, $instance) use ($modelField) { |
|
| 162 | + return str_replace('-', '', $instance->{'get'.$modelField}()); |
|
| 163 | 163 | }) |
| 164 | 164 | ); |
| 165 | 165 | } |