Skip to content

Commit c056c91

Browse files
Wout Gevaerttransistive
authored andcommitted
Fix codestyle
1 parent 573794f commit c056c91

File tree

4 files changed

+23
-18
lines changed

4 files changed

+23
-18
lines changed

src/Formatter/Specialised/BoltOGMTranslator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
use Bolt\structures\Relationship as BoltRelationship;
2727
use Bolt\structures\Time as BoltTime;
2828
use Bolt\structures\UnboundRelationship as BoltUnboundRelationship;
29+
use function call_user_func;
2930
use Laudis\Neo4j\Types\Abstract3DPoint;
3031
use Laudis\Neo4j\Types\AbstractPoint;
3132
use Laudis\Neo4j\Types\Cartesian3DPoint;
@@ -46,7 +47,6 @@
4647
use Laudis\Neo4j\Types\WGS843DPoint;
4748
use Laudis\Neo4j\Types\WGS84Point;
4849
use UnexpectedValueException;
49-
use function call_user_func;
5050

5151
/**
5252
* Translates Bolt objects to Driver Types.

src/Formatter/Specialised/HttpMetaInfo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212
namespace Laudis\Neo4j\Formatter\Specialised;
1313

14-
use stdClass;
1514
use function is_array;
15+
use stdClass;
1616

1717
/**
1818
* @psalm-immutable

src/Formatter/Specialised/JoltHttpOGMTranslator.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
use Psr\Http\Message\RequestInterface;
2020
use Psr\Http\Message\ResponseInterface;
2121
use stdClass;
22-
use UnexpectedValueException;
2322
use function strtolower;
23+
use UnexpectedValueException;
2424

2525
/**
2626
* @psalm-immutable
@@ -74,10 +74,11 @@ public function formatHttpResult(
7474
foreach ($data as $key => $value) {
7575
$row[$fields[$key]] = $this->translateJoltType($value);
7676
}
77-
$rows []= new CypherMap($row);
77+
$rows[] = new CypherMap($row);
7878
}
79-
$allResults []= new CypherList($rows);
79+
$allResults[] = new CypherList($rows);
8080
}
81+
8182
return new CypherList($allResults);
8283
}
8384

@@ -89,6 +90,7 @@ private function translateDateTime(string $datetime)
8990

9091
/**
9192
* Assumes that 2D points are of the form "SRID=$srid;POINT($x $y)" and 3D points are of the form "SRID=$srid;POINT Z($x $y $z)".
93+
*
9294
* @throws UnexpectedValueException
9395
*/
9496
private function translatePoint(string $value): PointInterface
@@ -133,6 +135,7 @@ private function getSRID(string $value): int
133135
if (!preg_match('/^SRID=([0-9]+)$/', $value, $matches)) {
134136
throw new UnexpectedValueException('Unexpected SRID string: '.$value);
135137
}
138+
136139
return (int) $matches[1];
137140
}
138141

@@ -152,6 +155,7 @@ private function getCoordinates(string $value): array
152155
throw new UnexpectedValueException('Expected 2 coordinates in string: '.$value);
153156
}
154157
}
158+
155159
return $coordinates;
156160
}
157161

@@ -184,13 +188,14 @@ private function translatePath(array $value)
184188
$ids = [];
185189
foreach ($value as $i => $nodeOrRelation) {
186190
$nodeOrRelation = $this->translateJoltType($nodeOrRelation);
187-
if ($i%2) {
191+
if ($i % 2) {
188192
$relations[] = $nodeOrRelation;
189193
} else {
190194
$nodes[] = $nodeOrRelation;
191195
}
192196
$ids[] = $nodeOrRelation->getId();
193197
}
198+
194199
return new Path(new CypherList($nodes), new CypherList($relations), new CypherList($ids));
195200
}
196201

src/Formatter/Specialised/LegacyHttpOGMTranslator.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,19 @@
1111

1212
namespace Laudis\Neo4j\Formatter\Specialised;
1313

14+
use function array_combine;
15+
use function array_key_exists;
16+
use function count;
17+
use function date;
1418
use DateInterval;
1519
use DateTimeImmutable;
1620
use Exception;
21+
use function explode;
22+
use function is_array;
23+
use function is_object;
24+
use function is_string;
25+
use function json_encode;
26+
use const JSON_THROW_ON_ERROR;
1727
use Laudis\Neo4j\Contracts\ConnectionInterface;
1828
use Laudis\Neo4j\Contracts\PointInterface;
1929
use Laudis\Neo4j\Formatter\OGMFormatter;
@@ -36,21 +46,11 @@
3646
use Psr\Http\Message\RequestInterface;
3747
use Psr\Http\Message\ResponseInterface;
3848
use RuntimeException;
39-
use stdClass;
40-
use UnexpectedValueException;
41-
use function array_combine;
42-
use function array_key_exists;
43-
use function count;
44-
use function date;
45-
use function explode;
46-
use function is_array;
47-
use function is_object;
48-
use function is_string;
49-
use function json_encode;
5049
use function sprintf;
50+
use stdClass;
5151
use function str_pad;
5252
use function substr;
53-
use const JSON_THROW_ON_ERROR;
53+
use UnexpectedValueException;
5454

5555
/**
5656
* @psalm-import-type OGMTypes from OGMFormatter

0 commit comments

Comments
 (0)