1 | <?php |
||
34 | class Secondstohuman extends Base |
||
35 | { |
||
36 | |||
37 | /** |
||
38 | * The options key for setting the data key(s) to look for to convert |
||
39 | */ |
||
40 | const OPTION_TIMEKEYS = 'timekeys'; |
||
41 | |||
42 | /** |
||
43 | * The result key added when applying this filter to a result |
||
44 | */ |
||
45 | const RESULT_KEY = 'gq_%s_human'; |
||
46 | |||
47 | /** |
||
48 | * Holds the default 'time' keys from the response array. This is key is usually 'time' from A2S responses |
||
49 | * |
||
50 | * @var array |
||
51 | */ |
||
52 | protected $timeKeysDefault = ['time']; |
||
53 | |||
54 | /** |
||
55 | * Secondstohuman constructor. |
||
56 | * |
||
57 | * @param array $options |
||
58 | */ |
||
59 | 2 | public function __construct(array $options = []) |
|
73 | |||
74 | /** |
||
75 | * Apply this filter to the result data |
||
76 | * |
||
77 | * @param array $result |
||
78 | * @param Server $server |
||
79 | * |
||
80 | * @return array |
||
81 | */ |
||
82 | 2 | public function apply(array $result, Server $server) |
|
87 | |||
88 | /** |
||
89 | * Home grown iterate function. Would like to replace this with an internal PHP method(s) but could not find a way |
||
90 | * to make the iterate classes add new keys to the response. They all seemed to be read-only. |
||
91 | * |
||
92 | * @todo: See if there is a more internal way of handling this instead of foreach looping and recursive calling |
||
93 | * |
||
94 | * @param array $result |
||
95 | * |
||
96 | * @return array |
||
97 | */ |
||
98 | 2 | protected function iterate(array &$result) |
|
119 | } |
||
120 |