Skip to content

Commit 7a72eb2

Browse files
committed
fixed php cs fixer static analysis
1 parent 41bd571 commit 7a72eb2

File tree

15 files changed

+18
-34
lines changed

15 files changed

+18
-34
lines changed

.github/workflows/static.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
- name: PHP-CS-Fixer
3434
uses: docker://oskarstark/php-cs-fixer-ga
3535
with:
36-
args: --dry-run --diff-format udiff
36+
args: --dry-run
3737

3838
psalm:
3939
name: Psalm

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
.phpunit.result.cache
99
.idea
1010
.env
11+
.php-cs-fixer.cache

.php_cs renamed to .php-cs-fixer.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
<?php
22

3-
$finder = PhpCsFixer\Finder::create()
3+
use PhpCsFixer\Config;
4+
use PhpCsFixer\Finder;
5+
6+
require __DIR__ . '/vendor/autoload.php';
7+
8+
$finder = Finder::create()
49
->in(__DIR__.'/')
510
->exclude(__DIR__.'/vendor')
611
;
712

8-
return PhpCsFixer\Config::create()
13+
return (new Config())
914
->setRules([
1015
'@Symfony' => true,
1116
])

Collector/Neo4jDataCollector.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,13 @@ public function reset(): void
4040
$this->queryLogger->reset();
4141
}
4242

43-
/**
44-
* @return int
45-
*/
4643
public function getQueryCount(): int
4744
{
4845
return $this->data['nb_queries'];
4946
}
5047

5148
/**
5249
* Return all statements, successful and not successful.
53-
*
54-
* @return array
5550
*/
5651
public function getStatements(): array
5752
{
@@ -60,33 +55,22 @@ public function getStatements(): array
6055

6156
/**
6257
* Return not successful statements.
63-
*
64-
* @return array
6558
*/
6659
public function getFailedStatements(): array
6760
{
6861
return $this->data['failed_statements'];
6962
}
7063

71-
/**
72-
* @return float
73-
*/
7464
public function getTime(): float
7565
{
7666
return $this->data['time'];
7767
}
7868

79-
/**
80-
* @return float
81-
*/
8269
public function getTimeForQuery(): float
8370
{
8471
return $this->data['time'];
8572
}
8673

87-
/**
88-
* @return string
89-
*/
9074
public function getName(): string
9175
{
9276
return 'neo4j';

Collector/QueryLogger.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66

77
use Countable;
88
use Exception;
9+
use function iterator_to_array;
910
use Laudis\Neo4j\Databags\Statement;
1011
use Laudis\Neo4j\Databags\SummarizedResult;
1112
use Laudis\Neo4j\Exception\Neo4jException;
1213
use Laudis\Neo4j\Types\CypherList;
1314
use Laudis\Neo4j\Types\CypherMap;
14-
use function iterator_to_array;
1515

1616
/**
1717
* @author Xavier Coureau <[email protected]>
@@ -63,6 +63,7 @@ public function record(Statement $statement): void
6363

6464
/**
6565
* @param SummarizedResult<CypherList<CypherMap<OGMTypes>>> $result
66+
*
6667
* @throws Exception
6768
*/
6869
public function finish(SummarizedResult $result): void

DependencyInjection/Configuration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function getConfigTreeBuilder(): TreeBuilder
3636
{
3737
$treeBuilder = new TreeBuilder('neo4j');
3838

39-
/** @phpstan-ignore-next-line */
39+
/* @phpstan-ignore-next-line */
4040
$treeBuilder->getRootNode()->children()
4141
->arrayNode('profiling')
4242
->addDefaultsIfNotSet()

DependencyInjection/Neo4jExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
namespace Neo4j\Neo4jBundle\DependencyInjection;
66

77
use Laudis\Neo4j\Contracts\ClientInterface;
8+
use function sprintf;
89
use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
910
use Symfony\Component\Config\FileLocator;
1011
use Symfony\Component\DependencyInjection\ChildDefinition;
1112
use Symfony\Component\DependencyInjection\ContainerBuilder;
1213
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
1314
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
14-
use function sprintf;
1515

1616
/**
1717
* @author Tobias Nyholm <[email protected]>
@@ -62,7 +62,7 @@ private function handleClients(array &$config, ContainerBuilder $container): voi
6262
{
6363
$firstName = '';
6464
foreach ($config['connections'] as $name => $data) {
65-
if ($firstName === '' || 'default' === $name) {
65+
if ('' === $firstName || 'default' === $name) {
6666
$firstName = $name;
6767
}
6868
}

EventHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function __construct(?EventDispatcherInterface $dispatcher)
2020

2121
public function handle(callable $runHandler, iterable $statements): ?CypherList
2222
{
23-
if ($this->dispatcher === null) {
23+
if (null === $this->dispatcher) {
2424
return $runHandler();
2525
}
2626

Events/FailureEvent.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Neo4j\Neo4jBundle\Events;
44

5-
use GraphAware\Neo4j\Client\Exception\Neo4jExceptionInterface;
65
use Laudis\Neo4j\Exception\Neo4jException;
76
use Symfony\Contracts\EventDispatcher\Event;
87

Factory/ClientFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
namespace Neo4j\Neo4jBundle\Factory;
66

77
use Laudis\Neo4j\ClientBuilder;
8+
use Laudis\Neo4j\Contracts\ClientInterface;
89
use Neo4j\Neo4jBundle\EventHandler;
910
use Neo4j\Neo4jBundle\SymfonyClient;
10-
use Laudis\Neo4j\Contracts\ClientInterface;
11-
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
1211
use function sprintf;
12+
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
1313

1414
/**
1515
* @author Tobias Nyholm <[email protected]>

0 commit comments

Comments
 (0)