| 1 | <?php |
||
| 5 | class PlaybookDefenition |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * The playbook identification. |
||
| 9 | * |
||
| 10 | * @var string |
||
| 11 | */ |
||
| 12 | public $id; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * The instance of the playbook. |
||
| 16 | * |
||
| 17 | * @var \Scaling\Playbook\Playbook |
||
| 18 | */ |
||
| 19 | public $playbook; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Times the playbook needs to run. |
||
| 23 | * |
||
| 24 | * @var int |
||
| 25 | */ |
||
| 26 | public $times = 1; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Playbook only has to run once. |
||
| 30 | * |
||
| 31 | * @var bool |
||
| 32 | */ |
||
| 33 | public $once = false; |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Create a new playbook instance. |
||
| 37 | * |
||
| 38 | * @param string $className |
||
| 39 | * @return void |
||
|
|
|||
| 40 | */ |
||
| 41 | public function __construct(string $className) |
||
| 46 | |||
| 47 | /** |
||
| 48 | * Create a new playbook instance which has to run more than one time. |
||
| 49 | * |
||
| 50 | * @param string $className |
||
| 51 | * @param int $times |
||
| 52 | * @return \Scaling\Playbook\PlaybookDefenition |
||
| 53 | */ |
||
| 54 | public static function times(string $className, int $times): self |
||
| 61 | |||
| 62 | /** |
||
| 63 | * Create a new playbook instance which only has to run once. |
||
| 64 | * |
||
| 65 | * @param string $className |
||
| 66 | * @return \Scaling\Playbook\PlaybookDefenition |
||
| 67 | */ |
||
| 68 | public static function once(string $className): self |
||
| 75 | } |
||
| 76 |
Adding a
@returnannotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.