Skip to content

Commit 237f70e

Browse files
committed
Add support for PHP 8.4
1 parent 39d0bf4 commit 237f70e

File tree

13 files changed

+30
-16
lines changed

13 files changed

+30
-16
lines changed

.github/workflows/buildcheck.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
- "8.1"
2020
- "8.2"
2121
- "8.3"
22+
- "8.4"
2223
composer:
2324
- ""
2425
- "--prefer-lowest"

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
Changelog
22
=========
33

4+
Adds methods in Progress to return the current value and total value of the progress bar. (#206)
5+
--------
6+
7+
## 3.10.0 - 2024-11-18
8+
9+
### Added
10+
11+
* [Progress] Added methods to get the current and total values. [#206](https://github.com/thephpleague/climate/pull/206)
12+
13+
### Changed
14+
15+
* [Support] Added support for PHP 8.4.
16+
417
--------
518

619
## 3.9.0 - 2024-10-30

src/Argument/Manager.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public function all()
142142
*
143143
* @return bool
144144
*/
145-
public function defined($name, array $argv = null)
145+
public function defined($name, ?array $argv = null)
146146
{
147147
// The argument isn't defined if it's not defined by the calling code.
148148
if (!$this->exists($name)) {
@@ -217,7 +217,7 @@ public function description($description)
217217
* @param CLImate $climate
218218
* @param array $argv
219219
*/
220-
public function usage(CLImate $climate, array $argv = null)
220+
public function usage(CLImate $climate, ?array $argv = null)
221221
{
222222
$this->summary
223223
->setClimate($climate)
@@ -232,7 +232,7 @@ public function usage(CLImate $climate, array $argv = null)
232232
*
233233
* @param array $argv
234234
*/
235-
public function parse(array $argv = null)
235+
public function parse(?array $argv = null)
236236
{
237237
$this->parser->setFilter($this->filter, $this->all());
238238

src/Argument/Parser.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function setFilter($filter, $arguments)
6868
* @return void
6969
* @throws InvalidArgumentException if required arguments aren't defined.
7070
*/
71-
public function parse(array $argv = null)
71+
public function parse(?array $argv = null)
7272
{
7373
$cliArguments = $this->arguments($argv);
7474

@@ -103,7 +103,7 @@ public function parse(array $argv = null)
103103
*
104104
* @return string
105105
*/
106-
public function command(array $argv = null)
106+
public function command(?array $argv = null)
107107
{
108108
return $this->getCommandAndArguments($argv)['command'];
109109
}
@@ -115,7 +115,7 @@ public function command(array $argv = null)
115115
*
116116
* @return array
117117
*/
118-
public function arguments(array $argv = null)
118+
public function arguments(?array $argv = null)
119119
{
120120
return $this->getCommandAndArguments($argv)['arguments'];
121121
}
@@ -315,7 +315,7 @@ protected function findPrefixedArgument($name)
315315
* @param array $argv
316316
* @return array
317317
*/
318-
protected function getCommandAndArguments(array $argv = null)
318+
protected function getCommandAndArguments(?array $argv = null)
319319
{
320320
// If no $argv is provided then use the global PHP defined $argv.
321321
if (is_null($argv)) {

src/CLImate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ public function to($writer)
257257
* @param array $argv
258258
* @return void
259259
*/
260-
public function usage(array $argv = null)
260+
public function usage(?array $argv = null)
261261
{
262262
$this->arguments->usage($this, $argv);
263263
}

src/Logger.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class Logger extends AbstractLogger
4646
* @param string $level One of the LogLevel constants
4747
* @param CLImate $climate An existing CLImate instance to use for output
4848
*/
49-
public function __construct($level = LogLevel::INFO, CLImate $climate = null)
49+
public function __construct($level = LogLevel::INFO, ?CLImate $climate = null)
5050
{
5151
$this->level = $this->convertLevel($level);
5252

src/TerminalObject/Dynamic/Animation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Animation extends DynamicTerminalObject
2020
*/
2121
protected $keyframes;
2222

23-
public function __construct($art, Sleeper $sleeper = null, Keyframe $keyframes = null)
23+
public function __construct($art, ?Sleeper $sleeper = null, ?Keyframe $keyframes = null)
2424
{
2525
// Add the default art directory
2626
$this->addDir(__DIR__ . \DIRECTORY_SEPARATOR . '..' . \DIRECTORY_SEPARATOR . '..' . \DIRECTORY_SEPARATOR . 'ASCII');

src/TerminalObject/Dynamic/Checkboxes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Checkboxes extends InputAbstract
1414
*/
1515
protected $checkboxes;
1616

17-
public function __construct($prompt, array $options, ReaderInterface $reader = null)
17+
public function __construct($prompt, array $options, ?ReaderInterface $reader = null)
1818
{
1919
$this->prompt = $prompt;
2020
$this->reader = $reader ?: new Stdin();

src/TerminalObject/Dynamic/Confirm.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Confirm extends Input
1313
/**
1414
* @inheritdoc
1515
*/
16-
public function __construct($prompt, ReaderInterface $reader = null)
16+
public function __construct($prompt, ?ReaderInterface $reader = null)
1717
{
1818
parent::__construct($prompt, $reader);
1919

src/TerminalObject/Dynamic/Input.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class Input extends InputAbstract
4545
*/
4646
protected $default = '';
4747

48-
public function __construct($prompt, ReaderInterface $reader = null)
48+
public function __construct($prompt, ?ReaderInterface $reader = null)
4949
{
5050
$this->prompt = $prompt;
5151
$this->reader = $reader ?: new Stdin();

0 commit comments

Comments
 (0)