Skip to content

Commit dd2eb54

Browse files
Merge pull request #1 from andanteproject/develop
bug fix
2 parents 57bb60e + 1d22f8c commit dd2eb54

24 files changed

+185
-141
lines changed

.php-cs-fixer.dist.php

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/*
6+
* This file is part of PHP CS Fixer.
7+
*
8+
* (c) Fabien Potencier <fabien@symfony.com>
9+
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
10+
*
11+
* This source file is subject to the MIT license that is bundled
12+
* with this source code in the file LICENSE.
13+
*/
14+
15+
$config = new PhpCsFixer\Config();
16+
$config
17+
->setRules([
18+
'@PhpCsFixer:risky' => true,
19+
'@PSR2' => true,
20+
'concat_space' => ['spacing' => 'one'],
21+
'no_unused_imports' => true,
22+
'whitespace_after_comma_in_array' => true,
23+
'method_argument_space' => [
24+
'keep_multiple_spaces_after_comma' => true,
25+
'on_multiline' => 'ignore'
26+
],
27+
'return_type_declaration' => [
28+
'space_before' => 'none'
29+
],
30+
// only converts simple strings in double quotes to single quotes
31+
// ignores strings using variables, escape characters or single quotes inside
32+
'single_quote' => true,
33+
// there should be a single space b/w the cast and it's operand
34+
'cast_spaces' => ['space' => 'single'],
35+
// there shouldn't be any trailing whitespace at the end of a non-blank line
36+
'no_trailing_whitespace' => true,
37+
// there shouldn't be any trailing whitespace at the end of a blank line
38+
'no_whitespace_in_blank_line' => true,
39+
// there should be a space around binary operators like (=, => etc)
40+
'binary_operator_spaces' => ['default' => 'single_space'],
41+
// deals with rogue empty blank lines
42+
'no_extra_blank_lines' => ['tokens' => ['extra']],
43+
// reduces multi blank lines b/w phpdoc description and @param to a single line
44+
// NOTE: Doesn't add a blank line if none exist
45+
'phpdoc_trim_consecutive_blank_line_separation' => true,
46+
'native_function_invocation' => false,
47+
'phpdoc_add_missing_param_annotation' => ['only_untyped' => false],
48+
'phpdoc_align' => true,
49+
'phpdoc_return_self_reference' => true,
50+
'phpdoc_types_order' => ['sort_algorithm' => 'alpha', 'null_adjustment' => 'always_last'],
51+
'phpdoc_to_comment' => false,
52+
'phpdoc_var_without_name' => false,
53+
54+
])
55+
->setFinder(
56+
PhpCsFixer\Finder::create()
57+
->in(__DIR__)
58+
);
59+
60+
return $config;

.php_cs.dist

Lines changed: 0 additions & 29 deletions
This file was deleted.

composer.json

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,13 @@
3131
"phpunit/phpunit": "^9.5",
3232
"symfony/framework-bundle": "^4.4 | ^5.0",
3333
"symfony/yaml": "^5.2",
34-
"friendsofphp/php-cs-fixer": "^2.18",
35-
"phpstan/phpstan": "^0.12.78",
36-
"phpstan/phpstan-phpunit": "^0.12.17",
37-
"phpstan/extension-installer": "^1.1",
38-
"phpstan/phpstan-symfony": "^0.12.20",
39-
"ext-json": "*"
34+
"ext-json": "*",
35+
"friendsofphp/php-cs-fixer": "^3.35",
36+
"doctrine/annotations": "^2.0",
37+
"phpstan/phpstan": "^1.10",
38+
"phpstan/phpstan-phpunit": "^1.3",
39+
"phpstan/extension-installer": "^1.3",
40+
"phpstan/phpstan-symfony": "^1.3"
4041
},
4142
"autoload": {
4243
"psr-4": {
@@ -53,7 +54,12 @@
5354
"phpunit-base": "phpunit tests/",
5455
"phpunit": "@phpunit-base --testdox",
5556
"phpunit-coverage-text": "@phpunit-base --coverage-text --colors=never",
56-
"cs-check": "mkdir -p var/cache && php-cs-fixer fix --dry-run --diff --cache-file=var/cache/.php_cs.cache --config=.php_cs.dist",
57-
"cs-fix": "mkdir -p var/cache && php-cs-fixer fix --diff --cache-file=var/cache/.php_cs.cache --config=.php_cs.dist"
57+
"cs-check": "mkdir -p var/cache && php-cs-fixer fix --dry-run --diff --cache-file=var/cache/.php_cs.cache --config=.php-cs-fixer.dist.php --allow-risky=yes",
58+
"cs-fix": "mkdir -p var/cache && php-cs-fixer fix --diff --cache-file=var/cache/.php_cs.cache --config=.php-cs-fixer.dist.php --allow-risky=yes"
59+
},
60+
"config": {
61+
"allow-plugins": {
62+
"phpstan/extension-installer": true
63+
}
5864
}
5965
}

phpstan.neon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
parameters:
22
level: 8
33
checkMissingIterableValueType: false
4+
treatPhpDocTypesAsCertain: false

src/Exception/CannotOverrideImmutableParameterException.php

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

33
declare(strict_types=1);
44

5-
65
namespace Andante\Doctrine\ORM\Exception;
76

87
use Doctrine\ORM\Query;

src/Exception/CannotOverrideParametersException.php

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

33
declare(strict_types=1);
44

5-
65
namespace Andante\Doctrine\ORM\Exception;
76

87
class CannotOverrideParametersException extends ImmutableParameterException

src/Exception/DqlErrorException.php

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

33
declare(strict_types=1);
44

5-
65
namespace Andante\Doctrine\ORM\Exception;
76

87
class DqlErrorException extends LogicException

src/Exception/ImmutableParameterException.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@
22

33
declare(strict_types=1);
44

5-
65
namespace Andante\Doctrine\ORM\Exception;
76

8-
use Throwable;
9-
107
class ImmutableParameterException extends LogicException
118
{
129
}

src/Exception/InvalidArgumentException.php

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

33
declare(strict_types=1);
44

5-
65
namespace Andante\Doctrine\ORM\Exception;
76

87
class InvalidArgumentException extends \InvalidArgumentException implements SharedQueryBuilderException

src/Exception/SharedQueryBuilderException.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?php
22
declare(strict_types=1);
33

4-
54
namespace Andante\Doctrine\ORM\Exception;
65

76
interface SharedQueryBuilderException

0 commit comments

Comments
 (0)