Skip to content

Commit 5665cae

Browse files
authored
Adding data for v4 (#145)
1 parent 9251437 commit 5665cae

File tree

9 files changed

+2186
-1307
lines changed

9 files changed

+2186
-1307
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@
4343
"require-dev": {
4444
"friendsofphp/php-cs-fixer": "^3.59",
4545
"squizlabs/php_codesniffer": "~3.10",
46-
"maximebf/debugbar": "^1.22.3"
46+
"maximebf/debugbar": "^1.22.3",
47+
"phpstan/phpstan": "^1.12"
4748
},
4849
"replace": {
4950
"paragonie/random_compat": "*"

composer.lock

Lines changed: 399 additions & 334 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
3+
use Phinx\Migration\AbstractMigration;
4+
5+
class Addv4Info extends AbstractMigration
6+
{
7+
/**
8+
* Change Method.
9+
*
10+
* Write your reversible migrations using this method.
11+
*
12+
* More information on writing migrations is available here:
13+
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
14+
*
15+
* The following commands can be used in this method and Phinx will
16+
* automatically reverse them when rolling back:
17+
*
18+
* createTable
19+
* renameTable
20+
* addColumn
21+
* renameColumn
22+
* addIndex
23+
* addForeignKey
24+
*
25+
* Remember to call "create()" or "update()" and NOT "save()" when working
26+
* with the Table class.
27+
*/
28+
public function change()
29+
{
30+
$this->table('packages')
31+
->addColumn('has_v4', 'boolean', ['default' => true])
32+
->update();
33+
}
34+
}

package-lock.json

Lines changed: 1709 additions & 968 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ packages:
66
deprecated: true
77
has_v2: false
88
has_v3: false
9+
has_v4: false
910
compat:
1011
deprecated: true
1112
has_v2: false
1213
has_v3: false
14+
has_v4: false
1315
console:
1416
has_v1: false
1517
controller: ~
@@ -21,6 +23,7 @@ packages:
2123
deprecated: true
2224
has_v2: false
2325
has_v3: false
26+
has_v4: false
2427
datetime:
2528
abandoned: true
2629
display: DateTime
@@ -34,6 +37,7 @@ packages:
3437
deprecated: true
3538
has_v2: false
3639
has_v3: false
40+
has_v4: false
3741
filesystem: ~
3842
filter: ~
3943
form:
@@ -46,12 +50,14 @@ packages:
4650
deprecated: true
4751
has_v2: false
4852
has_v3: false
53+
has_v4: false
4954
http:
5055
display: HTTP
5156
image:
5257
deprecated: true
5358
has_v2: false
5459
has_v3: false
60+
has_v4: false
5561
input: ~
5662
keychain: ~
5763
language: ~
@@ -60,16 +66,19 @@ packages:
6066
deprecated: true
6167
has_v2: false
6268
has_v3: false
69+
has_v4: false
6370
linkedin:
6471
display: LinkedIn
6572
repo: linkedin-api
6673
deprecated: true
6774
has_v2: false
6875
has_v3: false
76+
has_v4: false
6977
log:
7078
deprecated: true
7179
has_v2: false
7280
has_v3: false
81+
has_v4: false
7382
mediawiki:
7483
display: MediaWiki
7584
repo: mediawiki-api
@@ -85,6 +94,7 @@ packages:
8594
deprecated: true
8695
has_v2: false
8796
has_v3: false
97+
has_v4: false
8898
preload:
8999
has_v1: false
90100
profiler: ~
@@ -105,6 +115,7 @@ packages:
105115
deprecated: true
106116
has_v2: false
107117
has_v3: false
118+
has_v4: false
108119
uri:
109120
display: URI
110121
utilities: ~

src/Command/Package/SyncCommand.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ protected function doExecute(InputInterface $input, OutputInterface $output): in
8686
$this->helper->getPackageAbandoned($packageName),
8787
$this->helper->getPackageHasVersion1($packageName),
8888
$this->helper->getPackageHasVersion2($packageName),
89-
$this->helper->getPackageHasVersion3($packageName)
89+
$this->helper->getPackageHasVersion3($packageName),
90+
$this->helper->getPackageHasVersion4($packageName)
9091
);
9192
$symfonyStyle->comment("Updated $displayName package data.");
9293
} else {
@@ -99,7 +100,8 @@ protected function doExecute(InputInterface $input, OutputInterface $output): in
99100
$this->helper->getPackageAbandoned($packageName),
100101
$this->helper->getPackageHasVersion1($packageName),
101102
$this->helper->getPackageHasVersion2($packageName),
102-
$this->helper->getPackageHasVersion3($packageName)
103+
$this->helper->getPackageHasVersion3($packageName),
104+
$this->helper->getPackageHasVersion4($packageName)
103105
);
104106
$symfonyStyle->comment("$displayName package added to the database.");
105107
}

src/Helper.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,4 +112,16 @@ public function getPackageHasVersion3(string $package): bool
112112
{
113113
return $this->getPackages()->get("packages.$package.has_v3", true);
114114
}
115+
116+
/**
117+
* Utility method to retrieve whether a package has a 4.x branch
118+
*
119+
* @param string $package Package name
120+
*
121+
* @return boolean
122+
*/
123+
public function getPackageHasVersion4(string $package): bool
124+
{
125+
return $this->getPackages()->get("packages.$package.has_v4", true);
126+
}
115127
}

src/Model/PackageModel.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ public function addPackage(
5555
bool $isAbandoned,
5656
bool $hasV1,
5757
bool $hasV2,
58-
bool $hasV3
58+
bool $hasV3,
59+
bool $hasV4
5960
): void {
6061
$db = $this->getDb();
6162

@@ -69,6 +70,7 @@ public function addPackage(
6970
'has_v1' => (int) $hasV1,
7071
'has_v2' => (int) $hasV2,
7172
'has_v3' => (int) $hasV3,
73+
'has_v4' => (int) $hasV4,
7274
];
7375

7476
$db->insertObject('#__packages', $data);
@@ -198,7 +200,8 @@ public function updatePackage(
198200
bool $isAbandoned,
199201
bool $hasV1,
200202
bool $hasV2,
201-
bool $hasV3
203+
bool $hasV3,
204+
bool $hasV4
202205
): void {
203206
$db = $this->getDb();
204207

@@ -213,6 +216,7 @@ public function updatePackage(
213216
'has_v1' => (int) $hasV1,
214217
'has_v2' => (int) $hasV2,
215218
'has_v3' => (int) $hasV3,
219+
'has_v4' => (int) $hasV4,
216220
];
217221

218222
$db->updateObject('#__packages', $data, 'id');

templates/status.twig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<th scope="col">1.x Series</th>
1616
<th scope="col">2.x Series</th>
1717
<th scope="col">3.x Series</th>
18+
<th scope="col">4.x Series</th>
1819
<th scope="col">PRs</th>
1920
</tr>
2021
</thead>
@@ -56,6 +57,14 @@
5657
<a href="https://ci.joomla.org/joomla-framework/{{ release.package.repo }}"><img src="https://ci.joomla.org/api/badges/joomla-framework/{{ release.package.repo }}/status.svg?ref=refs/heads/3.x-dev" alt="Build Status" /></a>
5758
{% endif %}
5859
</td>
60+
<td data-label="4.x Series">
61+
{% if not release.package.has_v4 %}
62+
N/A
63+
{% else %}
64+
{{ release.v4.version }}
65+
<a href="https://ci.joomla.org/joomla-framework/{{ release.package.repo }}"><img src="https://ci.joomla.org/api/badges/joomla-framework/{{ release.package.repo }}/status.svg?ref=refs/heads/4.x-dev" alt="Build Status" /></a>
66+
{% endif %}
67+
</td>
5968
<td data-label="PRs">
6069
<a href="https://github.com/joomla-framework/{{ release.package.repo }}/pulls">{{ release.package.pullcount }}</a>
6170
</td>

0 commit comments

Comments
 (0)