11<?php
22
3- namespace phpweb \Metadata ;
3+ namespace phpweb \Releases ;
44
55use DateTimeImmutable ;
66use phpweb \Build \VarCache ;
77use function array_key_last ;
88use function array_reverse ;
99use function get_active_branches ;
10+ use function get_all_branches ;
1011use function get_branch_bug_eol_date ;
1112use function get_branch_security_eol_date ;
1213
@@ -40,10 +41,10 @@ public static function Create(string $label): VersionData
4041 *
4142 * @return array<string, VersionData>
4243 */
43- public static function getSupportedVersions (): array
44+ public static function getSupportedVersions (bool $ includeRecentEOL = true ): array
4445 {
4546 $ ready = [];
46- foreach (get_active_branches () as $ versions ) {
47+ foreach (get_active_branches ($ includeRecentEOL ) as $ versions ) {
4748 foreach ($ versions as $ versionId => $ version ) {
4849 $ ready [$ versionId ] = self ::Create ($ versionId );
4950 }
@@ -52,6 +53,22 @@ public static function getSupportedVersions(): array
5253 return array_reverse ($ ready );
5354 }
5455
56+ /**
57+ * Returns instances of all the currently known versions
58+ *
59+ * @return array<string, VersionData>
60+ */
61+ public static function all (): array
62+ {
63+ if (self ::$ _all === null ) {
64+ foreach (get_all_branches () as $ branch ) {
65+ self ::$ _all [$ branch ] = self ::Create ($ branch ['version ' ]);
66+ }
67+ }
68+
69+ return self ::$ _all ;
70+ }
71+
5572 public ?DateTimeImmutable $ bugfixEOL {
5673 get {
5774 if ($ this ->_bugfixEOL === null ) {
0 commit comments