| @@ -1,5 +1,18 @@ | ||
| 1 | 1 | <?php |
| 2 | +/** | |
| 3 | + * CacheProviderFactory.php | |
| 4 | + * | |
| 5 | + * The CacheProviderFactory class file. | |
| 6 | + * | |
| 7 | + * PHP versions 5 | |
| 8 | + * | |
| 9 | + * @author Alexander Schneider <alexanderschneider85@gmail.com> | |
| 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 | + */ | |
| 2 | 15 | |
| 3 | 16 | declare(strict_types=1); |
| 4 | 17 | |
| 5 | 18 | namespace UserAccessManager\Cache; |
| @@ -9,21 +22,65 @@ | ||
| 9 | 22 | use UserAccessManager\Util\Util; |
| 10 | 23 | use UserAccessManager\Wrapper\Php; |
| 11 | 24 | use UserAccessManager\Wrapper\Wordpress; |
| 12 | 25 | |
| 26 | +/** | |
| 27 | + * Class CacheProviderFactory | |
| 28 | + * | |
| 29 | + * @package UserAccessManager\Cache | |
| 30 | + */ | |
| 13 | 31 | class CacheProviderFactory |
| 14 | 32 | { |
| 33 | + /** | |
| 34 | + * @var Php | |
| 35 | + */ | |
| 36 | + private $php; | |
| 37 | + | |
| 38 | + /** | |
| 39 | + * @var Wordpress | |
| 40 | + */ | |
| 41 | + private $wordpress; | |
| 42 | + | |
| 43 | + /** | |
| 44 | + * @var Util | |
| 45 | + */ | |
| 46 | + private $util; | |
| 47 | + | |
| 48 | + /** | |
| 49 | + * @var ConfigFactory | |
| 50 | + */ | |
| 51 | + private $configFactory; | |
| 52 | + | |
| 53 | + /** | |
| 54 | + * @var ConfigParameterFactory | |
| 55 | + */ | |
| 56 | + private $configParameterFactory; | |
| 57 | + | |
| 58 | + /** | |
| 59 | + * CacheProviderFactory constructor. | |
| 60 | + * @param Php $php | |
| 61 | + * @param Wordpress $wordpress | |
| 62 | + * @param Util $util | |
| 63 | + * @param ConfigFactory $configFactory | |
| 64 | + * @param ConfigParameterFactory $configParameterFactory | |
| 65 | + */ | |
| 15 | 66 | public function __construct( |
| 16 | - private Php $php, | |
| 17 | - private Wordpress $wordpress, | |
| 18 | - private Util $util, | |
| 19 | - private ConfigFactory $configFactory, | |
| 20 | - private ConfigParameterFactory $configParameterFactory | |
| 67 | + Php $php, | |
| 68 | + Wordpress $wordpress, | |
| 69 | + Util $util, | |
| 70 | + ConfigFactory $configFactory, | |
| 71 | + ConfigParameterFactory $configParameterFactory | |
| 21 | 72 | ) { |
| 73 | + $this->php = $php; | |
| 74 | + $this->wordpress = $wordpress; | |
| 75 | + $this->util = $util; | |
| 76 | + $this->configFactory = $configFactory; | |
| 77 | + $this->configParameterFactory = $configParameterFactory; | |
| 22 | 78 | } |
| 23 | 79 | |
| 24 | 80 | /** |
| 25 | 81 | * Creates a FileSystemCacheProvider object. |
| 82 | + * @return FileSystemCacheProvider | |
| 26 | 83 | */ |
| 27 | 84 | public function createFileSystemCacheProvider(): FileSystemCacheProvider |
| 28 | 85 | { |
| 29 | 86 | return new FileSystemCacheProvider( |
| @@ -29,20 +86,8 @@ | ||
| 29 | 86 | return new FileSystemCacheProvider( |
| 30 | 87 | $this->php, |
| 31 | 88 | $this->wordpress, |
| 32 | 89 | $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 | 90 | $this->configFactory, |
| 46 | 91 | $this->configParameterFactory |
| 47 | 92 | ); |
| 48 | 93 | } |