Skip to content
This repository was archived by the owner on Sep 26, 2019. It is now read-only.

Commit 255b4d4

Browse files
author
Felix Arntz
committed
Introduce Admin_Page_Factory interface.
1 parent f6ef1da commit 255b4d4

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

src/Admin_Page_Factory.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
/**
3+
* Admin_Page_Factory interface
4+
*
5+
* @package Leaves_And_Love\OOP_Admin_Pages
6+
* @since 1.0.0
7+
*/
8+
9+
namespace Leaves_And_Love\OOP_Admin_Pages;
10+
11+
use Leaves_And_Love\OOP_Admin_Pages\Exception\Config_Invalid_Exception;
12+
use BrightNucleus\Config\ConfigInterface as Config;
13+
14+
/**
15+
* Interface to create admin page instances.
16+
*
17+
* @since 1.0.0
18+
*/
19+
interface Admin_Page_Factory {
20+
21+
/**
22+
* Creates a new admin page instance.
23+
*
24+
* @since 1.0.0
25+
*
26+
* @param Config $config Admin page configuration.
27+
* @return Admin_Page Admin page instance.
28+
*
29+
* @throws Config_Invalid_Exception Thrown when the configuration is invalid.
30+
*/
31+
public function create_page( Config $config ) : Admin_Page;
32+
}

0 commit comments

Comments
 (0)