From 1ed1d80adbeae5d9aa0aa8a148094e6463e89bb3 Mon Sep 17 00:00:00 2001 From: Andor Date: Thu, 29 Dec 2022 15:56:34 +0100 Subject: [PATCH] Issue #1135 - PHP 8.2 - Fix Use of "self" in callables is deprecated (#1136) --- src/Common/CommandArguments.php | 2 +- tests/phpunit/Task/ExecTest.php | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 tests/phpunit/Task/ExecTest.php diff --git a/src/Common/CommandArguments.php b/src/Common/CommandArguments.php index d1984cff4..4fc3a90f8 100644 --- a/src/Common/CommandArguments.php +++ b/src/Common/CommandArguments.php @@ -40,7 +40,7 @@ public function args($args) if (!is_array($args)) { $args = $func_args; } - $this->arguments .= ' ' . implode(' ', array_map(static::class . '::escape', $args)); + $this->arguments .= ' ' . implode(' ', array_map([static::class, 'escape'], $args)); return $this; } diff --git a/tests/phpunit/Task/ExecTest.php b/tests/phpunit/Task/ExecTest.php new file mode 100644 index 000000000..cd8d958f4 --- /dev/null +++ b/tests/phpunit/Task/ExecTest.php @@ -0,0 +1,19 @@ +assertSame( + 'ls', + (new \Robo\Task\Base\Exec('ls')) + ->getCommand() + ); + } +}