Skip to content

Commit

Permalink
Merge pull request #215 from phpcr/analysis-Bo5wb7
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
dbu authored Sep 19, 2023
2 parents 50e99c9 + 7d05a34 commit f675f64
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 12 deletions.
3 changes: 0 additions & 3 deletions src/PHPCR/Util/CND/Scanner/GenericScanner.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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") {
Expand Down
3 changes: 1 addition & 2 deletions src/PHPCR/Util/PathHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion src/PHPCR/Util/TreeWalker.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/PHPCR/Util/ValueConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
3 changes: 1 addition & 2 deletions tests/PHPCR/Tests/Util/NodeHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down
6 changes: 3 additions & 3 deletions tests/PHPCR/Tests/Util/ValueConverterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down

0 comments on commit f675f64

Please sign in to comment.