1 | <?php |
||
9 | class TaskManager |
||
10 | { |
||
11 | /** @var Container **/ |
||
12 | protected $container; |
||
13 | |||
14 | /** |
||
15 | * @param Container $container |
||
16 | */ |
||
17 | public function __construct(Container $container) |
||
21 | |||
22 | /** |
||
23 | * @param array $data |
||
24 | * @return Task |
||
25 | */ |
||
26 | public function createTaskFromData($data) |
||
44 | |||
45 | /** |
||
46 | * @param string $manager |
||
47 | * @param string $method |
||
48 | * @param int $objectId |
||
49 | * @param string $date |
||
50 | * @param int $id |
||
51 | * @param array $context |
||
52 | * @return Task |
||
53 | */ |
||
54 | public function createRealTimeTask($manager, $method, $objectId, $date, $id = null, $context = null) |
||
66 | |||
67 | /** |
||
68 | * @param string $manager |
||
69 | * @param string $method |
||
70 | * @return Task |
||
71 | */ |
||
72 | public function createCyclicTask($manager, $method, $id = null) |
||
81 | |||
82 | /** |
||
83 | * @param string $manager |
||
84 | * @param string $method |
||
85 | * @return Task |
||
86 | */ |
||
87 | public function createTechnicalTask($manager, $method, $id = null) |
||
96 | |||
97 | /** |
||
98 | * @param \Asylamba\Classes\Task\Task $task |
||
99 | * @return array |
||
100 | */ |
||
101 | public function perform(Task $task) |
||
110 | |||
111 | /** |
||
112 | * @param Process $process |
||
113 | * @param array $data |
||
114 | */ |
||
115 | public function validateTask(Process $process, $data) |
||
133 | |||
134 | public function generateId() |
||
138 | } |
As per the PSR-2 coding standard, case statements should not be wrapped in curly braces. There is no need for braces, since each case is terminated by the next
break
.There is also the option to use a semicolon instead of a colon, this is discouraged because many programmers do not even know it works and the colon is universal between programming languages.
To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.