1 | <?php |
||
28 | class ResourceStack |
||
29 | { |
||
30 | /** |
||
31 | * @var array |
||
32 | */ |
||
33 | private $stack; |
||
34 | |||
35 | /** |
||
36 | * @param array $stack |
||
37 | */ |
||
38 | 24 | public function __construct(array $stack) |
|
45 | |||
46 | /** |
||
47 | * Get the current version resource. |
||
48 | * |
||
49 | * @return PuliResource |
||
50 | */ |
||
51 | 9 | public function getCurrent() |
|
55 | |||
56 | /** |
||
57 | * Get the current version number. |
||
58 | * |
||
59 | * @return int |
||
60 | */ |
||
61 | 10 | public function getCurrentVersion() |
|
65 | |||
66 | /** |
||
67 | * Get the current version resource. |
||
68 | * |
||
69 | * @return PuliResource |
||
70 | */ |
||
71 | 9 | public function getFirst() |
|
75 | |||
76 | /** |
||
77 | * Get the first version number. |
||
78 | * |
||
79 | * @return int |
||
80 | */ |
||
81 | 10 | public function getFirstVersion() |
|
85 | |||
86 | /** |
||
87 | * Get a specific version resource from the stack by its version number. |
||
88 | * |
||
89 | * @param int $version The version number (first is 0). |
||
90 | * |
||
91 | * @return PuliResource |
||
92 | */ |
||
93 | 14 | public function get($version) |
|
101 | |||
102 | /** |
||
103 | * Get an array of the available versions of this resource. |
||
104 | * |
||
105 | * @return array |
||
|
|||
106 | */ |
||
107 | 9 | public function getVersions() |
|
111 | |||
112 | /** |
||
113 | * Returns the stack contents as array. |
||
114 | * |
||
115 | * @return PuliResource[] The resources in the stack. |
||
116 | */ |
||
117 | public function toArray() |
||
121 | } |
||
122 |
This check looks for the generic type
array
as a return type and suggests a more specific type. This type is inferred from the actual code.