1 | <?php |
||
15 | class Release { |
||
16 | /** |
||
17 | * List of update statuses for dependencies |
||
18 | * |
||
19 | * @var Array |
||
20 | */ |
||
21 | private $update_statuses = array(); |
||
22 | |||
23 | /** |
||
24 | * Class entry point. Called externally via composer script |
||
25 | */ |
||
26 | public static function run() { |
||
42 | |||
43 | /** |
||
44 | * Handles root package update |
||
45 | * |
||
46 | * @param String $name package name. |
||
47 | */ |
||
48 | public function handle_package_update( $name ) { |
||
60 | |||
61 | /** |
||
62 | * Checks if user requested an update |
||
63 | * |
||
64 | * @param String $name repo name. |
||
65 | * @param String $tag latest released version. |
||
66 | * @param String $diff short diff of unreleased changes. |
||
67 | */ |
||
68 | public function is_update_requested( $name, $tag, $diff ) { |
||
75 | |||
76 | /** |
||
77 | * Loops through provided list of dependencies and tries to update them |
||
78 | * |
||
79 | * @param Array $list list of dependencies. |
||
80 | */ |
||
81 | public function handle_dependencies_updates( $list ) { |
||
91 | |||
92 | /** |
||
93 | * Run an actual package update |
||
94 | * |
||
95 | * @param String $name package name. |
||
96 | * @throws \Exception Invalid provided version. |
||
97 | */ |
||
98 | public function do_dependency_update( $name ) { |
||
116 | |||
117 | /** |
||
118 | * Prompts a polar (Y/N) question to a user, and returns a bool |
||
119 | * |
||
120 | * @param String $prompt question to ask. |
||
121 | * @throws \Exception Invalid response. |
||
122 | */ |
||
123 | public function handle_polar_question( $prompt ) { |
||
134 | |||
135 | |||
136 | /** |
||
137 | * Checks wether a package have some unreleased changes |
||
138 | * |
||
139 | * @param String $name repository name. |
||
140 | */ |
||
141 | public function is_update_possible( $name ) { |
||
170 | |||
171 | /** |
||
172 | * Walks through the dependency tree and builds a list of deps that needs to be updated |
||
173 | * This list is build in order from branch up to root, meaning it is the order that could be used for updating the whole tree in single run |
||
174 | * |
||
175 | * @param Array $object tree node. |
||
176 | */ |
||
177 | public function get_package_dependencies_to_update( $object ) { |
||
196 | } |
||
197 |