Skip to content
This repository was archived by the owner on Dec 1, 2021. It is now read-only.

Commit db05719

Browse files
committed
fix code style and static analysis warnings
1 parent 8f73160 commit db05719

16 files changed

+26
-31
lines changed

src/Client.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function __construct(ConnectionManager $connectionManager, EventDispatche
4747
/**
4848
* Run a Cypher statement against the default database or the database specified.
4949
*
50-
* @param $query
50+
* @param string $query
5151
* @param null|array $parameters
5252
* @param null|string $tag
5353
* @param null|string $connectionAlias
@@ -74,7 +74,7 @@ public function run($query, $parameters = null, $tag = null, $connectionAlias =
7474
throw $e;
7575
}
7676

77-
return;
77+
return null;
7878
}
7979

8080
return $result;

src/ClientBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function addConnection($alias, $uri, ConfigInterface $config = null)
8888
$this->config['connections'][$alias]['uri'] = $uri;
8989

9090
if (null !== $config) {
91-
if ($this->config['connections'][$alias]['config'] = $config);
91+
$this->config['connections'][$alias]['config'] = $config;
9292
}
9393

9494
return $this;

src/ClientInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ interface ClientInterface
2727
/**
2828
* Run a Cypher statement against the default database or the database specified.
2929
*
30-
* @param $query
30+
* @param string $query
3131
* @param null|array $parameters
3232
* @param null|string $tag
3333
* @param null|string $connectionAlias

src/Connection/Connection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ private function buildDriver()
174174
$port = isset($params['port']) ? (int) $params['port'] : BoltDriver::DEFAULT_TCP_PORT;
175175
$uri = sprintf('%s://%s:%d', $params['scheme'], $params['host'], $port);
176176
$config = null;
177-
if (isset($params['user']) && isset($params['pass'])) {
177+
if (isset($params['user'], $params['pass'])) {
178178
$config = BoltConfiguration::create()->withCredentials($params['user'], $params['pass']);
179179
}
180180
$this->driver = BoltGraphDB::driver($uri, $config);

src/Exception/Neo4jException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function classification()
5454
{
5555
$parts = explode('.', $this->statusCode);
5656
if (!isset($parts[1])) {
57-
throw new \InvalidArgumentException(sprintf('Could not parse exception classification "%"', $this->statusCode));
57+
throw new \InvalidArgumentException(sprintf('Could not parse exception classification "%s"', $this->statusCode));
5858
}
5959

6060
return $parts[1];

src/Exception/NeoClientExceptionInterface.php

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

1212
namespace GraphAware\Neo4j\Client\Exception;
1313

14-
interface NeoClientExceptionInterface
14+
interface NeoClientExceptionInterface extends \Throwable
1515
{
1616
}

src/Formatter/RecordView.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ public function hasValues()
6464
}
6565

6666
/**
67+
* @deprecated Use <code>get()</code> instead
6768
* @param string $key
6869
*
6970
* @return \GraphAware\Neo4j\Client\Formatter\Type\Node|\GraphAware\Neo4j\Client\Formatter\Type\Relationship

src/Formatter/Response.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,8 @@ class Response
3434
public function setRawResponse($rawResponse)
3535
{
3636
$this->rawResponse = $rawResponse;
37-
38-
if (isset($rawResponse['errors'])) {
39-
if (!empty($rawResponse['errors'])) {
40-
$this->errors = $rawResponse['errors'][0];
41-
}
37+
if (!empty($rawResponse['errors'])) {
38+
$this->errors = $rawResponse['errors'][0];
4239
}
4340
}
4441

src/Formatter/Result.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
use GraphAware\Common\Cypher\StatementInterface;
1515
use GraphAware\Common\Result\AbstractRecordCursor;
16-
use GraphAware\Common\Result\Record;
1716
use GraphAware\Neo4j\Client\Formatter\Type\Node;
1817
use GraphAware\Neo4j\Client\Formatter\Type\Path;
1918
use GraphAware\Neo4j\Client\Formatter\Type\Relationship;
@@ -22,11 +21,6 @@
2221

2322
class Result extends AbstractRecordCursor
2423
{
25-
/**
26-
* @var RecordView[]
27-
*/
28-
protected $records = [];
29-
3024
/**
3125
* @var string[]
3226
*/
@@ -103,10 +97,10 @@ public function setGraph(array $graph)
10397
}
10498

10599
/**
106-
* @param $data
107-
* @param $graph
100+
* @param array $data
101+
* @param array $graph
108102
*/
109-
public function pushRecord($data, $graph)
103+
public function pushRecord(array $data, array $graph)
110104
{
111105
$mapped = $this->array_map_deep($data, $graph);
112106
$this->records[] = new RecordView($this->fields, $mapped);

src/HttpDriver/Configuration.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ class Configuration extends BaseConfiguration implements ConfigInterface
3636
protected $curlInterface;
3737

3838
/**
39+
* @param HttpClient|null $httpClient
40+
* @param RequestFactory|null $requestFactory
3941
* @return Configuration
4042
*/
4143
public static function create(HttpClient $httpClient = null, RequestFactory $requestFactory = null)

0 commit comments

Comments
 (0)