Skip to content

Commit 3fd2a84

Browse files
authored
[4.x] composer udpate and phpstan/phpunit fixes (#24)
* composer udpate and phpstan/phpunit fixes * update docs and remove drone
1 parent 9e5fc65 commit 3fd2a84

7 files changed

Lines changed: 32 additions & 268 deletions

File tree

.drone.jsonnet

Lines changed: 0 additions & 107 deletions
This file was deleted.

.drone.yml

Lines changed: 0 additions & 135 deletions
This file was deleted.

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,24 @@ The Console package provides the infrastructure for building command line applic
99

1010
## Installation via Composer
1111

12-
Add `"joomla/console": "~3.0"` to the require block in your composer.json and then run `composer install`.
12+
Add `"joomla/console": "~4.0"` to the require block in your composer.json and then run `composer install`.
1313

1414
```json
1515
{
1616
"require": {
17-
"joomla/console": "~3.0"
17+
"joomla/console": "~4.0"
1818
}
1919
}
2020
```
2121

2222
Alternatively, you can simply run the following from the command line:
2323

2424
```sh
25-
composer require joomla/console "~3.0"
25+
composer require joomla/console "~4.0"
2626
```
2727

2828
If you want to include the test sources and docs, use
2929

3030
```sh
31-
composer require --prefer-source joomla/console "~3.0"
31+
composer require --prefer-source joomla/console "~4.0"
3232
```

SECURITY.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
These versions are currently being supported with security updates:
66

77
| Version | Supported |
8-
| ------- | ------------------ |
8+
|---------| ------------------ |
9+
| 4.x.x | :white_check_mark: |
910
| 3.x.x | :white_check_mark: |
1011
| 2.0.x | :white_check_mark: |
1112

composer.json

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@
66
"homepage": "https://github.com/joomla-framework/console",
77
"license": "GPL-2.0-or-later",
88
"require": {
9-
"php": "^8.1.0",
10-
"joomla/application": "^3.0",
11-
"joomla/event": "^3.0",
12-
"joomla/string": "^3.0",
13-
"symfony/console": "^v6.2.0",
14-
"symfony/error-handler": "^6"
9+
"php": "^8.3.0",
10+
"joomla/application": "dev-4.x-dev",
11+
"joomla/event": "dev-4.x-dev",
12+
"joomla/string": "dev-4.x-dev",
13+
"symfony/console": "^v7.0.0",
14+
"symfony/error-handler": "^7"
1515
},
1616
"require-dev": {
17-
"joomla/test": "^3.0",
18-
"phpunit/phpunit": "^9.5.28",
19-
"psr/container": "^1.0",
20-
"squizlabs/php_codesniffer": "~3.7.2",
21-
"phpstan/phpstan": "1.12.27",
22-
"phpstan/phpstan-deprecation-rules": "1.2.1"
17+
"joomla/test": "dev-4.x-dev",
18+
"phpunit/phpunit": "^12.0",
19+
"psr/container": "^2.0",
20+
"squizlabs/php_codesniffer": "~3.10.2",
21+
"phpstan/phpstan": "2.1.17",
22+
"phpstan/phpstan-deprecation-rules": "2.0.3"
2323
},
2424
"suggest": {
2525
"psr/container-implementation": "To use the ContainerLoader"
@@ -38,7 +38,8 @@
3838
"extra": {
3939
"branch-alias": {
4040
"dev-2.0-dev": "2.0-dev",
41-
"dev-3.x-dev": "3.0-dev"
41+
"dev-3.x-dev": "3.0-dev",
42+
"dev-4.x-dev": "4.0-dev"
4243
}
4344
}
4445
}

src/Helper/DescriptorHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function describe(OutputInterface $output, $object, array $options = [])
4343
*
4444
* @since 2.0.0
4545
*/
46-
public function getName()
46+
public function getName(): string
4747
{
4848
return 'descriptor';
4949
}

tests/ApplicationTest.php

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
use Joomla\Event\Dispatcher;
2727
use Joomla\Test\TestHelper;
2828
use PHPUnit\Framework\TestCase;
29+
use PHPUnit\Framework\Attributes\DataProvider;
2930
use Psr\Container\ContainerInterface;
3031
use Psr\Container\NotFoundExceptionInterface;
3132
use Symfony\Component\Console\Exception\CommandNotFoundException;
@@ -151,15 +152,17 @@ public function testSetGetVersion()
151152
/**
152153
* Data provider for testGetLongVersion
153154
*
154-
* @return \Generator
155+
* @return array
155156
*/
156-
public function dataGetLongVersion(): \Generator
157+
public static function dataGetLongVersionProvider(): array
157158
{
158159
// Args: App Name, App Version, Expected Return
159-
yield 'Empty name and version' => ['', '', 'Joomla Console Application'];
160-
yield 'Name without version' => ['Console Application', '', 'Console Application'];
161-
yield 'Version without name' => ['', '1.0.0', 'Joomla Console Application <info>1.0.0</info>'];
162-
yield 'Version with name' => ['Console Application', '1.0.0', 'Console Application <info>1.0.0</info>'];
160+
return [
161+
'Empty name and version' => ['', '', 'Joomla Console Application'],
162+
'Name without version' => ['Console Application', '', 'Console Application'],
163+
'Version without name' => ['', '1.0.0', 'Joomla Console Application <info>1.0.0</info>'],
164+
'Version with name' => ['Console Application', '1.0.0', 'Console Application <info>1.0.0</info>'],
165+
];
163166
}
164167

165168
/**
@@ -171,6 +174,7 @@ public function dataGetLongVersion(): \Generator
171174
*
172175
* @dataProvider dataGetLongVersion
173176
*/
177+
#[DataProvider('dataGetLongVersionProvider')]
174178
public function testGetLongVersion(string $name, string $version, string $expected)
175179
{
176180
$this->object->setName($name);
@@ -696,7 +700,7 @@ public function get($id)
696700
return $this->services[$id]($this);
697701
}
698702

699-
public function has($id)
703+
public function has(string $id): bool
700704
{
701705
return isset($this->services[$id]);
702706
}

0 commit comments

Comments
 (0)