Skip to content

Commit 4590051

Browse files
committed
Added method "getConfigClass" ExtendedCacheItemPoolInterface && increased API version to 2.0.4
1 parent e0234b0 commit 4590051

File tree

5 files changed

+11
-84
lines changed

5 files changed

+11
-84
lines changed

CHANGELOG_API.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 2.0.4
2+
- Added ExtendedCacheItemPoolInterface::getConfigClass() that returns the config class name
3+
14
## 2.0.3
25
- Updated ExtendedCacheItemPoolInterface::setEventManager() first argument that now MUSt implement `\Phpfastcache\Event\EventInterface`
36
- Updated ExtendedCacheItemInterface::setEventManager() first argument that now MUSt implement `\Phpfastcache\Event\EventInterface`

lib/Phpfastcache/Api.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
*/
2525
class Api
2626
{
27-
protected static $version = '2.0.3';
27+
protected static $version = '2.0.4';
2828

2929
/**
3030
* Api constructor.

lib/Phpfastcache/Core/Pool/DriverBaseTrait.php

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -342,37 +342,6 @@ public function getTagKeys(array $keys): array
342342
return $keys;
343343
}
344344

345-
/**
346-
* @param string $optionName
347-
* @param mixed $optionValue
348-
* @return bool
349-
* @throws PhpfastcacheInvalidArgumentException
350-
*/
351-
public static function isValidOption($optionName, $optionValue): bool
352-
{
353-
if (!\is_string($optionName)) {
354-
throw new PhpfastcacheInvalidArgumentException('$optionName must be a string');
355-
}
356-
357-
return true;
358-
}
359-
360-
/**
361-
* @return array
362-
*/
363-
public static function getRequiredOptions(): array
364-
{
365-
return [];
366-
}
367-
368-
/**
369-
* @return array
370-
*/
371-
public static function getValidOptions(): array
372-
{
373-
return [];
374-
}
375-
376345
/**
377346
* @return string
378347
*/

lib/Phpfastcache/Core/Pool/ExtendedCacheItemPoolInterface.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,4 +537,10 @@ public function saveMultiple(...$items): bool;
537537
* @return bool
538538
*/
539539
public static function isUsableInAutoContext(): bool;
540+
541+
/**
542+
* Return the config class name
543+
* @return string
544+
*/
545+
public static function getConfigClass(): string;
540546
}

lib/Phpfastcache/Drivers/Files/Driver.php

Lines changed: 1 addition & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -143,57 +143,6 @@ protected function driverDelete(CacheItemInterface $item): bool
143143
*/
144144
protected function driverClear(): bool
145145
{
146-
return (bool)Directory::rrmdir($this->getPath(true));
147-
}
148-
149-
/**
150-
* @param string $optionName
151-
* @param mixed $optionValue
152-
* @return bool
153-
* @throws PhpfastcacheInvalidArgumentException
154-
*/
155-
public static function isValidOption($optionName, $optionValue): bool
156-
{
157-
DriverBaseTrait::isValidOption($optionName, $optionValue);
158-
switch ($optionName) {
159-
case 'path':
160-
return \is_string($optionValue);
161-
break;
162-
163-
case 'default_chmod':
164-
return \is_numeric($optionValue);
165-
break;
166-
167-
case 'securityKey':
168-
return \is_string($optionValue);
169-
break;
170-
case 'htaccess':
171-
return \is_bool($optionValue);
172-
break;
173-
174-
case 'secureFileManipulation':
175-
return \is_bool($optionValue);
176-
break;
177-
178-
default:
179-
return false;
180-
break;
181-
}
182-
}
183-
184-
/**
185-
* @return array
186-
*/
187-
public static function getValidOptions(): array
188-
{
189-
return ['path', 'default_chmod', 'securityKey', 'htaccess', 'secureFileManipulation'];
190-
}
191-
192-
/**
193-
* @return array
194-
*/
195-
public static function getRequiredOptions(): array
196-
{
197-
return ['path'];
146+
return Directory::rrmdir($this->getPath(true));
198147
}
199148
}

0 commit comments

Comments
 (0)