Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3800338
D2653.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D2653.diff
View Options
diff --git a/commands/LICENSE b/commands/LICENSE
--- a/commands/LICENSE
+++ b/commands/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2002, 2010, 2018 Sébastien Santoro aka Dereckson
+Copyright (c) 2002, 2010, 2018, 2022 Sébastien Santoro aka Dereckson
Some rights reserved.
Redistribution and use in source and binary forms, with or without
diff --git a/commands/composer.json b/commands/composer.json
--- a/commands/composer.json
+++ b/commands/composer.json
@@ -18,7 +18,7 @@
"require": {
},
"require-dev": {
- "phan/phan": "^0.12.3",
+ "phan/phan": "^5.3",
"phpunit/phpunit": "^9.5.13",
"squizlabs/php_codesniffer": "^3"
}
diff --git a/commands/src/Command.php b/commands/src/Command.php
--- a/commands/src/Command.php
+++ b/commands/src/Command.php
@@ -7,29 +7,13 @@
abstract class Command {
- /**
- * @var int
- */
- private $argc;
-
- /**
- * @var array
- */
- private $argv;
-
- /**
- * @var \Keruald\Commands\Display\Display
- */
- protected $display;
+ protected Display $display;
public function __construct (
- int $argc,
- array $argv,
+ public int $argc,
+ public array $argv,
Display $display = null
) {
- $this->argc = $argc;
- $this->argv = $argv;
-
if ($display === null) {
$display = self::getDefaultDisplay();
}
@@ -46,21 +30,33 @@
/// Getters and setters
///
+ /**
+ * @deprecated Use directly Command::$argc
+ */
public function getArgc () : int {
return $this->argc;
}
+ /**
+ * @deprecated Use directly Command::$argc
+ */
public function setArgc (int $argc) : Command {
$this->argc = $argc;
return $this;
}
+ /**
+ * @deprecated Use directly Command::$argv
+ */
public function getArgv () : array {
return $this->argv;
}
+ /**
+ * @deprecated Use directly Command::$argv
+ */
public function setArgv (array $argv) : Command {
$this->argv = $argv;
diff --git a/commands/src/Display/ArrayDisplay.php b/commands/src/Display/ArrayDisplay.php
--- a/commands/src/Display/ArrayDisplay.php
+++ b/commands/src/Display/ArrayDisplay.php
@@ -12,14 +12,14 @@
class ArrayDisplay extends Display {
/**
- * @var array
+ * @var string[]
*/
- private $out = [];
+ private array $out = [];
/**
- * @var array
+ * @var string[]
*/
- private $error = [];
+ private array $error = [];
///
/// Implement Display
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 30, 01:34 (21 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2272220
Default Alt Text
D2653.diff (2 KB)
Attached To
Mode
D2653: Modernize code to PHP 8.1 standard
Attached
Detach File
Event Timeline
Log In to Comment