minor #23506 [Cache] add constructor docblocks for clarity (xabbuh)
This PR was merged into the 3.2 branch.
Discussion
----------
[Cache] add constructor docblocks for clarity
| Q | A
| ------------- | ---
| Branch? | 3.2
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #23503
| License | MIT
| Doc PR |
Commits
-------
813a5377e1
[Cache] add constructor docblocks for clarity
This commit is contained in:
commit
876f53dbf9
@ -39,6 +39,10 @@ abstract class AbstractAdapter implements AdapterInterface, LoggerAwareInterface
|
||||
*/
|
||||
protected $maxIdLength;
|
||||
|
||||
/**
|
||||
* @param string $namespace
|
||||
* @param int $defaultLifetime
|
||||
*/
|
||||
protected function __construct($namespace = '', $defaultLifetime = 0)
|
||||
{
|
||||
$this->namespace = '' === $namespace ? '' : $this->getId($namespace).':';
|
||||
@ -81,6 +85,15 @@ abstract class AbstractAdapter implements AdapterInterface, LoggerAwareInterface
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $namespace
|
||||
* @param int $defaultLifetime
|
||||
* @param string $version
|
||||
* @param string $directory
|
||||
* @param LoggerInterface|null $logger
|
||||
*
|
||||
* @return AdapterInterface
|
||||
*/
|
||||
public static function createSystemCache($namespace, $defaultLifetime, $version, $directory, LoggerInterface $logger = null)
|
||||
{
|
||||
if (null === self::$apcuSupported) {
|
||||
@ -139,7 +152,7 @@ abstract class AbstractAdapter implements AdapterInterface, LoggerAwareInterface
|
||||
/**
|
||||
* Deletes all items in the pool.
|
||||
*
|
||||
* @param string The prefix used for all identifiers managed by this pool
|
||||
* @param string $namespace The prefix used for all identifiers managed by this pool
|
||||
*
|
||||
* @return bool True if the pool was successfully cleared, false otherwise
|
||||
*/
|
||||
|
@ -24,6 +24,13 @@ class ApcuAdapter extends AbstractAdapter
|
||||
return function_exists('apcu_fetch') && ini_get('apc.enabled');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $namespace
|
||||
* @param int $defaultLifetime
|
||||
* @param string|null $version
|
||||
*
|
||||
* @throws CacheException if APCu is not enabled
|
||||
*/
|
||||
public function __construct($namespace = '', $defaultLifetime = 0, $version = null)
|
||||
{
|
||||
if (!static::isSupported()) {
|
||||
|
@ -20,6 +20,11 @@ class DoctrineAdapter extends AbstractAdapter
|
||||
{
|
||||
private $provider;
|
||||
|
||||
/**
|
||||
* @param CacheProvider $provider
|
||||
* @param string $namespace
|
||||
* @param int $defaultLifetime
|
||||
*/
|
||||
public function __construct(CacheProvider $provider, $namespace = '', $defaultLifetime = 0)
|
||||
{
|
||||
parent::__construct('', $defaultLifetime);
|
||||
|
@ -20,6 +20,11 @@ class FilesystemAdapter extends AbstractAdapter
|
||||
{
|
||||
use FilesystemAdapterTrait;
|
||||
|
||||
/**
|
||||
* @param string $namespace
|
||||
* @param int $defaultLifetime
|
||||
* @param string|null $directory
|
||||
*/
|
||||
public function __construct($namespace = '', $defaultLifetime = 0, $directory = null)
|
||||
{
|
||||
parent::__construct('', $defaultLifetime);
|
||||
|
@ -29,6 +29,13 @@ class PhpFilesAdapter extends AbstractAdapter
|
||||
return function_exists('opcache_invalidate') && ini_get('opcache.enable');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $namespace
|
||||
* @param int $defaultLifetime
|
||||
* @param string|null $directory
|
||||
*
|
||||
* @throws CacheException if OPcache is not enabled
|
||||
*/
|
||||
public function __construct($namespace = '', $defaultLifetime = 0, $directory = null)
|
||||
{
|
||||
if (!static::isSupported()) {
|
||||
|
@ -26,6 +26,11 @@ class ProxyAdapter implements AdapterInterface
|
||||
private $createCacheItem;
|
||||
private $poolHash;
|
||||
|
||||
/**
|
||||
* @param CacheItemPoolInterface $pool
|
||||
* @param string $namespace
|
||||
* @param int $defaultLifetime
|
||||
*/
|
||||
public function __construct(CacheItemPoolInterface $pool, $namespace = '', $defaultLifetime = 0)
|
||||
{
|
||||
$this->pool = $pool;
|
||||
|
Reference in New Issue
Block a user