mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-18 14:58:43 +02:00
✅ Make unit tests working
This commit is contained in:
@@ -72,7 +72,6 @@ class PropertyPath implements \IteratorAggregate, PropertyPathInterface
|
||||
{
|
||||
// Can be used as copy constructor
|
||||
if ($propertyPath instanceof self) {
|
||||
/* @var PropertyPath $propertyPath */
|
||||
$this->elements = $propertyPath->elements;
|
||||
$this->length = $propertyPath->length;
|
||||
$this->isIndex = $propertyPath->isIndex;
|
||||
@@ -122,7 +121,7 @@ class PropertyPath implements \IteratorAggregate, PropertyPathInterface
|
||||
}
|
||||
|
||||
if ('' !== $remaining) {
|
||||
throw new InvalidPropertyPathException(sprintf('Could not parse property path "%s". Unexpected token "%s" at position %d.', $propertyPath, $remaining[0], $position));
|
||||
throw new InvalidPropertyPathException(\sprintf('Could not parse property path "%s". Unexpected token "%s" at position %d.', $propertyPath, $remaining[0], $position));
|
||||
}
|
||||
|
||||
$this->length = \count($this->elements);
|
||||
@@ -171,7 +170,7 @@ class PropertyPath implements \IteratorAggregate, PropertyPathInterface
|
||||
public function getElement(int $index): string
|
||||
{
|
||||
if (!isset($this->elements[$index])) {
|
||||
throw new OutOfBoundsException(sprintf('The index "%s" is not within the property path.', $index));
|
||||
throw new OutOfBoundsException(\sprintf('The index "%s" is not within the property path.', $index));
|
||||
}
|
||||
|
||||
return $this->elements[$index];
|
||||
@@ -180,7 +179,7 @@ class PropertyPath implements \IteratorAggregate, PropertyPathInterface
|
||||
public function isProperty(int $index): bool
|
||||
{
|
||||
if (!isset($this->isIndex[$index])) {
|
||||
throw new OutOfBoundsException(sprintf('The index "%s" is not within the property path.', $index));
|
||||
throw new OutOfBoundsException(\sprintf('The index "%s" is not within the property path.', $index));
|
||||
}
|
||||
|
||||
return !$this->isIndex[$index];
|
||||
@@ -189,7 +188,7 @@ class PropertyPath implements \IteratorAggregate, PropertyPathInterface
|
||||
public function isIndex(int $index): bool
|
||||
{
|
||||
if (!isset($this->isIndex[$index])) {
|
||||
throw new OutOfBoundsException(sprintf('The index "%s" is not within the property path.', $index));
|
||||
throw new OutOfBoundsException(\sprintf('The index "%s" is not within the property path.', $index));
|
||||
}
|
||||
|
||||
return $this->isIndex[$index];
|
||||
@@ -198,7 +197,7 @@ class PropertyPath implements \IteratorAggregate, PropertyPathInterface
|
||||
public function isNullSafe(int $index): bool
|
||||
{
|
||||
if (!isset($this->isNullSafe[$index])) {
|
||||
throw new OutOfBoundsException(sprintf('The index "%s" is not within the property path.', $index));
|
||||
throw new OutOfBoundsException(\sprintf('The index "%s" is not within the property path.', $index));
|
||||
}
|
||||
|
||||
return $this->isNullSafe[$index];
|
||||
|
||||
Reference in New Issue
Block a user