mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 07:12:26 +02:00
✅ Make unit tests working
This commit is contained in:
@@ -68,7 +68,7 @@ class MappingRule
|
||||
|
||||
foreach ($childNames as $childName) {
|
||||
if (!$target->has($childName)) {
|
||||
throw new ErrorMappingException(sprintf('The child "%s" of "%s" mapped by the rule "%s" in "%s" does not exist.', $childName, $target->getName(), $this->targetPath, $this->origin->getName()));
|
||||
throw new ErrorMappingException(\sprintf('The child "%s" of "%s" mapped by the rule "%s" in "%s" does not exist.', $childName, $target->getName(), $this->targetPath, $this->origin->getName()));
|
||||
}
|
||||
$target = $target->get($childName);
|
||||
}
|
||||
|
||||
@@ -253,7 +253,7 @@ class ViolationMapper implements ViolationMapperInterface
|
||||
|
||||
// Test mapping rules as long as we have any
|
||||
foreach ($rules as $key => $rule) {
|
||||
/* @var MappingRule $rule */
|
||||
/** @var MappingRule $rule */
|
||||
|
||||
// Mapping rule matches completely, terminate.
|
||||
if (null !== ($form = $rule->match($chunk))) {
|
||||
@@ -317,7 +317,7 @@ class ViolationMapper implements ViolationMapperInterface
|
||||
// Cut the piece out of the property path and proceed
|
||||
$propertyPathBuilder->remove($i);
|
||||
} else {
|
||||
/* @var \Symfony\Component\PropertyAccess\PropertyPathInterface $propertyPath */
|
||||
/** @var \Symfony\Component\PropertyAccess\PropertyPathInterface $propertyPath */
|
||||
$propertyPath = $scope->getPropertyPath();
|
||||
|
||||
if (null === $propertyPath) {
|
||||
|
||||
@@ -132,7 +132,7 @@ class ViolationPath 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 violation path.', $index));
|
||||
throw new OutOfBoundsException(\sprintf('The index "%s" is not within the violation path.', $index));
|
||||
}
|
||||
|
||||
return $this->elements[$index];
|
||||
@@ -141,7 +141,7 @@ class ViolationPath 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 violation path.', $index));
|
||||
throw new OutOfBoundsException(\sprintf('The index "%s" is not within the violation path.', $index));
|
||||
}
|
||||
|
||||
return !$this->isIndex[$index];
|
||||
@@ -150,7 +150,7 @@ class ViolationPath 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 violation path.', $index));
|
||||
throw new OutOfBoundsException(\sprintf('The index "%s" is not within the violation path.', $index));
|
||||
}
|
||||
|
||||
return $this->isIndex[$index];
|
||||
@@ -176,7 +176,7 @@ class ViolationPath implements \IteratorAggregate, PropertyPathInterface
|
||||
public function mapsForm(int $index): bool
|
||||
{
|
||||
if (!isset($this->mapsForm[$index])) {
|
||||
throw new OutOfBoundsException(sprintf('The index "%s" is not within the violation path.', $index));
|
||||
throw new OutOfBoundsException(\sprintf('The index "%s" is not within the violation path.', $index));
|
||||
}
|
||||
|
||||
return $this->mapsForm[$index];
|
||||
|
||||
Reference in New Issue
Block a user