1 | <?php |
||
19 | class JobStatus |
||
20 | { |
||
21 | /** |
||
22 | * @var boolean |
||
23 | * |
||
24 | * Job is known |
||
25 | */ |
||
26 | private $known; |
||
27 | |||
28 | /** |
||
29 | * @var boolean |
||
30 | * |
||
31 | * Job is running |
||
32 | */ |
||
33 | private $running; |
||
34 | |||
35 | /** |
||
36 | * @var Integer |
||
37 | * |
||
38 | * Job completition |
||
39 | */ |
||
40 | private $completed; |
||
41 | |||
42 | /** |
||
43 | * @var integer |
||
44 | * |
||
45 | * Job completition total |
||
46 | */ |
||
47 | private $completionTotal; |
||
48 | |||
49 | /** |
||
50 | * Construct method |
||
51 | * |
||
52 | * @param array $response Response to parse |
||
53 | */ |
||
54 | 4 | public function __construct(array $response) |
|
67 | |||
68 | /** |
||
69 | * Return if job is known |
||
70 | * |
||
71 | * @return boolean Job is still known |
||
72 | */ |
||
73 | 4 | public function isKnown() |
|
77 | |||
78 | /** |
||
79 | * Return if job is still running |
||
80 | * |
||
81 | * @return boolean Jon is still running |
||
82 | */ |
||
83 | 4 | public function isRunning() |
|
87 | |||
88 | /** |
||
89 | * Return completed value |
||
90 | * |
||
91 | * @return integer Completed |
||
92 | */ |
||
93 | 4 | public function getCompleted() |
|
97 | |||
98 | /** |
||
99 | * Return completition total |
||
100 | * |
||
101 | * @return integer Completition total |
||
102 | */ |
||
103 | 4 | public function getCompletionTotal() |
|
107 | |||
108 | /** |
||
109 | * Return percent completed. |
||
110 | * |
||
111 | * 0 is not started or not known |
||
112 | * 1 is finished |
||
113 | * Between 0 and 1 is in process. Value is a float |
||
114 | * |
||
115 | * @return float Percent completed |
||
|
|||
116 | */ |
||
117 | 4 | public function getCompletionPercent() |
|
128 | |||
129 | /** |
||
130 | * Return if job is still running |
||
131 | * |
||
132 | * @return boolean Jon is still running |
||
133 | */ |
||
134 | 4 | public function isFinished() |
|
138 | } |
||
139 |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.