Commit version 24.12.13800
This commit is contained in:
@ -77,7 +77,7 @@ class Argument extends Memoize {
|
||||
* @return bool
|
||||
*/
|
||||
public function isLong() {
|
||||
return (0 == strncmp($this->_raw, '--', 2));
|
||||
return (0 == strncmp((string)$this->_raw, '--', 2));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -86,7 +86,7 @@ class Argument extends Memoize {
|
||||
* @return bool
|
||||
*/
|
||||
public function isShort() {
|
||||
return !$this->isLong && (0 == strncmp($this->_raw, '-', 1));
|
||||
return !$this->isLong && (0 == strncmp((string)$this->_raw, '-', 1));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -19,9 +19,9 @@ use cli\Arguments;
|
||||
*/
|
||||
class HelpScreen {
|
||||
protected $_flags = array();
|
||||
protected $_maxFlag = 0;
|
||||
protected $_flagMax = 0;
|
||||
protected $_options = array();
|
||||
protected $_maxOption = 0;
|
||||
protected $_optionMax = 0;
|
||||
|
||||
public function __construct(Arguments $arguments) {
|
||||
$this->setArguments($arguments);
|
||||
|
@ -15,6 +15,7 @@ namespace cli\arguments;
|
||||
use cli\Memoize;
|
||||
|
||||
class Lexer extends Memoize implements \Iterator {
|
||||
private $_item;
|
||||
private $_items = array();
|
||||
private $_index = 0;
|
||||
private $_length = 0;
|
||||
@ -33,6 +34,7 @@ class Lexer extends Memoize implements \Iterator {
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function current() {
|
||||
return $this->_item;
|
||||
}
|
||||
@ -49,6 +51,7 @@ class Lexer extends Memoize implements \Iterator {
|
||||
/**
|
||||
* Move the cursor forward 1 element if it is valid.
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function next() {
|
||||
if ($this->valid()) {
|
||||
$this->_shift();
|
||||
@ -60,6 +63,7 @@ class Lexer extends Memoize implements \Iterator {
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function key() {
|
||||
return $this->_index;
|
||||
}
|
||||
@ -68,6 +72,7 @@ class Lexer extends Memoize implements \Iterator {
|
||||
* Move forward 1 element and, if the method hasn't been called before, reset
|
||||
* the cursor's position to 0.
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function rewind() {
|
||||
$this->_shift();
|
||||
if ($this->_first) {
|
||||
@ -81,6 +86,7 @@ class Lexer extends Memoize implements \Iterator {
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function valid() {
|
||||
return ($this->_index < $this->_length);
|
||||
}
|
||||
|
Reference in New Issue
Block a user