Passed
Branch main (457442)
by Sílvio
03:14
created
Examples/example08.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -23,15 +23,15 @@
 block discarded – undo
23 23
     echo "Cache Found: ";
24 24
     print_r($Cacheer->getCache($cacheKey));
25 25
 } else {
26
-  echo $Cacheer->getMessage();
26
+    echo $Cacheer->getMessage();
27 27
 }
28 28
 
29 29
 // Renovando os dados do cache
30 30
 $Cacheer->renewCache($cacheKey, 3600);
31 31
 
32 32
 if($Cacheer->isSuccess()){
33
-  echo $Cacheer->getMessage() . PHP_EOL;
33
+    echo $Cacheer->getMessage() . PHP_EOL;
34 34
 } else {
35
-  echo $Cacheer->getMessage() . PHP_EOL;
35
+    echo $Cacheer->getMessage() . PHP_EOL;
36 36
 
37 37
 }
38 38
\ No newline at end of file
Please login to merge, or discard this patch.
Examples/example07.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
     echo "Cache Found: ";
30 30
     print_r($Cacheer->getCache($cacheKey));
31 31
 } else {
32
-  echo $Cacheer->getMessage();
32
+    echo $Cacheer->getMessage();
33 33
 }
34 34
 
35 35
 
@@ -40,6 +40,6 @@  discard block
 block discarded – undo
40 40
     echo $Cacheer->getMessage() . PHP_EOL;
41 41
     print_r($Cacheer->getCache($cacheKey));
42 42
 } else {
43
-  echo $Cacheer->getMessage();
43
+    echo $Cacheer->getMessage();
44 44
 }
45 45
 
Please login to merge, or discard this patch.
tests/Unit/ArrayCacheStoreTest.php 1 patch
Indentation   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -7,40 +7,40 @@  discard block
 block discarded – undo
7 7
 class ArrayCacheStoreTest extends TestCase
8 8
 {
9 9
 
10
-  private $cache;
10
+    private $cache;
11 11
 
12
-  protected function setUp(): void
13
-  {
12
+    protected function setUp(): void
13
+    {
14 14
     $this->cache = new Cacheer();
15 15
     $this->cache->setDriver()->useArrayDriver();
16 16
     $this->cache->setConfig()->setTimeZone('America/Toronto');
17
-  }
17
+    }
18 18
 
19
-  protected function tearDown(): void
20
-  {
19
+    protected function tearDown(): void
20
+    {
21 21
     $this->cache->flushCache();
22
-  }
22
+    }
23 23
 
24 24
     public function testUsingArrayDriverSetsProperInstance()
25
-  {
25
+    {
26 26
     $this->assertInstanceOf(ArrayCacheStore::class, $this->cache->cacheStore);
27
-  }
27
+    }
28 28
 
29
-  public function testPutAndGetCacheInArray()
30
-  {
31
-      $cacheKey = 'test_key';
32
-      $cacheData = ['name' => 'John Doe', 'email' => '[email protected]'];
29
+    public function testPutAndGetCacheInArray()
30
+    {
31
+        $cacheKey = 'test_key';
32
+        $cacheData = ['name' => 'John Doe', 'email' => '[email protected]'];
33 33
       
34
-      $this->cache->putCache($cacheKey, $cacheData, '', 3600);
34
+        $this->cache->putCache($cacheKey, $cacheData, '', 3600);
35 35
 
36
-      $result = $this->cache->getCache($cacheKey);
36
+        $result = $this->cache->getCache($cacheKey);
37 37
 
38
-      $this->assertNotEmpty($result);
39
-      $this->assertEquals($cacheData, $result);
40
-  }
38
+        $this->assertNotEmpty($result);
39
+        $this->assertEquals($cacheData, $result);
40
+    }
41 41
 
42
-  public function testExpiredCacheInArray()
43
-  {
42
+    public function testExpiredCacheInArray()
43
+    {
44 44
     $cacheKey = 'expired_key';
45 45
     $cacheData = ['name' => 'Expired User', 'email' => '[email protected]'];
46 46
 
@@ -50,11 +50,11 @@  discard block
 block discarded – undo
50 50
     $this->assertEquals("Cache stored successfully", $this->cache->getMessage());
51 51
     $this->assertEmpty($this->cache->getCache($cacheKey));
52 52
     $this->assertFalse($this->cache->isSuccess());
53
-  }
53
+    }
54 54
 
55 55
 
56
-  public function testOverwriteExistingCacheInArray()
57
-  {
56
+    public function testOverwriteExistingCacheInArray()
57
+    {
58 58
     $cacheKey = 'overwrite_key';
59 59
     $initialCacheData = ['name' => 'Initial Data', 'email' => '[email protected]'];
60 60
     $newCacheData = ['name' => 'New Data', 'email' => '[email protected]'];
@@ -65,12 +65,12 @@  discard block
 block discarded – undo
65 65
     $this->cache->appendCache($cacheKey, $newCacheData);
66 66
     $this->assertEquals("Cache appended successfully", $this->cache->getMessage());
67 67
     $this->assertEquals($newCacheData, $this->cache->getCache($cacheKey));
68
-  }
68
+    }
69 69
 
70 70
 
71
-  public function testPutManyCacheItemsInArray()
72
-  {
73
-     $items = [
71
+    public function testPutManyCacheItemsInArray()
72
+    {
73
+        $items = [
74 74
             [
75 75
                 'cacheKey' => 'user_1_profile',
76 76
                 'cacheData' => [
@@ -96,10 +96,10 @@  discard block
 block discarded – undo
96 96
           
97 97
             $this->assertEquals($item['cacheData'], $this->cache->getCache($item['cacheKey']));
98 98
         }
99
-  }
99
+    }
100 100
 
101
-  public function testHasCacheFromArray()
102
-  {
101
+    public function testHasCacheFromArray()
102
+    {
103 103
     $cacheKey = 'test_key';
104 104
     $cacheData = ['name' => 'Sílvio Silva', 'role' => 'Developer'];
105 105
 
@@ -110,10 +110,10 @@  discard block
 block discarded – undo
110 110
 
111 111
     $this->cache->has($cacheKey);
112 112
     $this->assertTrue($this->cache->isSuccess());
113
-  }
113
+    }
114 114
 
115 115
     public function testRenewCacheFromArray()
116
-  {
116
+    {
117 117
     $cacheKey = 'expired_key';
118 118
     $cacheData = ['name' => 'Expired User', 'email' => '[email protected]'];
119 119
 
@@ -128,10 +128,10 @@  discard block
 block discarded – undo
128 128
     $this->cache->renewCache($cacheKey, 7200);
129 129
     $this->assertTrue($this->cache->isSuccess());
130 130
     $this->assertNotEmpty($this->cache->getCache($cacheKey));
131
-  }
131
+    }
132 132
 
133
-      public function testRenewCacheWithNamespaceFromArray()
134
-  {
133
+        public function testRenewCacheWithNamespaceFromArray()
134
+    {
135 135
     $cacheKey = 'expired_key';
136 136
     $namespace = 'expired_namespace';
137 137
     $cacheData = ['name' => 'Expired User', 'email' => '[email protected]'];
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
     $this->cache->renewCache($cacheKey, 7200, $namespace);
146 146
     $this->assertTrue($this->cache->isSuccess());
147 147
     $this->assertNotEmpty($this->cache->getCache($cacheKey, $namespace));
148
-  }
148
+    }
149 149
 
150 150
     public function testClearCacheDataFromArray()
151 151
     {
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
         $this->assertEquals("Cache flushed successfully", $this->cache->getMessage());
182 182
     }
183 183
 
184
-  public function test_remember_saves_and_recover_values() 
184
+    public function test_remember_saves_and_recover_values() 
185 185
     {
186 186
         $this->cache->flushCache();
187 187
 
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
     }
217 217
 
218 218
 
219
-      public function test_get_and_forget()
219
+        public function test_get_and_forget()
220 220
     {
221 221
         $cacheKey = 'cache_key_test';
222 222
         $this->cache->putCache($cacheKey, 10);
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
         $this->assertNull($noCacheData);
238 238
     }
239 239
 
240
-      public function test_store_if_not_present_with_add_function()
240
+        public function test_store_if_not_present_with_add_function()
241 241
     {
242 242
         $existentKey = 'cache_key_test';
243 243
 
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
 
262 262
     }
263 263
 
264
-      public function test_increment_function() {
264
+        public function test_increment_function() {
265 265
 
266 266
         $cacheKey = 'test_increment';
267 267
         $cacheData = 2025;
Please login to merge, or discard this patch.
src/CacheStore/CacheManager/FileCacheManager.php 1 patch
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -15,9 +15,9 @@  discard block
 block discarded – undo
15 15
 {
16 16
 
17 17
     /**
18
-    * @param string $dir
19
-    * @return void
20
-    */
18
+     * @param string $dir
19
+     * @return void
20
+     */
21 21
     public function createDirectory(string $dir)
22 22
     {
23 23
         if ((!file_exists($dir) || !is_dir($dir)) && !mkdir($dir, 0755, true)) {
@@ -26,10 +26,10 @@  discard block
 block discarded – undo
26 26
     }
27 27
 
28 28
     /**
29
-    * @param string $filename
30
-    * @param string $data
31
-    * @return void
32
-    */
29
+     * @param string $filename
30
+     * @param string $data
31
+     * @return void
32
+     */
33 33
     public function writeFile(string $filename, string $data)
34 34
     {
35 35
         if (!@file_put_contents($filename, $data, LOCK_EX)) {
@@ -38,9 +38,9 @@  discard block
 block discarded – undo
38 38
     }
39 39
 
40 40
     /**
41
-    * @param string $filename
42
-    * @return string
43
-    */
41
+     * @param string $filename
42
+     * @return string
43
+     */
44 44
     public function readFile(string $filename)
45 45
     {
46 46
         if (!$this->fileExists($filename)) {
@@ -50,18 +50,18 @@  discard block
 block discarded – undo
50 50
     }
51 51
 
52 52
     /**
53
-    * @param string $filename
54
-    * @return bool
55
-    */
53
+     * @param string $filename
54
+     * @return bool
55
+     */
56 56
     public function fileExists(string $filename)
57 57
     {
58 58
         return file_exists($filename);
59 59
     }
60 60
 
61 61
     /**
62
-    * @param string $filename
63
-    * @return void
64
-    */
62
+     * @param string $filename
63
+     * @return void
64
+     */
65 65
     public function removeFile(string $filename)
66 66
     {
67 67
         if (file_exists($filename)) {
@@ -70,9 +70,9 @@  discard block
 block discarded – undo
70 70
     }
71 71
 
72 72
     /**
73
-    * @param string $dir
74
-    * @return void
75
-    */
73
+     * @param string $dir
74
+     * @return void
75
+     */
76 76
     public function clearDirectory(string $dir)
77 77
     {
78 78
         $iterator = new RecursiveIteratorIterator(
@@ -86,9 +86,9 @@  discard block
 block discarded – undo
86 86
     }
87 87
 
88 88
     /**
89
-    * @param mixed $data
90
-    * @param bool $serialize
91
-    */
89
+     * @param mixed $data
90
+     * @param bool $serialize
91
+     */
92 92
     public function serialize(mixed $data, bool $serialize = true)
93 93
     {
94 94
         if($serialize) {
Please login to merge, or discard this patch.
src/Exceptions/CacheFileException.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
58 58
      */
59 59
     public function toJson(int $options = 0)
60 60
     {
61
-      return parent::toJson($options);
61
+        return parent::toJson($options);
62 62
     }
63 63
 }
64 64
 
Please login to merge, or discard this patch.
tests/Feature/OptionBuildTest.php 1 patch
Indentation   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -7,26 +7,26 @@  discard block
 block discarded – undo
7 7
 class OptionBuildTest extends TestCase
8 8
 {
9 9
 
10
-  private $cache;
11
-  private $cacheDir;
10
+    private $cache;
11
+    private $cacheDir;
12 12
 
13
-  protected function setUp(): void
14
-  {
13
+    protected function setUp(): void
14
+    {
15 15
     $this->cacheDir = __DIR__ . '/cache';
16 16
     if (!file_exists($this->cacheDir) || !is_dir($this->cacheDir)) {
17
-      mkdir($this->cacheDir, 0755, true);
17
+        mkdir($this->cacheDir, 0755, true);
18 18
     }
19 19
 
20 20
     $this->cache = new Cacheer();
21
-  }
21
+    }
22 22
 
23
-  protected function tearDown(): void
24
-  {
23
+    protected function tearDown(): void
24
+    {
25 25
     $this->cache->flushCache();
26
-  }
26
+    }
27 27
 
28
-  public function test_it_can_set_cache_directory()
29
-  {
28
+    public function test_it_can_set_cache_directory()
29
+    {
30 30
     $cacheDir = __DIR__ . "/cache";
31 31
 
32 32
     $options = OptionBuilder::forFile()
@@ -35,23 +35,23 @@  discard block
 block discarded – undo
35 35
 
36 36
     $this->assertArrayHasKey('cacheDir', $options);
37 37
     $this->assertEquals($cacheDir, $options['cacheDir']);
38
-  }
38
+    }
39 39
 
40 40
 
41
-  public function test_it_can_set_expiration_time()
41
+    public function test_it_can_set_expiration_time()
42 42
     {
43 43
 
44
-      $options = OptionBuilder::forFile()
45
-      ->expirationTime('2 hours')
46
-      ->build();
44
+        $options = OptionBuilder::forFile()
45
+        ->expirationTime('2 hours')
46
+        ->build();
47 47
       
48
-      $this->assertArrayHasKey('expirationTime', $options);
49
-      $this->assertEquals('2 hours', $options['expirationTime']);
48
+        $this->assertArrayHasKey('expirationTime', $options);
49
+        $this->assertEquals('2 hours', $options['expirationTime']);
50 50
     }
51 51
 
52 52
     public function test_it_can_set_flush_after()
53 53
     {
54
-      $options = OptionBuilder::forFile()
54
+        $options = OptionBuilder::forFile()
55 55
         ->flushAfter('11 seconds')
56 56
         ->build();
57 57
 
@@ -61,9 +61,9 @@  discard block
 block discarded – undo
61 61
 
62 62
     public function test_it_can_set_multiple_options_together()
63 63
     {
64
-      $cacheDir = __DIR__ . "/cache";
64
+        $cacheDir = __DIR__ . "/cache";
65 65
 
66
-      $options = OptionBuilder::forFile()
66
+        $options = OptionBuilder::forFile()
67 67
             ->dir($cacheDir)
68 68
             ->expirationTime('1 day')
69 69
             ->flushAfter('30 minutes')
@@ -76,41 +76,41 @@  discard block
 block discarded – undo
76 76
         ], $options);
77 77
     }
78 78
 
79
-  public function test_it_allows_setting_expiration_time_with_timebuilder()
79
+    public function test_it_allows_setting_expiration_time_with_timebuilder()
80 80
     {
81
-      $options = OptionBuilder::forFile()->expirationTime()->week(1)->build();
82
-      $this->assertArrayHasKey('expirationTime', $options);
83
-      $this->assertEquals('1 weeks', $options['expirationTime']);
81
+        $options = OptionBuilder::forFile()->expirationTime()->week(1)->build();
82
+        $this->assertArrayHasKey('expirationTime', $options);
83
+        $this->assertEquals('1 weeks', $options['expirationTime']);
84 84
     }
85 85
 
86
-  public function test_it_allows_setting_flush_after_with_timebuilder()
87
-  {
86
+    public function test_it_allows_setting_flush_after_with_timebuilder()
87
+    {
88 88
     $options = OptionBuilder::forFile()->flushAfter()->second(10)->build();
89 89
     $this->assertArrayHasKey('flushAfter', $options);
90 90
     $this->assertEquals('10 seconds', $options['flushAfter']);
91
-  }
91
+    }
92 92
 
93
-  public function test_it_can_set_multiple_options_together_with_timebuilder()
94
-  {
93
+    public function test_it_can_set_multiple_options_together_with_timebuilder()
94
+    {
95 95
     $cacheDir = __DIR__ . "/cache";
96 96
     $options = OptionBuilder::forFile()
97
-          ->dir($cacheDir)
98
-          ->expirationTime()->week(1)
99
-          ->flushAfter()->minute(10)
100
-          ->build();
97
+            ->dir($cacheDir)
98
+            ->expirationTime()->week(1)
99
+            ->flushAfter()->minute(10)
100
+            ->build();
101 101
 
102 102
     $this->assertEquals([
103 103
             'cacheDir' => $cacheDir,
104 104
             'expirationTime' => '1 weeks',
105 105
             'flushAfter' => '10 minutes',
106 106
         ], $options);
107
-  }
107
+    }
108 108
 
109
-  public function test_it_returns_empty_array_when_no_options_are_set()
110
-  {
109
+    public function test_it_returns_empty_array_when_no_options_are_set()
110
+    {
111 111
     $options = OptionBuilder::forFile()->build();
112 112
     $this->assertIsArray($options);
113 113
     $this->assertEmpty($options);
114
-  }
114
+    }
115 115
 
116 116
 }
Please login to merge, or discard this patch.
tests/Unit/RedisCacheStoreTest.php 1 patch
Indentation   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -7,27 +7,27 @@  discard block
 block discarded – undo
7 7
 class RedisCacheStoreTest extends TestCase
8 8
 {
9 9
 
10
-  /** @var Cacheer */
11
-  private $cache;
10
+    /** @var Cacheer */
11
+    private $cache;
12 12
 
13
-  protected function setUp(): void
14
-  {
13
+    protected function setUp(): void
14
+    {
15 15
     $this->cache = new Cacheer();
16 16
     $this->cache->setDriver()->useRedisDriver();
17
-  }
17
+    }
18 18
 
19
-  protected function tearDown(): void
20
-  {
19
+    protected function tearDown(): void
20
+    {
21 21
     $this->cache->flushCache();
22
-  }
22
+    }
23 23
 
24
-  public function testUsingRedisDriverSetsProperInstance()
25
-  {
24
+    public function testUsingRedisDriverSetsProperInstance()
25
+    {
26 26
     $this->assertInstanceOf(RedisCacheStore::class, $this->cache->cacheStore);
27
-  }
27
+    }
28 28
 
29
-  public function testPutCacheInRedis()
30
-  {
29
+    public function testPutCacheInRedis()
30
+    {
31 31
     $cacheKey = 'test_key';
32 32
     $cacheData = ['name' => 'Sílvio Silva', 'role' => 'Developer'];
33 33
 
@@ -37,10 +37,10 @@  discard block
 block discarded – undo
37 37
     $this->assertNotEmpty($this->cache->getCache($cacheKey));
38 38
     $this->assertEquals($cacheData, $this->cache->getCache($cacheKey));
39 39
 
40
-  }
40
+    }
41 41
 
42
-  public function testGetCacheFromRedis()
43
-  {
42
+    public function testGetCacheFromRedis()
43
+    {
44 44
     $cacheKey = 'test_key';
45 45
     $cacheData = ['name' => 'Sílvio Silva', 'role' => 'Developer'];
46 46
 
@@ -51,10 +51,10 @@  discard block
 block discarded – undo
51 51
     $data = $this->cache->getCache($cacheKey);
52 52
     $this->assertNotEmpty($data);
53 53
     $this->assertEquals($cacheData, $data);
54
-  }
54
+    }
55 55
 
56
-  public function testExpiredCacheInRedis()
57
-  {
56
+    public function testExpiredCacheInRedis()
57
+    {
58 58
     $cacheKey = 'expired_key';
59 59
     $cacheData = ['name' => 'Expired User', 'email' => '[email protected]'];
60 60
 
@@ -64,10 +64,10 @@  discard block
 block discarded – undo
64 64
     $this->assertEquals("Cache stored successfully", $this->cache->getMessage());
65 65
     $this->assertEmpty($this->cache->getCache($cacheKey));
66 66
     $this->assertFalse($this->cache->isSuccess());
67
-  }
67
+    }
68 68
 
69
-  public function testOverwriteExistingCacheInRedis()
70
-  {
69
+    public function testOverwriteExistingCacheInRedis()
70
+    {
71 71
     $cacheKey = 'overwrite_key';
72 72
     $initialCacheData = ['name' => 'Initial Data', 'email' => '[email protected]'];
73 73
     $newCacheData = ['name' => 'New Data', 'email' => '[email protected]'];
@@ -78,11 +78,11 @@  discard block
 block discarded – undo
78 78
     $this->cache->appendCache($cacheKey, $newCacheData);
79 79
     $this->assertEquals("Cache appended successfully", $this->cache->getMessage());
80 80
     $this->assertEquals($newCacheData, $this->cache->getCache($cacheKey));
81
-  }
81
+    }
82 82
 
83
-  public function testPutManyCacheItemsInRedis()
84
-  {
85
-     $items = [
83
+    public function testPutManyCacheItemsInRedis()
84
+    {
85
+        $items = [
86 86
             [
87 87
                 'cacheKey' => 'user_1_profile',
88 88
                 'cacheData' => [
@@ -107,9 +107,9 @@  discard block
 block discarded – undo
107 107
     foreach ($items as $item) {
108 108
             $this->assertEquals($item['cacheData'], $this->cache->getCache($item['cacheKey']));
109 109
         }
110
-  }
110
+    }
111 111
 
112
-      public function testAppendCacheWithNamespaceInRedis()
112
+        public function testAppendCacheWithNamespaceInRedis()
113 113
     {
114 114
         $cacheKey = 'test_append_key_ns';
115 115
         $namespace = 'test_namespace';
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
         $this->assertEquals($expectedData, $cachedData);
133 133
     }
134 134
 
135
-      public function testDataOutputShouldBeOfTypeArray()
135
+        public function testDataOutputShouldBeOfTypeArray()
136 136
     {
137 137
 
138 138
         $this->cache->useFormatter();
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
         $this->assertJson($cacheOutput);
179 179
     }
180 180
 
181
-      public function testClearCacheDataFromRedis()
181
+        public function testClearCacheDataFromRedis()
182 182
     {
183 183
         $cacheKey = 'test_key';
184 184
         $data = 'test_data';
@@ -193,8 +193,8 @@  discard block
 block discarded – undo
193 193
         $this->assertEmpty($this->cache->getCache($cacheKey));
194 194
     }
195 195
 
196
-  public function testFlushCacheDataFromRedis()
197
-  {
196
+    public function testFlushCacheDataFromRedis()
197
+    {
198 198
         $key1 = 'test_key1';
199 199
         $data1 = 'test_data1';
200 200
 
@@ -212,8 +212,8 @@  discard block
 block discarded – undo
212 212
         $this->assertEquals("Cache flushed successfully", $this->cache->getMessage());
213 213
     }
214 214
 
215
-  public function testHasCacheFromRedis()
216
-  {
215
+    public function testHasCacheFromRedis()
216
+    {
217 217
     $cacheKey = 'test_key';
218 218
     $cacheData = ['name' => 'Sílvio Silva', 'role' => 'Developer'];
219 219
 
@@ -221,10 +221,10 @@  discard block
 block discarded – undo
221 221
 
222 222
     $this->assertEquals("Cache stored successfully", $this->cache->getMessage());
223 223
     $this->assertTrue($this->cache->isSuccess());
224
-  }
224
+    }
225 225
 
226
-  public function testRenewCacheFromRedis()
227
-  {
226
+    public function testRenewCacheFromRedis()
227
+    {
228 228
     $cacheKey = 'expired_key';
229 229
     $cacheData = ['name' => 'Expired User', 'email' => '[email protected]'];
230 230
 
@@ -239,10 +239,10 @@  discard block
 block discarded – undo
239 239
     $this->cache->renewCache($cacheKey, 7200);
240 240
     $this->assertTrue($this->cache->isSuccess());
241 241
     $this->assertNotEmpty($this->cache->getCache($cacheKey));
242
-  }
242
+    }
243 243
 
244 244
     public function testRenewCacheWithNamespaceFromRedis()
245
-  {
245
+    {
246 246
     $cacheKey = 'expired_key';
247 247
     $namespace = 'expired_namespace';
248 248
     $cacheData = ['name' => 'Expired User', 'email' => '[email protected]'];
@@ -256,9 +256,9 @@  discard block
 block discarded – undo
256 256
     $this->cache->renewCache($cacheKey, 7200, $namespace);
257 257
     $this->assertTrue($this->cache->isSuccess());
258 258
     $this->assertNotEmpty($this->cache->getCache($cacheKey, $namespace));
259
-  }
259
+    }
260 260
 
261
-  public function test_remember_saves_and_recover_values() 
261
+    public function test_remember_saves_and_recover_values() 
262 262
     {
263 263
         $this->cache->flushCache();
264 264
 
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
     }
294 294
 
295 295
 
296
-      public function test_get_and_forget()
296
+        public function test_get_and_forget()
297 297
     {
298 298
         $cacheKey = 'cache_key_test';
299 299
         $this->cache->putCache($cacheKey, 10);
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
         $this->assertNull($noCacheData);
315 315
     }
316 316
 
317
-      public function test_store_if_not_present_with_add_function()
317
+        public function test_store_if_not_present_with_add_function()
318 318
     {
319 319
         $existentKey = 'cache_key_test';
320 320
 
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
 
339 339
     }
340 340
 
341
-      public function test_increment_function() {
341
+        public function test_increment_function() {
342 342
 
343 343
         $cacheKey = 'test_increment';
344 344
         $cacheData = 2025;
Please login to merge, or discard this patch.
src/Core/Connect.php 1 patch
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -14,27 +14,27 @@  discard block
 block discarded – undo
14 14
 class Connect
15 15
 {
16 16
     /**
17
-    * The default connection type.
18
-    * Currently, it supports 'mysql', 'sqlite', and 'pgsql'.
19
-    *
20
-    * @var string
21
-    */
17
+     * The default connection type.
18
+     * Currently, it supports 'mysql', 'sqlite', and 'pgsql'.
19
+     *
20
+     * @var string
21
+     */
22 22
     public static string $connection = 'sqlite';
23 23
 
24 24
     /**
25
-    * Holds the last error encountered during connection attempts.
26
-    *
27
-    * @var PDOException|null
28
-    */
25
+     * Holds the last error encountered during connection attempts.
26
+     *
27
+     * @var PDOException|null
28
+     */
29 29
     private static ?PDOException $error = null;
30 30
 
31 31
 
32 32
     /**
33
-    * Creates a new PDO instance based on the specified database configuration.
34
-    * 
35
-    * @param array|null $database
36
-    * @return PDO|null
37
-    */
33
+     * Creates a new PDO instance based on the specified database configuration.
34
+     * 
35
+     * @param array|null $database
36
+     * @return PDO|null
37
+     */
38 38
     public static function getInstance(?array $database = null)
39 39
     {
40 40
         $pdo = ConnectionFactory::createConnection($database);
@@ -45,11 +45,11 @@  discard block
 block discarded – undo
45 45
     }
46 46
 
47 47
     /**
48
-    * Sets the connection type for the database.
49
-    * 
50
-    * @param string $connection
51
-    * @return void
52
-    */
48
+     * Sets the connection type for the database.
49
+     * 
50
+     * @param string $connection
51
+     * @return void
52
+     */
53 53
     public static function setConnection(string $connection)
54 54
     {
55 55
         $drivers = ['mysql', 'sqlite', 'pgsql'];
@@ -60,20 +60,20 @@  discard block
 block discarded – undo
60 60
     }
61 61
 
62 62
     /**
63
-    * Gets the current connection type.
64
-    *
65
-    * @return string
66
-    */
63
+     * Gets the current connection type.
64
+     *
65
+     * @return string
66
+     */
67 67
     public static function getConnection()
68 68
     {
69 69
         return self::$connection;
70 70
     }
71 71
 
72 72
     /**
73
-    * Returns the last error encountered during connection attempts.\
74
-    * 
75
-    * @return PDOException|null
76
-    */
73
+     * Returns the last error encountered during connection attempts.\
74
+     * 
75
+     * @return PDOException|null
76
+     */
77 77
     public static function getError()
78 78
     {
79 79
         return self::$error;
@@ -84,13 +84,13 @@  discard block
 block discarded – undo
84 84
      * This class is designed to be used statically, so it cannot be instantiated.
85 85
      * 
86 86
      * @return void
87
-    */    
87
+     */    
88 88
     private function __construct() {}
89 89
 
90 90
     /**
91
-    * Prevents cloning of the Connect instance.
92
-    *
93
-    * @return void
94
-    */
91
+     * Prevents cloning of the Connect instance.
92
+     *
93
+     * @return void
94
+     */
95 95
     private function __clone() {}
96 96
 }
Please login to merge, or discard this patch.
src/Core/ConnectionFactory.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -15,11 +15,11 @@
 block discarded – undo
15 15
 {
16 16
 
17 17
     /**
18
-    * Creates a new PDO instance based on the specified database configuration.
19
-    * 
20
-    * @param array|null $database
21
-    * @return PDO|null
22
-    */
18
+     * Creates a new PDO instance based on the specified database configuration.
19
+     * 
20
+     * @param array|null $database
21
+     * @return PDO|null
22
+     */
23 23
     public static function createConnection(?array $database = null)
24 24
     {
25 25
         $dbConf = $database ?? CACHEER_DATABASE_CONFIG[Connect::getConnection()];
Please login to merge, or discard this patch.