1 | <?php |
||
19 | class JiraApi extends Api |
||
20 | { |
||
21 | |||
22 | const CACHE_DURATION_ONE_MONTH = 2592000; |
||
23 | |||
24 | /** |
||
25 | * Cache. |
||
26 | * |
||
27 | * @var CacheProvider |
||
28 | */ |
||
29 | protected $cache; |
||
30 | |||
31 | /** |
||
32 | * Sets cache. |
||
33 | * |
||
34 | * @param CacheProvider $cache Cache. |
||
35 | * |
||
36 | * @return void |
||
37 | */ |
||
38 | public function setCache(CacheProvider $cache) |
||
42 | |||
43 | /** |
||
44 | * Get fields definitions. |
||
45 | * |
||
46 | * @param integer $cache_duration Cache duration. |
||
47 | * |
||
48 | * @return array |
||
49 | */ |
||
50 | public function getFields($cache_duration = 0) |
||
62 | |||
63 | /** |
||
64 | * Get available issue types. |
||
65 | * |
||
66 | * @param integer $cache_duration Cache duration. |
||
67 | * |
||
68 | * @return IssueType[] |
||
69 | */ |
||
70 | public function getIssueTypes($cache_duration = 0) |
||
82 | |||
83 | /** |
||
84 | * Get versions of a project. |
||
85 | * |
||
86 | * @param string $project_key Project key. |
||
87 | * @param integer $cache_duration Cache duration. |
||
88 | * |
||
89 | * @return array|false |
||
90 | */ |
||
91 | public function getVersions($project_key, $cache_duration = 0) |
||
103 | |||
104 | /** |
||
105 | * Returns possible link names. |
||
106 | * |
||
107 | * @return array |
||
108 | */ |
||
109 | public function getProjectKeys() |
||
131 | |||
132 | /** |
||
133 | * Returns issue link type names. |
||
134 | * |
||
135 | * @return array |
||
136 | */ |
||
137 | public function getIssueLinkTypeNames() |
||
155 | |||
156 | /** |
||
157 | * Returns project component mapping (id to name). |
||
158 | * |
||
159 | * @param string $project_key Project key. |
||
160 | * @param integer $cache_duration Cache duration. |
||
161 | * |
||
162 | * @return array |
||
163 | */ |
||
164 | public function getProjectComponentMapping($project_key, $cache_duration = 0) |
||
182 | |||
183 | } |
||
184 |
There are different options of fixing this problem.
If you want to be on the safe side, you can add an additional type-check:
If you are sure that the expression is traversable, you might want to add a doc comment cast to improve IDE auto-completion and static analysis:
Mark the issue as a false-positive: Just hover the remove button, in the top-right corner of this issue for more options.