MenuFactory.php
25 lines
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace AC\Admin\View; |
| 6 | |
| 7 | use AC\Admin\MenuFactoryInterface; |
| 8 | use AC\AdminColumns; |
| 9 | |
| 10 | final class MenuFactory |
| 11 | { |
| 12 | private AdminColumns $plugin; |
| 13 | |
| 14 | public function __construct(AdminColumns $plugin) |
| 15 | { |
| 16 | $this->plugin = $plugin; |
| 17 | } |
| 18 | |
| 19 | public function create(MenuFactoryInterface $menu_factory, string $current): Menu |
| 20 | { |
| 21 | return new Menu($this->plugin->get_location(), $menu_factory->create($current)); |
| 22 | } |
| 23 | |
| 24 | } |
| 25 |