Source Code: SmartFactory/Interfaces/IInitable.php

 1: <?php
 2: /**
 3:  * This file contains the declaration of the interface IInitable.
 4:  *
 5:  * @package System
 6:  *
 7:  * @author Oleg Schildt
 8:  */
 9: 
10: namespace SmartFactory\Interfaces;
11: 
12: /**
13:  * Interface for universal standard way of the object initialization
14:  * through the array of parameters.
15:  *
16:  * You should implement this interface in your classes if they have to be initialized.
17:  *
18:  * @author Oleg Schildt
19:  */
20: interface IInitable
21: {
22:     /**
23:      * Initialization method.
24:      *
25:      * @param array $parameters
26:      * This array may contain any data required for the initialization
27:      * of the objects of your class.
28:      *
29:      * @return void
30:      *
31:      * @throws \Exception
32:      * It might throw an exception in the case of any errors.
33:      *
34:      * @author Oleg Schildt
35:      */
36:     public function init(array $parameters): void;
37: } // IInitable