Skip to content

Commit 7ddbdea

Browse files
committed
wip
1 parent dceaa13 commit 7ddbdea

11 files changed

+24
-36
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ infection.html
88
/.php-cs-fixer.cache
99
/tmp/
1010
/docs/.npm/
11+
/docs/.config/
1112
composer.lock

src/Contract/ConstraintInterface.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44

55
namespace Syndesi\CypherDataStructures\Contract;
66

7-
use Stringable;
8-
9-
interface ConstraintInterface extends Stringable, IsEqualToInterface, HasPropertiesInterface, HasOptionsInterface
7+
interface ConstraintInterface extends \Stringable, IsEqualToInterface, HasPropertiesInterface, HasOptionsInterface
108
{
119
public function getName(): ?string;
1210

src/Contract/IndexInterface.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44

55
namespace Syndesi\CypherDataStructures\Contract;
66

7-
use Stringable;
8-
9-
interface IndexInterface extends Stringable, IsEqualToInterface, HasPropertiesInterface, HasOptionsInterface
7+
interface IndexInterface extends \Stringable, IsEqualToInterface, HasPropertiesInterface, HasOptionsInterface
108
{
119
public function getName(): ?string;
1210

src/Contract/NodeInterface.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44

55
namespace Syndesi\CypherDataStructures\Contract;
66

7-
use Stringable;
8-
9-
interface NodeInterface extends Stringable, IsEqualToInterface, HasIdentifiersInterface
7+
interface NodeInterface extends \Stringable, IsEqualToInterface, HasIdentifiersInterface
108
{
119
public function addLabel(string $label): self;
1210

src/Contract/RelationInterface.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44

55
namespace Syndesi\CypherDataStructures\Contract;
66

7-
use Stringable;
8-
9-
interface RelationInterface extends Stringable, IsEqualToInterface, HasIdentifiersInterface
7+
interface RelationInterface extends \Stringable, IsEqualToInterface, HasIdentifiersInterface
108
{
119
public function setStartNode(?NodeInterface $node): self;
1210

src/Exception/CypherDataStructureException.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
namespace Syndesi\CypherDataStructures\Exception;
66

7-
use Exception;
8-
9-
class CypherDataStructureException extends Exception
7+
class CypherDataStructureException extends \Exception
108
{
119
}

src/Helper/ToStringHelper.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
namespace Syndesi\CypherDataStructures\Helper;
66

7-
use Exception;
8-
use Stringable;
97
use Syndesi\CypherDataStructures\Contract\NodeConstraintInterface;
108
use Syndesi\CypherDataStructures\Contract\NodeIndexInterface;
119
use Syndesi\CypherDataStructures\Contract\NodeInterface;
@@ -48,7 +46,7 @@ public static function mustLabelBeEscaped(string $string): bool
4846

4947
/**
5048
* @throws InvalidArgumentException
51-
* @throws Exception
49+
* @throws \Exception
5250
*/
5351
public static function escapeString(string $string, string $character = '\''): string
5452
{
@@ -79,7 +77,7 @@ function ($match) {
7977
if (null === $escapedString) {
8078
// @codeCoverageIgnoreStart
8179
// @infection-ignore-all
82-
throw new Exception(preg_last_error_msg());
80+
throw new \Exception(preg_last_error_msg());
8381
// @codeCoverageIgnoreEnd
8482
}
8583

@@ -111,7 +109,7 @@ public static function valueToString(mixed $value): string
111109
return sprintf("[%s]", $parts);
112110
}
113111
if (is_object($value)) {
114-
if ($value instanceof Stringable) {
112+
if ($value instanceof \Stringable) {
115113
return (string) $value;
116114
}
117115
}

tests/Exception/CypherDataStructureExceptionTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace Syndesi\CypherDataStructures\Tests\Exception;
66

7-
use Exception;
87
use PHPUnit\Framework\TestCase;
98
use Syndesi\CypherDataStructures\Exception\CypherDataStructureException;
109

@@ -13,6 +12,6 @@ class CypherDataStructureExceptionTest extends TestCase
1312
public function testInstanceOf(): void
1413
{
1514
$exception = new CypherDataStructureException('some message');
16-
$this->assertInstanceOf(Exception::class, $exception);
15+
$this->assertInstanceOf(\Exception::class, $exception);
1716
}
1817
}

tests/Exception/InvalidArgumentExceptionTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,15 @@
44

55
namespace Syndesi\CypherDataStructures\Tests\Exception;
66

7-
use DateTime;
87
use PHPUnit\Framework\TestCase;
9-
use stdClass;
108
use Syndesi\CypherDataStructures\Exception\CypherDataStructureException;
119
use Syndesi\CypherDataStructures\Exception\InvalidArgumentException;
1210

1311
class InvalidArgumentExceptionTest extends TestCase
1412
{
1513
public function testCreateForTypeMismatch(): void
1614
{
17-
$exception = InvalidArgumentException::createForTypeMismatch(DateTime::class, stdClass::class);
15+
$exception = InvalidArgumentException::createForTypeMismatch(\DateTime::class, \stdClass::class);
1816
$this->assertSame("Expected type 'DateTime', got type 'stdClass'", $exception->getMessage());
1917
$this->assertInstanceOf(CypherDataStructureException::class, $exception);
2018
}

tests/Exception/LogicExceptionTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,15 @@
44

55
namespace Syndesi\CypherDataStructures\Tests\Exception;
66

7-
use DateTime;
87
use PHPUnit\Framework\TestCase;
9-
use stdClass;
108
use Syndesi\CypherDataStructures\Exception\CypherDataStructureException;
119
use Syndesi\CypherDataStructures\Exception\LogicException;
1210

1311
class LogicExceptionTest extends TestCase
1412
{
1513
public function testCreateForInternalTypeMismatch(): void
1614
{
17-
$exception = LogicException::createForInternalTypeMismatch(DateTime::class, stdClass::class);
15+
$exception = LogicException::createForInternalTypeMismatch(\DateTime::class, \stdClass::class);
1816
$this->assertSame("Internal type mismatch, expected type 'DateTime', got type 'stdClass'", $exception->getMessage());
1917
$this->assertInstanceOf(CypherDataStructureException::class, $exception);
2018
}

0 commit comments

Comments
 (0)