@@ -36,9 +36,9 @@ discard block |
||
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |
39 | - * @param string $databaseDir |
|
40 | - * @return void |
|
41 | - */ |
|
39 | + * @param string $databaseDir |
|
40 | + * @return void |
|
41 | + */ |
|
42 | 42 | private static function createDatabaseDir(string $databaseDir) |
43 | 43 | { |
44 | 44 | if (!is_dir($databaseDir)) { |
@@ -47,9 +47,9 @@ discard block |
||
47 | 47 | } |
48 | 48 | |
49 | 49 | /** |
50 | - * @param string $dbFile |
|
51 | - * @return void |
|
52 | - */ |
|
50 | + * @param string $dbFile |
|
51 | + * @return void |
|
52 | + */ |
|
53 | 53 | private static function createDatabaseFile(string $dbFile) |
54 | 54 | { |
55 | 55 | if (!file_exists($dbFile)) { |
@@ -58,9 +58,9 @@ discard block |
||
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
61 | - * @param string $database |
|
62 | - * @return string |
|
63 | - */ |
|
61 | + * @param string $database |
|
62 | + * @return string |
|
63 | + */ |
|
64 | 64 | private static function checkExtension(string $database) |
65 | 65 | { |
66 | 66 | if (strpos($database, '.sqlite') === false) { |
@@ -18,8 +18,8 @@ discard block |
||
18 | 18 | } |
19 | 19 | |
20 | 20 | /** |
21 | - * @return string|false |
|
22 | - */ |
|
21 | + * @return string|false |
|
22 | + */ |
|
23 | 23 | public function toJson() |
24 | 24 | { |
25 | 25 | return json_encode( |
@@ -31,24 +31,24 @@ discard block |
||
31 | 31 | } |
32 | 32 | |
33 | 33 | /** |
34 | - * @return array |
|
35 | - */ |
|
34 | + * @return array |
|
35 | + */ |
|
36 | 36 | public function toArray() |
37 | 37 | { |
38 | 38 | return (array)$this->data; |
39 | 39 | } |
40 | 40 | |
41 | 41 | /** |
42 | - * @return string |
|
43 | - */ |
|
42 | + * @return string |
|
43 | + */ |
|
44 | 44 | public function toString() |
45 | 45 | { |
46 | 46 | return (string)$this->data; |
47 | 47 | } |
48 | 48 | |
49 | 49 | /** |
50 | - * @return object |
|
51 | - */ |
|
50 | + * @return object |
|
51 | + */ |
|
52 | 52 | public function toObject() |
53 | 53 | { |
54 | 54 | return (object)$this->data; |
@@ -23,49 +23,49 @@ discard block |
||
23 | 23 | } |
24 | 24 | |
25 | 25 | /** |
26 | - * @return void |
|
27 | - */ |
|
26 | + * @return void |
|
27 | + */ |
|
28 | 28 | public function info($message) |
29 | 29 | { |
30 | 30 | $this->log('INFO', $message); |
31 | 31 | } |
32 | 32 | |
33 | 33 | /** |
34 | - * @return void |
|
35 | - */ |
|
34 | + * @return void |
|
35 | + */ |
|
36 | 36 | public function warning($message) |
37 | 37 | { |
38 | 38 | $this->log('WARNING', $message); |
39 | 39 | } |
40 | 40 | |
41 | 41 | /** |
42 | - * @return void |
|
43 | - */ |
|
42 | + * @return void |
|
43 | + */ |
|
44 | 44 | public function error($message) |
45 | 45 | { |
46 | 46 | $this->log('ERROR', $message); |
47 | 47 | } |
48 | 48 | |
49 | 49 | /** |
50 | - * @return void |
|
51 | - */ |
|
50 | + * @return void |
|
51 | + */ |
|
52 | 52 | public function debug($message) |
53 | 53 | { |
54 | 54 | $this->log('DEBUG', $message); |
55 | 55 | } |
56 | 56 | |
57 | 57 | /** |
58 | - * @param mixed $level |
|
59 | - * @return string|int|false |
|
60 | - */ |
|
58 | + * @param mixed $level |
|
59 | + * @return string|int|false |
|
60 | + */ |
|
61 | 61 | private function shouldLog(mixed $level) |
62 | 62 | { |
63 | 63 | return array_search($level, $this->logLevels) >= array_search($this->logLevel, $this->logLevels); |
64 | 64 | } |
65 | 65 | |
66 | 66 | /** |
67 | - * @return void |
|
68 | - */ |
|
67 | + * @return void |
|
68 | + */ |
|
69 | 69 | private function rotateLog() |
70 | 70 | { |
71 | 71 | if (file_exists($this->logFile) && filesize($this->logFile) >= $this->maxFileSize) { |
@@ -75,10 +75,10 @@ discard block |
||
75 | 75 | } |
76 | 76 | |
77 | 77 | /** |
78 | - * @param mixed $level |
|
79 | - * @param string $message |
|
80 | - * @return void |
|
81 | - */ |
|
78 | + * @param mixed $level |
|
79 | + * @param string $message |
|
80 | + * @return void |
|
81 | + */ |
|
82 | 82 | private function log($level, $message) |
83 | 83 | { |
84 | 84 | if (!$this->shouldLog($level)) { |
@@ -24,10 +24,10 @@ discard block |
||
24 | 24 | } |
25 | 25 | } |
26 | 26 | |
27 | - /** |
|
28 | - * @param array $options |
|
29 | - * @return array |
|
30 | - */ |
|
27 | + /** |
|
28 | + * @param array $options |
|
29 | + * @return array |
|
30 | + */ |
|
31 | 31 | public static function mergeCacheData($cacheData) |
32 | 32 | { |
33 | 33 | if (is_array($cacheData) && is_array(reset($cacheData))) { |
@@ -40,21 +40,21 @@ discard block |
||
40 | 40 | return (array)$cacheData; |
41 | 41 | } |
42 | 42 | |
43 | - /** |
|
44 | - * @param mixed $currentCacheData |
|
45 | - * @param mixed $cacheData |
|
46 | - * @return array |
|
47 | - */ |
|
48 | - public static function arrayIdentifier(mixed $currentCacheData, mixed $cacheData) |
|
49 | - { |
|
43 | + /** |
|
44 | + * @param mixed $currentCacheData |
|
45 | + * @param mixed $cacheData |
|
46 | + * @return array |
|
47 | + */ |
|
48 | + public static function arrayIdentifier(mixed $currentCacheData, mixed $cacheData) |
|
49 | + { |
|
50 | 50 | if (is_array($currentCacheData) && is_array($cacheData)) { |
51 | - $mergedCacheData = array_merge($currentCacheData, $cacheData); |
|
51 | + $mergedCacheData = array_merge($currentCacheData, $cacheData); |
|
52 | 52 | } else { |
53 | - $mergedCacheData = array_merge((array)$currentCacheData, (array)$cacheData); |
|
53 | + $mergedCacheData = array_merge((array)$currentCacheData, (array)$cacheData); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | return $mergedCacheData; |
57 | - } |
|
57 | + } |
|
58 | 58 | |
59 | 59 | } |
60 | 60 |
@@ -46,13 +46,13 @@ |
||
46 | 46 | private string $lastFlushTimeFile; |
47 | 47 | |
48 | 48 | /** |
49 | - * @var CacheLogger |
|
50 | - */ |
|
49 | + * @var CacheLogger |
|
50 | + */ |
|
51 | 51 | private $logger = null; |
52 | 52 | |
53 | 53 | /** |
54 | - * @var FileCacheManager |
|
55 | - */ |
|
54 | + * @var FileCacheManager |
|
55 | + */ |
|
56 | 56 | private FileCacheManager $fileManager; |
57 | 57 | |
58 | 58 | public function __construct(array $options = []) |
@@ -13,8 +13,8 @@ |
||
13 | 13 | class MigrationManager |
14 | 14 | { |
15 | 15 | /** |
16 | - * @return void |
|
17 | - */ |
|
16 | + * @return void |
|
17 | + */ |
|
18 | 18 | public static function migrate(PDO $connection) |
19 | 19 | { |
20 | 20 | $driver = $connection->getAttribute(PDO::ATTR_DRIVER_NAME); |
@@ -7,32 +7,32 @@ |
||
7 | 7 | class CacheDatabaseException extends BaseException |
8 | 8 | { |
9 | 9 | |
10 | - /** @param string $before */ |
|
11 | - private static string $before = "<Database Cache Store Exception>"; |
|
12 | - |
|
13 | - /** |
|
14 | - * @return void |
|
15 | - */ |
|
16 | - public static function create(string $message = "", int $code = 0, ?Exception $previous = null, array $details = []) |
|
17 | - { |
|
10 | + /** @param string $before */ |
|
11 | + private static string $before = "<Database Cache Store Exception>"; |
|
12 | + |
|
13 | + /** |
|
14 | + * @return void |
|
15 | + */ |
|
16 | + public static function create(string $message = "", int $code = 0, ?Exception $previous = null, array $details = []) |
|
17 | + { |
|
18 | 18 | return new self(self::getBefore() . ": " .$message, $code, $previous, $details); |
19 | - } |
|
19 | + } |
|
20 | 20 | |
21 | 21 | |
22 | - /** |
|
23 | - * @return string |
|
24 | - */ |
|
25 | - public static function getBefore() |
|
26 | - { |
|
22 | + /** |
|
23 | + * @return string |
|
24 | + */ |
|
25 | + public static function getBefore() |
|
26 | + { |
|
27 | 27 | return self::$before; |
28 | - } |
|
28 | + } |
|
29 | 29 | |
30 | - /** |
|
31 | - * @return void |
|
32 | - */ |
|
33 | - public static function setBefore(string $text) |
|
34 | - { |
|
30 | + /** |
|
31 | + * @return void |
|
32 | + */ |
|
33 | + public static function setBefore(string $text) |
|
34 | + { |
|
35 | 35 | self::$before = $text; |
36 | - } |
|
36 | + } |
|
37 | 37 | |
38 | 38 | } |
@@ -7,31 +7,31 @@ |
||
7 | 7 | class ConnectionException extends BaseException |
8 | 8 | { |
9 | 9 | |
10 | - /** @param string $before */ |
|
11 | - private static string $before = "<Connection Exception>"; |
|
12 | - |
|
13 | - /** |
|
14 | - * @return void |
|
15 | - */ |
|
16 | - public static function create(string $message = "", int $code = 0, ?Exception $previous = null, array $details = []) |
|
17 | - { |
|
10 | + /** @param string $before */ |
|
11 | + private static string $before = "<Connection Exception>"; |
|
12 | + |
|
13 | + /** |
|
14 | + * @return void |
|
15 | + */ |
|
16 | + public static function create(string $message = "", int $code = 0, ?Exception $previous = null, array $details = []) |
|
17 | + { |
|
18 | 18 | return new self(self::getBefore() . ": " .$message, $code, $previous, $details); |
19 | - } |
|
19 | + } |
|
20 | 20 | |
21 | - /** |
|
22 | - * @return string |
|
23 | - */ |
|
24 | - public static function getBefore() |
|
25 | - { |
|
21 | + /** |
|
22 | + * @return string |
|
23 | + */ |
|
24 | + public static function getBefore() |
|
25 | + { |
|
26 | 26 | return self::$before; |
27 | - } |
|
27 | + } |
|
28 | 28 | |
29 | - /** |
|
30 | - * @return void |
|
31 | - */ |
|
32 | - public static function setBefore(string $text) |
|
33 | - { |
|
29 | + /** |
|
30 | + * @return void |
|
31 | + */ |
|
32 | + public static function setBefore(string $text) |
|
33 | + { |
|
34 | 34 | self::$before = $text; |
35 | - } |
|
35 | + } |
|
36 | 36 | |
37 | 37 | } |
@@ -7,33 +7,33 @@ |
||
7 | 7 | class CacheFileException extends BaseException |
8 | 8 | { |
9 | 9 | |
10 | - /** @param string $before */ |
|
11 | - private static string $before = "<File Cache Store Exception>"; |
|
12 | - |
|
13 | - /** |
|
14 | - * @return void |
|
15 | - */ |
|
16 | - public static function create(string $message = "", int $code = 0, ?Exception $previous = null, array $details = []) |
|
17 | - { |
|
10 | + /** @param string $before */ |
|
11 | + private static string $before = "<File Cache Store Exception>"; |
|
12 | + |
|
13 | + /** |
|
14 | + * @return void |
|
15 | + */ |
|
16 | + public static function create(string $message = "", int $code = 0, ?Exception $previous = null, array $details = []) |
|
17 | + { |
|
18 | 18 | return new self(self::getBefore() . ": " .$message, $code, $previous, $details); |
19 | - } |
|
19 | + } |
|
20 | 20 | |
21 | 21 | |
22 | - /** |
|
23 | - * @return string |
|
24 | - */ |
|
25 | - public static function getBefore() |
|
26 | - { |
|
22 | + /** |
|
23 | + * @return string |
|
24 | + */ |
|
25 | + public static function getBefore() |
|
26 | + { |
|
27 | 27 | return self::$before; |
28 | - } |
|
28 | + } |
|
29 | 29 | |
30 | - /** |
|
31 | - * @return void |
|
32 | - */ |
|
33 | - public static function setBefore(string $text) |
|
34 | - { |
|
30 | + /** |
|
31 | + * @return void |
|
32 | + */ |
|
33 | + public static function setBefore(string $text) |
|
34 | + { |
|
35 | 35 | self::$before = $text; |
36 | - } |
|
36 | + } |
|
37 | 37 | |
38 | 38 | } |
39 | 39 |