11<?php
2-
32declare (strict_types=1 );
43
54/**
3534 * @method \DebugKit\Model\Entity\Request[] patchEntities($entities, array $data, array $options = [])
3635 * @method \DebugKit\Model\Entity\Request findOrCreate($search, callable $callback = null, array $options = [])
3736 */
38- class RequestsTable extends Table {
37+ class RequestsTable extends Table
38+ {
3939 use LazyTableTrait;
4040 use SqlTraceTrait;
4141
@@ -45,7 +45,8 @@ class RequestsTable extends Table {
4545 * @param array $config Config data.
4646 * @return void
4747 */
48- public function initialize (array $ config ): void {
48+ public function initialize (array $ config ): void
49+ {
4950 $ this ->hasMany ('DebugKit.Panels ' , [
5051 'sort ' => ['Panels.title ' => 'ASC ' ],
5152 ]);
@@ -62,7 +63,8 @@ public function initialize(array $config): void {
6263 *
6364 * @return string
6465 */
65- public static function defaultConnectionName (): string {
66+ public static function defaultConnectionName (): string
67+ {
6668 return 'debug_kit ' ;
6769 }
6870
@@ -72,7 +74,8 @@ public static function defaultConnectionName(): string {
7274 * @param \Cake\ORM\Query\SelectQuery $query The query
7375 * @return \Cake\ORM\Query\SelectQuery The query.
7476 */
75- public function findRecent (SelectQuery $ query ): SelectQuery {
77+ public function findRecent (SelectQuery $ query ): SelectQuery
78+ {
7679 return $ query ->orderBy (['Requests.requested_at ' => 'DESC ' ])
7780 ->limit (10 );
7881 }
@@ -82,7 +85,8 @@ public function findRecent(SelectQuery $query): SelectQuery {
8285 *
8386 * @return bool
8487 */
85- protected function shouldGc (): bool {
88+ protected function shouldGc (): bool
89+ {
8690 return rand (1 , 10 ) === 10 ;
8791 }
8892
@@ -91,7 +95,8 @@ protected function shouldGc(): bool {
9195 *
9296 * @return bool
9397 */
94- protected function shouldGcVacuum (): bool {
98+ protected function shouldGcVacuum (): bool
99+ {
95100 return rand (1 , 10 ) === 10 ;
96101 }
97102
@@ -104,7 +109,8 @@ protected function shouldGcVacuum(): bool {
104109 *
105110 * @return void
106111 */
107- public function gc (): void {
112+ public function gc (): void
113+ {
108114 if (!$ this ->shouldGc ()) {
109115 return ;
110116 }
0 commit comments