| @@ -1,8 +1,18 @@ | ||
| 1 | 1 | <?php |
| 2 | - | |
| 3 | -declare(strict_types=1); | |
| 4 | - | |
| 2 | +/** | |
| 3 | + * CacheProviderFactory.php | |
| 4 | + * | |
| 5 | + * The CacheProviderFactory class file. | |
| 6 | + * | |
| 7 | + * PHP versions 5 | |
| 8 | + * | |
| 9 | + * @author Alexander Schneider <[email protected]> | |
| 10 | + * @copyright 2008-2017 Alexander Schneider | |
| 11 | + * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 | |
| 12 | + * @version SVN: $id$ | |
| 13 | + * @link http://wordpress.org/extend/plugins/user-access-manager/ | |
| 14 | + */ | |
| 5 | 15 | namespace UserAccessManager\Cache; |
| 6 | 16 | |
| 7 | 17 | use UserAccessManager\Config\ConfigFactory; |
| 8 | 18 | use UserAccessManager\Config\ConfigParameterFactory; |
| @@ -9,40 +19,74 @@ | ||
| 9 | 19 | use UserAccessManager\Util\Util; |
| 10 | 20 | use UserAccessManager\Wrapper\Php; |
| 11 | 21 | use UserAccessManager\Wrapper\Wordpress; |
| 12 | 22 | |
| 23 | +/** | |
| 24 | + * Class CacheProviderFactory | |
| 25 | + * | |
| 26 | + * @package UserAccessManager\Cache | |
| 27 | + */ | |
| 13 | 28 | class CacheProviderFactory |
| 14 | 29 | { |
| 30 | + /** | |
| 31 | + * @var Php | |
| 32 | + */ | |
| 33 | + private $php; | |
| 34 | + | |
| 35 | + /** | |
| 36 | + * @var Wordpress | |
| 37 | + */ | |
| 38 | + private $wordpress; | |
| 39 | + | |
| 40 | + /** | |
| 41 | + * @var Util | |
| 42 | + */ | |
| 43 | + private $util; | |
| 44 | + | |
| 45 | + /** | |
| 46 | + * @var ConfigFactory | |
| 47 | + */ | |
| 48 | + private $configFactory; | |
| 49 | + | |
| 50 | + /** | |
| 51 | + * @var ConfigParameterFactory | |
| 52 | + */ | |
| 53 | + private $configParameterFactory; | |
| 54 | + | |
| 55 | + /** | |
| 56 | + * CacheProviderFactory constructor. | |
| 57 | + * | |
| 58 | + * @param Php $php | |
| 59 | + * @param Wordpress $wordpress | |
| 60 | + * @param Util $util | |
| 61 | + * @param ConfigFactory $configFactory | |
| 62 | + * @param ConfigParameterFactory $configParameterFactory | |
| 63 | + */ | |
| 15 | 64 | public function __construct( |
| 16 | - private Php $php, | |
| 17 | - private Wordpress $wordpress, | |
| 18 | - private Util $util, | |
| 19 | - private ConfigFactory $configFactory, | |
| 20 | - private ConfigParameterFactory $configParameterFactory | |
| 65 | + Php $php, | |
| 66 | + Wordpress $wordpress, | |
| 67 | + Util $util, | |
| 68 | + ConfigFactory $configFactory, | |
| 69 | + ConfigParameterFactory $configParameterFactory | |
| 21 | 70 | ) { |
| 71 | + $this->php = $php; | |
| 72 | + $this->wordpress = $wordpress; | |
| 73 | + $this->util = $util; | |
| 74 | + $this->configFactory = $configFactory; | |
| 75 | + $this->configParameterFactory = $configParameterFactory; | |
| 22 | 76 | } |
| 23 | 77 | |
| 24 | 78 | /** |
| 25 | 79 | * Creates a FileSystemCacheProvider object. |
| 80 | + * | |
| 81 | + * @return FileSystemCacheProvider | |
| 26 | 82 | */ |
| 27 | - public function createFileSystemCacheProvider(): FileSystemCacheProvider | |
| 83 | + public function createFileSystemCacheProvider() | |
| 28 | 84 | { |
| 29 | 85 | return new FileSystemCacheProvider( |
| 30 | 86 | $this->php, |
| 31 | 87 | $this->wordpress, |
| 32 | 88 | $this->util, |
| 33 | - $this->configFactory, | |
| 34 | - $this->configParameterFactory | |
| 35 | - ); | |
| 36 | - } | |
| 37 | - | |
| 38 | - /** | |
| 39 | - * Creates a RedisCacheProvider object. | |
| 40 | - */ | |
| 41 | - public function createRedisCacheProvider(): RedisCacheProvider | |
| 42 | - { | |
| 43 | - return new RedisCacheProvider( | |
| 44 | - $this->wordpress, | |
| 45 | 89 | $this->configFactory, |
| 46 | 90 | $this->configParameterFactory |
| 47 | 91 | ); |
| 48 | 92 | } |