Skip to content

Apply fixes from StyleCI #215

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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