@@ -7,25 +7,25 @@ |
||
| 7 | 7 | /** |
| 8 | 8 | * @return string |
| 9 | 9 | */ |
| 10 | - public function generateDsn(); |
|
| 10 | + public function generateDsn (); |
|
| 11 | 11 | |
| 12 | 12 | /** |
| 13 | 13 | * @return string |
| 14 | 14 | */ |
| 15 | - public function getUsername(); |
|
| 15 | + public function getUsername (); |
|
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | 18 | * @return string |
| 19 | 19 | */ |
| 20 | - public function getPassword(); |
|
| 20 | + public function getPassword (); |
|
| 21 | 21 | |
| 22 | 22 | /** |
| 23 | 23 | * @return string |
| 24 | 24 | */ |
| 25 | - public function getDbname(); |
|
| 25 | + public function getDbname (); |
|
| 26 | 26 | |
| 27 | 27 | /** |
| 28 | 28 | * @return string |
| 29 | 29 | */ |
| 30 | - public function getAdapterConnectionClass(); |
|
| 30 | + public function getAdapterConnectionClass (); |
|
| 31 | 31 | } |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | * @param string $adapter |
| 43 | 43 | * @param int $port |
| 44 | 44 | */ |
| 45 | - public function __construct( |
|
| 45 | + public function __construct ( |
|
| 46 | 46 | string $host, |
| 47 | 47 | string $username, |
| 48 | 48 | string $password, |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | /** |
| 62 | 62 | * @return string |
| 63 | 63 | */ |
| 64 | - public function getUsername(): string |
|
| 64 | + public function getUsername (): string |
|
| 65 | 65 | { |
| 66 | 66 | return $this->username; |
| 67 | 67 | } |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | /** |
| 70 | 70 | * @return string |
| 71 | 71 | */ |
| 72 | - public function getPassword(): string |
|
| 72 | + public function getPassword (): string |
|
| 73 | 73 | { |
| 74 | 74 | return $this->password; |
| 75 | 75 | } |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | /** |
| 78 | 78 | * @return string |
| 79 | 79 | */ |
| 80 | - public function getDbname(): string |
|
| 80 | + public function getDbname (): string |
|
| 81 | 81 | { |
| 82 | 82 | return $this->dbname; |
| 83 | 83 | } |
@@ -26,5 +26,5 @@ |
||
| 26 | 26 | /** |
| 27 | 27 | * @return $this |
| 28 | 28 | */ |
| 29 | - public function beginTransaction(); |
|
| 29 | + public function beginTransaction (); |
|
| 30 | 30 | } |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | * @return string |
| 34 | 34 | * @throws RepositoryException |
| 35 | 35 | */ |
| 36 | - protected function quote($value) |
|
| 36 | + protected function quote ($value) |
|
| 37 | 37 | { |
| 38 | 38 | switch ($phpParamType = \mb_strtolower(\gettype($value))) { |
| 39 | 39 | case 'null': |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | * |
| 76 | 76 | * @return PaginatorInterface |
| 77 | 77 | */ |
| 78 | - protected function paginator( |
|
| 78 | + protected function paginator ( |
|
| 79 | 79 | QueryBuilderInterface $queryBuilder, |
| 80 | 80 | int $pageSize, |
| 81 | 81 | int $currentPage = 1, |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | * |
| 107 | 107 | * @return $this |
| 108 | 108 | */ |
| 109 | - protected function log(string $level, string $message, array $context = []): AbstractRepository |
|
| 109 | + protected function log (string $level, string $message, array $context = []): AbstractRepository |
|
| 110 | 110 | { |
| 111 | 111 | if (null === $this->logger) { |
| 112 | 112 | return $this; |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | * |
| 123 | 123 | * @return $this |
| 124 | 124 | */ |
| 125 | - protected function beginTransaction(ConnectionInterface $connection = null): AbstractRepository |
|
| 125 | + protected function beginTransaction (ConnectionInterface $connection = null): AbstractRepository |
|
| 126 | 126 | { |
| 127 | 127 | if (null === $connection) { |
| 128 | 128 | $connection = $this->getConnection(); |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | * |
| 141 | 141 | * @return bool |
| 142 | 142 | */ |
| 143 | - protected function commit(ConnectionInterface $connection = null): bool |
|
| 143 | + protected function commit (ConnectionInterface $connection = null): bool |
|
| 144 | 144 | { |
| 145 | 145 | if (null === $connection) { |
| 146 | 146 | $connection = $this->getConnection(); |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | * |
| 159 | 159 | * @return $this |
| 160 | 160 | */ |
| 161 | - protected function rollback(ConnectionInterface $connection = null): AbstractRepository |
|
| 161 | + protected function rollback (ConnectionInterface $connection = null): AbstractRepository |
|
| 162 | 162 | { |
| 163 | 163 | if (null === $connection) { |
| 164 | 164 | $connection = $this->getConnection(); |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | * |
| 179 | 179 | * @return \PDOStatement |
| 180 | 180 | */ |
| 181 | - protected function prepareAndExecute( |
|
| 181 | + protected function prepareAndExecute ( |
|
| 182 | 182 | QueryBuilderInterface $queryBuilder, |
| 183 | 183 | array $bindData, |
| 184 | 184 | ConnectionInterface $connection = null |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | /** |
| 206 | 206 | * @return ConnectionInterface |
| 207 | 207 | */ |
| 208 | - protected function getConnection(): ConnectionInterface |
|
| 208 | + protected function getConnection (): ConnectionInterface |
|
| 209 | 209 | { |
| 210 | 210 | if (null === $this->connectionPool) { |
| 211 | 211 | $this->connectionPool = new ConnectionPool(); |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | * |
| 222 | 222 | * @return string |
| 223 | 223 | */ |
| 224 | - protected function getEntityClassConstant($constant): string |
|
| 224 | + protected function getEntityClassConstant ($constant): string |
|
| 225 | 225 | { |
| 226 | 226 | return \constant(\sprintf('%s::%s', $this->getEntityClass(), $constant)); |
| 227 | 227 | } |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | /** |
| 230 | 230 | * @return \Closure |
| 231 | 231 | */ |
| 232 | - protected function createRepositoryCallClosure(): \Closure |
|
| 232 | + protected function createRepositoryCallClosure (): \Closure |
|
| 233 | 233 | { |
| 234 | 234 | return function ($methodName, QueryBuilderInterface $queryBuilder, $toString) { |
| 235 | 235 | return $this->$methodName($queryBuilder, $toString); |
@@ -241,12 +241,12 @@ discard block |
||
| 241 | 241 | * |
| 242 | 242 | * @return QueryBuilderInterface |
| 243 | 243 | */ |
| 244 | - abstract protected function createQueryBuilder(EntityInterface $entity = null): QueryBuilderInterface; |
|
| 244 | + abstract protected function createQueryBuilder (EntityInterface $entity = null): QueryBuilderInterface; |
|
| 245 | 245 | |
| 246 | 246 | /** |
| 247 | 247 | * @return string |
| 248 | 248 | */ |
| 249 | - abstract protected function getEntityClass(): string; |
|
| 249 | + abstract protected function getEntityClass (): string; |
|
| 250 | 250 | |
| 251 | 251 | /** |
| 252 | 252 | * @param QueryBuilderInterface $queryBuilder |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | * |
| 256 | 256 | * @return $this |
| 257 | 257 | */ |
| 258 | - abstract protected function addPaginateQuery( |
|
| 258 | + abstract protected function addPaginateQuery ( |
|
| 259 | 259 | QueryBuilderInterface $queryBuilder, |
| 260 | 260 | int $pageSize, |
| 261 | 261 | int $currentPage |
@@ -267,5 +267,5 @@ discard block |
||
| 267 | 267 | * |
| 268 | 268 | * @return EntityInterface[] |
| 269 | 269 | */ |
| 270 | - abstract protected function getPaginateResult(QueryBuilderInterface $queryBuilder, bool $toString = false): array; |
|
| 270 | + abstract protected function getPaginateResult (QueryBuilderInterface $queryBuilder, bool $toString = false): array; |
|
| 271 | 271 | } |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | /** |
| 25 | 25 | * @param DmsFactory $dmsFactory |
| 26 | 26 | */ |
| 27 | - public function __construct(DmsFactory $dmsFactory) |
|
| 27 | + public function __construct (DmsFactory $dmsFactory) |
|
| 28 | 28 | { |
| 29 | 29 | $this->dmsFactory = $dmsFactory; |
| 30 | 30 | } |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | * |
| 35 | 35 | * @return $this |
| 36 | 36 | */ |
| 37 | - public function addWriter(WriterInterface $writer): Generator |
|
| 37 | + public function addWriter (WriterInterface $writer): Generator |
|
| 38 | 38 | { |
| 39 | 39 | $writerClass = \get_class($writer); |
| 40 | 40 | |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | * |
| 52 | 52 | * @return $this |
| 53 | 53 | */ |
| 54 | - public function generate(ConnectionInterface $connection, string $databaseName): Generator |
|
| 54 | + public function generate (ConnectionInterface $connection, string $databaseName): Generator |
|
| 55 | 55 | { |
| 56 | 56 | $dmsDatabase = $this->dmsFactory->createDmsDatabase($databaseName, $connection); |
| 57 | 57 | |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | * |
| 74 | 74 | * @return $this |
| 75 | 75 | */ |
| 76 | - protected function removeExistingFiles(array &$existingFiles): Generator |
|
| 76 | + protected function removeExistingFiles (array &$existingFiles): Generator |
|
| 77 | 77 | { |
| 78 | 78 | foreach (\array_keys($existingFiles) as $path) { |
| 79 | 79 | if (!\is_dir($path) && \file_exists($path)) { |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | * @param int $currentPage |
| 75 | 75 | * @param array $options |
| 76 | 76 | */ |
| 77 | - public function __construct( |
|
| 77 | + public function __construct ( |
|
| 78 | 78 | QueryBuilderInterface $queryBuilder, |
| 79 | 79 | \Closure $addPaginateQuery, |
| 80 | 80 | \Closure $getPaginateResult, |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | * |
| 101 | 101 | * @return EntityInterface[]|string |
| 102 | 102 | */ |
| 103 | - public function paginate(bool $toString = false) |
|
| 103 | + public function paginate (bool $toString = false) |
|
| 104 | 104 | { |
| 105 | 105 | if (false === $this->paginate) { |
| 106 | 106 | return $this->result; |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | * |
| 132 | 132 | * @return EntityInterface[]|string |
| 133 | 133 | */ |
| 134 | - public function paginateFake(bool $toString = false) |
|
| 134 | + public function paginateFake (bool $toString = false) |
|
| 135 | 135 | { |
| 136 | 136 | if (false === $this->paginate) { |
| 137 | 137 | return $this->result; |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | * @return array |
| 151 | 151 | * @throws PaginatorException |
| 152 | 152 | */ |
| 153 | - public function getPageNumbers(): array |
|
| 153 | + public function getPageNumbers (): array |
|
| 154 | 154 | { |
| 155 | 155 | if (true === $this->paginate) { |
| 156 | 156 | throw new PaginatorException('You must call "paginate" or "paginateFake" before calling this method!'); |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | * @return int |
| 198 | 198 | * @throws PaginatorException |
| 199 | 199 | */ |
| 200 | - public function getTotalPages(): int |
|
| 200 | + public function getTotalPages (): int |
|
| 201 | 201 | { |
| 202 | 202 | if (true === $this->paginate) { |
| 203 | 203 | throw new PaginatorException('You must call "paginate" or "paginateFake" before calling this method!'); |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | * @return int |
| 219 | 219 | * @throws PaginatorException |
| 220 | 220 | */ |
| 221 | - public function getCurrentPageNumber(): int |
|
| 221 | + public function getCurrentPageNumber (): int |
|
| 222 | 222 | { |
| 223 | 223 | if (true === $this->paginate) { |
| 224 | 224 | throw new PaginatorException('You must call "paginate" or "paginateFake" before calling this method!'); |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | * @return null|int |
| 232 | 232 | * @throws PaginatorException |
| 233 | 233 | */ |
| 234 | - public function getNextPageNumber(): ?int |
|
| 234 | + public function getNextPageNumber (): ?int |
|
| 235 | 235 | { |
| 236 | 236 | if (true === $this->paginate) { |
| 237 | 237 | throw new PaginatorException('You must call "paginate" or "paginateFake" before calling this method!'); |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | * @return null|int |
| 249 | 249 | * @throws PaginatorException |
| 250 | 250 | */ |
| 251 | - public function getPreviousPageNumber(): ?int |
|
| 251 | + public function getPreviousPageNumber (): ?int |
|
| 252 | 252 | { |
| 253 | 253 | if (true === $this->paginate) { |
| 254 | 254 | throw new PaginatorException('You must call "paginate" or "paginateFake" before calling this method!'); |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | * @return int |
| 266 | 266 | * @throws PaginatorException |
| 267 | 267 | */ |
| 268 | - public function getResultTotalCount(): int |
|
| 268 | + public function getResultTotalCount (): int |
|
| 269 | 269 | { |
| 270 | 270 | if (true === $this->paginate) { |
| 271 | 271 | throw new PaginatorException('You must call "paginate" or "paginateFake" before calling this method!'); |
@@ -284,7 +284,7 @@ discard block |
||
| 284 | 284 | * @return int |
| 285 | 285 | * @throws PaginatorException |
| 286 | 286 | */ |
| 287 | - public function getPageSize(): int |
|
| 287 | + public function getPageSize (): int |
|
| 288 | 288 | { |
| 289 | 289 | if (true === $this->paginate) { |
| 290 | 290 | throw new PaginatorException('You must call "paginate" or "paginateFake" before calling this method!'); |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | * |
| 299 | 299 | * @return $this |
| 300 | 300 | */ |
| 301 | - protected function setPaginateMethod(string $paginateMethod): Paginator |
|
| 301 | + protected function setPaginateMethod (string $paginateMethod): Paginator |
|
| 302 | 302 | { |
| 303 | 303 | if (null === $this->paginateMethod) { |
| 304 | 304 | $this->paginateMethod = \explode('::', $paginateMethod)[1]; |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | * |
| 12 | 12 | * @return EntityInterface[]|string |
| 13 | 13 | */ |
| 14 | - public function paginate(bool $toString = false); |
|
| 14 | + public function paginate (bool $toString = false); |
|
| 15 | 15 | |
| 16 | 16 | /** |
| 17 | 17 | * Same behavior as paginate method, except executing count to get the total result count! |
@@ -20,40 +20,40 @@ discard block |
||
| 20 | 20 | * |
| 21 | 21 | * @return EntityInterface[]|string |
| 22 | 22 | */ |
| 23 | - public function paginateFake(bool $toString = false); |
|
| 23 | + public function paginateFake (bool $toString = false); |
|
| 24 | 24 | |
| 25 | 25 | /** |
| 26 | 26 | * @return array |
| 27 | 27 | */ |
| 28 | - public function getPageNumbers(): array; |
|
| 28 | + public function getPageNumbers (): array; |
|
| 29 | 29 | |
| 30 | 30 | /** |
| 31 | 31 | * @return int |
| 32 | 32 | */ |
| 33 | - public function getTotalPages(): int; |
|
| 33 | + public function getTotalPages (): int; |
|
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | 36 | * @return int |
| 37 | 37 | */ |
| 38 | - public function getCurrentPageNumber(): int; |
|
| 38 | + public function getCurrentPageNumber (): int; |
|
| 39 | 39 | |
| 40 | 40 | /** |
| 41 | 41 | * @return null|int |
| 42 | 42 | */ |
| 43 | - public function getNextPageNumber(): ?int; |
|
| 43 | + public function getNextPageNumber (): ?int; |
|
| 44 | 44 | |
| 45 | 45 | /** |
| 46 | 46 | * @return null|int |
| 47 | 47 | */ |
| 48 | - public function getPreviousPageNumber(): ?int; |
|
| 48 | + public function getPreviousPageNumber (): ?int; |
|
| 49 | 49 | |
| 50 | 50 | /** |
| 51 | 51 | * @return int |
| 52 | 52 | */ |
| 53 | - public function getResultTotalCount(): int; |
|
| 53 | + public function getResultTotalCount (): int; |
|
| 54 | 54 | |
| 55 | 55 | /** |
| 56 | 56 | * @return int |
| 57 | 57 | */ |
| 58 | - public function getPageSize(): int; |
|
| 58 | + public function getPageSize (): int; |
|
| 59 | 59 | } |
@@ -9,22 +9,22 @@ |
||
| 9 | 9 | /** |
| 10 | 10 | * @return string |
| 11 | 11 | */ |
| 12 | - public function buildQuery(): string; |
|
| 12 | + public function buildQuery (): string; |
|
| 13 | 13 | |
| 14 | 14 | /** |
| 15 | 15 | * @return null|EntityInterface |
| 16 | 16 | */ |
| 17 | - public function getEntity(): ?EntityInterface; |
|
| 17 | + public function getEntity (): ?EntityInterface; |
|
| 18 | 18 | |
| 19 | 19 | /** |
| 20 | 20 | * @return string |
| 21 | 21 | */ |
| 22 | - public function toString(): string; |
|
| 22 | + public function toString (): string; |
|
| 23 | 23 | |
| 24 | 24 | /** |
| 25 | 25 | * @param bool $toString |
| 26 | 26 | * |
| 27 | 27 | * @return int |
| 28 | 28 | */ |
| 29 | - public function count(bool $toString = false); |
|
| 29 | + public function count (bool $toString = false); |
|
| 30 | 30 | } |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | * |
| 15 | 15 | * @return DmsTableInterface |
| 16 | 16 | */ |
| 17 | - abstract protected function createDmsTable(string $tableName, ConnectionInterface $connection): DmsTableInterface; |
|
| 17 | + abstract protected function createDmsTable (string $tableName, ConnectionInterface $connection): DmsTableInterface; |
|
| 18 | 18 | |
| 19 | 19 | /** |
| 20 | 20 | * @param string $name |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | * |
| 27 | 27 | * @return DmsColumnInterface |
| 28 | 28 | */ |
| 29 | - abstract protected function createDmsColumn( |
|
| 29 | + abstract protected function createDmsColumn ( |
|
| 30 | 30 | string $name, |
| 31 | 31 | string $type, |
| 32 | 32 | bool $nullable, |