@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | $this->matchedRoutes = $this->findMatches($uri); |
| 98 | 98 | |
| 99 | 99 | if (empty($this->matchedRoutes)) { |
| 100 | - stop(function () { |
|
| 100 | + stop(function() { |
|
| 101 | 101 | page_not_found(); |
| 102 | 102 | }); |
| 103 | 103 | } |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | $routePattern = '(\/)?'; |
| 218 | 218 | $routeParams = []; |
| 219 | 219 | |
| 220 | - $lastIndex = (int)array_key_last($routeSegments); |
|
| 220 | + $lastIndex = (int) array_key_last($routeSegments); |
|
| 221 | 221 | |
| 222 | 222 | foreach ($routeSegments as $index => $segment) { |
| 223 | 223 | $segmentParam = $this->getSegmentParam($segment, $index, $lastIndex); |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | { |
| 66 | 66 | $this->isEnabled = filter_var(config()->get('multilang'), FILTER_VALIDATE_BOOLEAN); |
| 67 | 67 | |
| 68 | - $langSegmentIndex = (int)config()->get(Lang::LANG_SEGMENT); |
|
| 68 | + $langSegmentIndex = (int) config()->get(Lang::LANG_SEGMENT); |
|
| 69 | 69 | |
| 70 | 70 | if (!empty(route_prefix()) && $langSegmentIndex == 1) { |
| 71 | 71 | $langSegmentIndex++; |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | throw LangException::misconfiguredDefaultConfig(); |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | - if (empty($lang) || !in_array($lang, (array)config()->get('langs'))) { |
|
| 80 | + if (empty($lang) || !in_array($lang, (array) config()->get('langs'))) { |
|
| 81 | 81 | $lang = config()->get('lang_default'); |
| 82 | 82 | } |
| 83 | 83 | |
@@ -79,7 +79,7 @@ |
||
| 79 | 79 | */ |
| 80 | 80 | public function data(): array |
| 81 | 81 | { |
| 82 | - return array_map(function ($element) { |
|
| 82 | + return array_map(function($element) { |
|
| 83 | 83 | $item = clone $this->dbal; |
| 84 | 84 | $item->setData($element); |
| 85 | 85 | $item->setModifiedFields($element); |
@@ -24,66 +24,66 @@ |
||
| 24 | 24 | */ |
| 25 | 25 | class Paginator extends BasePaginator |
| 26 | 26 | { |
| 27 | - /** |
|
| 28 | - * @var IdiormDbal |
|
| 29 | - */ |
|
| 30 | - private $dbal; |
|
| 27 | + /** |
|
| 28 | + * @var IdiormDbal |
|
| 29 | + */ |
|
| 30 | + private $dbal; |
|
| 31 | 31 | |
| 32 | - /** |
|
| 33 | - * @var array|IdiormResultSet |
|
| 34 | - */ |
|
| 35 | - public $data; |
|
| 32 | + /** |
|
| 33 | + * @var array|IdiormResultSet |
|
| 34 | + */ |
|
| 35 | + public $data; |
|
| 36 | 36 | |
| 37 | - /** |
|
| 38 | - * @param $idiormDbal |
|
| 39 | - * @param int $perPage |
|
| 40 | - * @param int $page |
|
| 41 | - * @throws DatabaseException |
|
| 42 | - */ |
|
| 43 | - public function __construct($idiormDbal, int $perPage, int $page = 1) |
|
| 44 | - { |
|
| 45 | - $this->total = $idiormDbal->getOrmModel()->count(); |
|
| 46 | - $this->dbal = $idiormDbal; |
|
| 47 | - $this->dbal->limit($perPage)->offset($perPage * ($page - 1)); |
|
| 48 | - $this->data = $this->dbal->getOrmModel()->find_many(); |
|
| 49 | - $this->perPage = $perPage; |
|
| 50 | - $this->page = $page; |
|
| 51 | - $this->baseUrl = base_dir(); |
|
| 52 | - } |
|
| 37 | + /** |
|
| 38 | + * @param $idiormDbal |
|
| 39 | + * @param int $perPage |
|
| 40 | + * @param int $page |
|
| 41 | + * @throws DatabaseException |
|
| 42 | + */ |
|
| 43 | + public function __construct($idiormDbal, int $perPage, int $page = 1) |
|
| 44 | + { |
|
| 45 | + $this->total = $idiormDbal->getOrmModel()->count(); |
|
| 46 | + $this->dbal = $idiormDbal; |
|
| 47 | + $this->dbal->limit($perPage)->offset($perPage * ($page - 1)); |
|
| 48 | + $this->data = $this->dbal->getOrmModel()->find_many(); |
|
| 49 | + $this->perPage = $perPage; |
|
| 50 | + $this->page = $page; |
|
| 51 | + $this->baseUrl = base_dir(); |
|
| 52 | + } |
|
| 53 | 53 | |
| 54 | - /** |
|
| 55 | - * @inheritDoc |
|
| 56 | - */ |
|
| 57 | - public function firstItem() |
|
| 58 | - { |
|
| 59 | - if (!is_array($this->data)){ |
|
| 60 | - $this->data = $this->data->as_array(); |
|
| 61 | - } |
|
| 54 | + /** |
|
| 55 | + * @inheritDoc |
|
| 56 | + */ |
|
| 57 | + public function firstItem() |
|
| 58 | + { |
|
| 59 | + if (!is_array($this->data)){ |
|
| 60 | + $this->data = $this->data->as_array(); |
|
| 61 | + } |
|
| 62 | 62 | |
| 63 | - return $this->data[array_key_first($this->data)]; |
|
| 64 | - } |
|
| 63 | + return $this->data[array_key_first($this->data)]; |
|
| 64 | + } |
|
| 65 | 65 | |
| 66 | - /** |
|
| 67 | - * @inheritDoc |
|
| 68 | - */ |
|
| 69 | - public function lastItem() |
|
| 70 | - { |
|
| 71 | - if (!is_array($this->data)){ |
|
| 72 | - $this->data = $this->data->as_array(); |
|
| 73 | - } |
|
| 66 | + /** |
|
| 67 | + * @inheritDoc |
|
| 68 | + */ |
|
| 69 | + public function lastItem() |
|
| 70 | + { |
|
| 71 | + if (!is_array($this->data)){ |
|
| 72 | + $this->data = $this->data->as_array(); |
|
| 73 | + } |
|
| 74 | 74 | |
| 75 | - return $this->data[array_key_last($this->data)]; |
|
| 76 | - } |
|
| 75 | + return $this->data[array_key_last($this->data)]; |
|
| 76 | + } |
|
| 77 | 77 | |
| 78 | - /** |
|
| 79 | - * @inheritDoc |
|
| 80 | - */ |
|
| 81 | - public function data(): array |
|
| 78 | + /** |
|
| 79 | + * @inheritDoc |
|
| 80 | + */ |
|
| 81 | + public function data(): array |
|
| 82 | 82 | { |
| 83 | - if (!empty($this->data) && !is_array($this->data)){ |
|
| 84 | - $this->data = $this->data->as_array(); |
|
| 85 | - } |
|
| 83 | + if (!empty($this->data) && !is_array($this->data)){ |
|
| 84 | + $this->data = $this->data->as_array(); |
|
| 85 | + } |
|
| 86 | 86 | |
| 87 | - return $this->data ?? []; |
|
| 88 | - } |
|
| 87 | + return $this->data ?? []; |
|
| 88 | + } |
|
| 89 | 89 | } |
| 90 | 90 | \ No newline at end of file |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | */ |
| 57 | 57 | public function firstItem() |
| 58 | 58 | { |
| 59 | - if (!is_array($this->data)){ |
|
| 59 | + if (!is_array($this->data)) { |
|
| 60 | 60 | $this->data = $this->data->as_array(); |
| 61 | 61 | } |
| 62 | 62 | |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | */ |
| 69 | 69 | public function lastItem() |
| 70 | 70 | { |
| 71 | - if (!is_array($this->data)){ |
|
| 71 | + if (!is_array($this->data)) { |
|
| 72 | 72 | $this->data = $this->data->as_array(); |
| 73 | 73 | } |
| 74 | 74 | |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | */ |
| 81 | 81 | public function data(): array |
| 82 | 82 | { |
| 83 | - if (!empty($this->data) && !is_array($this->data)){ |
|
| 83 | + if (!empty($this->data) && !is_array($this->data)) { |
|
| 84 | 84 | $this->data = $this->data->as_array(); |
| 85 | 85 | } |
| 86 | 86 | |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | if (config()->get('debug')) { |
| 86 | 86 | $this->mailer->SMTPDebug = SMTP::DEBUG_SERVER; |
| 87 | 87 | |
| 88 | - $this->mailer->Debugoutput = function ($message) { |
|
| 88 | + $this->mailer->Debugoutput = function($message) { |
|
| 89 | 89 | warning($message, ['tab' => Debugger::MAILS]); |
| 90 | 90 | }; |
| 91 | 91 | } |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | */ |
| 188 | 188 | public function setAttachment(string $attachment): SmtpAdapter |
| 189 | 189 | { |
| 190 | - $this->attachments[] = $attachment;; |
|
| 190 | + $this->attachments[] = $attachment; ; |
|
| 191 | 191 | return $this; |
| 192 | 192 | } |
| 193 | 193 | |