From 7d05a34323124e406337c6981472b72c0f3e249e Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Tue, 19 Sep 2023 17:02:28 +0000 Subject: [PATCH] Apply fixes from StyleCI --- src/PHPCR/Util/CND/Scanner/GenericScanner.php | 3 --- src/PHPCR/Util/PathHelper.php | 3 +-- src/PHPCR/Util/TreeWalker.php | 1 - src/PHPCR/Util/ValueConverter.php | 2 +- tests/PHPCR/Tests/Util/NodeHelperTest.php | 3 +-- tests/PHPCR/Tests/Util/ValueConverterTest.php | 6 +++--- 6 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/PHPCR/Util/CND/Scanner/GenericScanner.php b/src/PHPCR/Util/CND/Scanner/GenericScanner.php index edc1d00c..76ccecd5 100644 --- a/src/PHPCR/Util/CND/Scanner/GenericScanner.php +++ b/src/PHPCR/Util/CND/Scanner/GenericScanner.php @@ -165,13 +165,11 @@ protected function consumeBlockComments(ReaderInterface $reader) $nextChar = $reader->currentChar(); foreach ($this->context->getBlockCommentDelimiters() as $beginDelim => $endDelim) { if ($nextChar === $beginDelim[0]) { - // Lookup the start delimiter for ($i = 1; $i <= strlen($beginDelim); $i++) { $reader->forward(); } if ($reader->current() === $beginDelim) { - // Start delimiter found, let's try to find the end delimiter $nextChar = $reader->forwardChar(); @@ -223,7 +221,6 @@ protected function consumeLineComments(ReaderInterface $reader) } if ($reader->current() === $delimiter) { - // consume to end of line $char = $reader->currentChar(); while (!$reader->isEof() && $char !== "\n") { diff --git a/src/PHPCR/Util/PathHelper.php b/src/PHPCR/Util/PathHelper.php index 03941636..8fba4160 100644 --- a/src/PHPCR/Util/PathHelper.php +++ b/src/PHPCR/Util/PathHelper.php @@ -165,8 +165,7 @@ public static function normalizePath($path, $destination = false, $throw = true) } $normalizedPath = count($finalParts) > 1 ? implode('/', $finalParts) : - '/' // first element is always the empty-name root element. this might have been a path like /x/.. -; + '/'; // first element is always the empty-name root element. this might have been a path like /x/.. if (!self::assertValidAbsolutePath($normalizedPath, $destination, $throw)) { return false; diff --git a/src/PHPCR/Util/TreeWalker.php b/src/PHPCR/Util/TreeWalker.php index 94b460f1..2eaf6e3c 100644 --- a/src/PHPCR/Util/TreeWalker.php +++ b/src/PHPCR/Util/TreeWalker.php @@ -125,7 +125,6 @@ protected function mustVisitProperty(PropertyInterface $property) public function traverse(NodeInterface $node, $recurse = -1, $level = 0): void { if ($this->mustVisitNode($node)) { - // Visit node if (method_exists($this->nodeVisitor, 'setLevel')) { $this->nodeVisitor->setLevel($level); diff --git a/src/PHPCR/Util/ValueConverter.php b/src/PHPCR/Util/ValueConverter.php index 343a93d3..859cdfec 100644 --- a/src/PHPCR/Util/ValueConverter.php +++ b/src/PHPCR/Util/ValueConverter.php @@ -167,7 +167,7 @@ public function convertType($value, $type, $srcType = PropertyType::UNDEFINED) case PropertyType::NAME: case PropertyType::PATH: // TODO: The name/path is converted to qualified form according to the current local namespace mapping (see ยง3.2.5.2 Qualified Form). - return $value; + return $value; default: if (is_object($value)) { throw new ValueFormatException('Cannot convert object of class "'.get_class($value).'" to STRING'); diff --git a/tests/PHPCR/Tests/Util/NodeHelperTest.php b/tests/PHPCR/Tests/Util/NodeHelperTest.php index 5a1f392a..bebad5e2 100644 --- a/tests/PHPCR/Tests/Util/NodeHelperTest.php +++ b/tests/PHPCR/Tests/Util/NodeHelperTest.php @@ -117,8 +117,7 @@ public function testIsSystemItem() $top->expects($this->once()) ->method('getName') - ->willReturn('jcrname') // this is NOT in the jcr namespace -; + ->willReturn('jcrname'); // this is NOT in the jcr namespace $this->assertFalse(NodeHelper::isSystemItem($top)); diff --git a/tests/PHPCR/Tests/Util/ValueConverterTest.php b/tests/PHPCR/Tests/Util/ValueConverterTest.php index f14e55b9..65002a7c 100644 --- a/tests/PHPCR/Tests/Util/ValueConverterTest.php +++ b/tests/PHPCR/Tests/Util/ValueConverterTest.php @@ -269,9 +269,9 @@ public function dataConversionMatrix() * Skip binary target as its a special case. * * @param mixed $value - * @param int $srcType PropertyType constant to convert from - * @param $expected - * @param $targetType + * @param int $srcType PropertyType constant to convert from + * @param $expected + * @param $targetType * * @dataProvider dataConversionMatrix */