Skip to content

Commit f8f340e

Browse files
authored
Merge pull request #147 from aerogus/master
hide deprecated warning in php8.1
2 parents 191d79b + d4750b7 commit f8f340e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/cli/Arguments.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ public function asJSON() {
8686
* @param mixed $offset An Argument object or the name of the argument.
8787
* @return bool
8888
*/
89+
#[\ReturnTypeWillChange]
8990
public function offsetExists($offset) {
9091
if ($offset instanceOf Argument) {
9192
$offset = $offset->key;
@@ -100,6 +101,7 @@ public function offsetExists($offset) {
100101
* @param mixed $offset An Argument object or the name of the argument.
101102
* @return mixed
102103
*/
104+
#[\ReturnTypeWillChange]
103105
public function offsetGet($offset) {
104106
if ($offset instanceOf Argument) {
105107
$offset = $offset->key;
@@ -116,6 +118,7 @@ public function offsetGet($offset) {
116118
* @param mixed $offset An Argument object or the name of the argument.
117119
* @param mixed $value The value to set
118120
*/
121+
#[\ReturnTypeWillChange]
119122
public function offsetSet($offset, $value) {
120123
if ($offset instanceOf Argument) {
121124
$offset = $offset->key;
@@ -129,6 +132,7 @@ public function offsetSet($offset, $value) {
129132
*
130133
* @param mixed $offset An Argument object or the name of the argument.
131134
*/
135+
#[\ReturnTypeWillChange]
132136
public function offsetUnset($offset) {
133137
if ($offset instanceOf Argument) {
134138
$offset = $offset->key;

lib/cli/arguments/Argument.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function raw() {
7777
* @return bool
7878
*/
7979
public function isLong() {
80-
return (0 == strncmp($this->_raw, '--', 2));
80+
return (0 == strncmp((string)$this->_raw, '--', 2));
8181
}
8282

8383
/**
@@ -86,7 +86,7 @@ public function isLong() {
8686
* @return bool
8787
*/
8888
public function isShort() {
89-
return !$this->isLong && (0 == strncmp($this->_raw, '-', 1));
89+
return !$this->isLong && (0 == strncmp((string)$this->_raw, '-', 1));
9090
}
9191

9292
/**

0 commit comments

Comments
 (0)