| @@ -1,5 +1,18 @@ | ||
| 1 | 1 | <?php |
| 2 | +/** | |
| 3 | + * WidgetFactory.php | |
| 4 | + * | |
| 5 | + * The WidgetFactory 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\Widget; |
| @@ -7,17 +20,47 @@ | ||
| 7 | 20 | use UserAccessManager\Config\WordpressConfig; |
| 8 | 21 | use UserAccessManager\Wrapper\Php; |
| 9 | 22 | use UserAccessManager\Wrapper\Wordpress; |
| 10 | 23 | |
| 24 | +/** | |
| 25 | + * Class WidgetFactory | |
| 26 | + * | |
| 27 | + * @package UserAccessManager\Widget | |
| 28 | + */ | |
| 11 | 29 | class WidgetFactory |
| 12 | 30 | { |
| 13 | - public function __construct( | |
| 14 | - private Php $php, | |
| 15 | - private Wordpress $wordpress, | |
| 16 | - private WordpressConfig $wordpressConfig | |
| 17 | - ) { | |
| 31 | + /** | |
| 32 | + * @var Php | |
| 33 | + */ | |
| 34 | + protected $php; | |
| 35 | + | |
| 36 | + /** | |
| 37 | + * @var Wordpress | |
| 38 | + */ | |
| 39 | + protected $wordpress; | |
| 40 | + | |
| 41 | + /** | |
| 42 | + * @var WordpressConfig | |
| 43 | + */ | |
| 44 | + protected $wordpressConfig; | |
| 45 | + | |
| 46 | + /** | |
| 47 | + * WidgetFactory constructor. | |
| 48 | + * @param Php $php | |
| 49 | + * @param Wordpress $wordpress | |
| 50 | + * @param WordpressConfig $wordpressConfig | |
| 51 | + */ | |
| 52 | + public function __construct(Php $php, Wordpress $wordpress, WordpressConfig $wordpressConfig) | |
| 53 | + { | |
| 54 | + $this->php = $php; | |
| 55 | + $this->wordpress = $wordpress; | |
| 56 | + $this->wordpressConfig = $wordpressConfig; | |
| 18 | 57 | } |
| 19 | 58 | |
| 59 | + /** | |
| 60 | + * Creates and returns a login widget. | |
| 61 | + * @return LoginWidget | |
| 62 | + */ | |
| 20 | 63 | public function createLoginWidget(): LoginWidget |
| 21 | 64 | { |
| 22 | 65 | return new LoginWidget($this->php, $this->wordpress, $this->wordpressConfig); |
| 23 | 66 | } |