-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHPStan Level 2 #6161
Merged
Merged
PHPStan Level 2 #6161
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,4 +11,4 @@ jobs: | |
env: | ||
REQUIRE_DEV: true | ||
with: | ||
args: analyse | ||
args: analyse -c .phpstan/phpstan.neon.dist | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
parameters: | ||
ignoreErrors: | ||
- | ||
# will be fixed in v4. Currently BC break | ||
message: "#^Call to an undefined method Sonata\\\\AdminBundle\\\\Datagrid\\\\PagerInterface\\:\\:isLastPage\\(\\)\\.$#" | ||
count: 1 | ||
path: ../src/Action/RetrieveAutocompleteItemsAction.php | ||
|
||
- | ||
# will be fixed in v4. Currently BC break | ||
message: "#^Call to an undefined method Sonata\\\\AdminBundle\\\\Datagrid\\\\PagerInterface\\:\\:getPage\\(\\)\\.$#" | ||
count: 1 | ||
path: ../src/Action/SearchAction.php | ||
|
||
- | ||
# will be fixed in v4. Currently BC break | ||
message: "#^Call to an undefined method Sonata\\\\AdminBundle\\\\Datagrid\\\\PagerInterface\\:\\:getNbResults\\(\\)\\.$#" | ||
count: 1 | ||
path: ../src/Action/SearchAction.php | ||
|
||
- | ||
# will be fixed in v4. Currently BC break | ||
message: "#^Method Sonata\\\\AdminBundle\\\\Datagrid\\\\Datagrid\\:\\:addFilter\\(\\) should return Sonata\\\\AdminBundle\\\\Filter\\\\FilterInterface but return statement is missing\\.$#" | ||
count: 1 | ||
path: ../src/Datagrid/Datagrid.php | ||
|
||
- | ||
# will be fixed in v4. Currently BC break | ||
message: "#^Method Sonata\\\\AdminBundle\\\\Admin\\\\FieldDescriptionInterface\\:\\:getLabel\\(\\) invoked with 1 parameter, 0 required\\.$#" | ||
count: 1 | ||
path: ../src/Datagrid/ListMapper.php | ||
|
||
- | ||
# will be fixed in v4. Currently BC break | ||
message: "#^Constructor of class Sonata\\\\AdminBundle\\\\Form\\\\DataTransformer\\\\ModelsToArrayTransformer has an unused parameter \\$choiceList\\.$#" | ||
count: 1 | ||
path: ../src/Form/DataTransformer/ModelsToArrayTransformer.php | ||
|
||
- | ||
# will be fixed in v4. Currently BC break | ||
message: "#^Constructor of class Sonata\\\\AdminBundle\\\\Form\\\\DataTransformer\\\\ModelsToArrayTransformer has an unused parameter \\$class\\.$#" | ||
count: 1 | ||
path: ../src/Form/DataTransformer/ModelsToArrayTransformer.php | ||
|
||
- | ||
# will be fixed in v4. Currently BC break | ||
message: "#^Constructor of class Sonata\\\\AdminBundle\\\\Form\\\\DataTransformer\\\\ModelsToArrayTransformer has an unused parameter \\$modelManager\\.$#" | ||
count: 1 | ||
path: ../src/Form/DataTransformer/ModelsToArrayTransformer.php | ||
|
||
- | ||
# will be fixed in v4. Currently BC break | ||
message: "#^Method Sonata\\\\AdminBundle\\\\Admin\\\\AdminInterface\\:\\:getFormGroups\\(\\) invoked with 1 parameter, 0 required\\.$#" | ||
count: 1 | ||
path: ../src/Form/FormMapper.php | ||
|
||
- | ||
# will be fixed in v4. Currently BC break | ||
message: "#^Method Sonata\\\\AdminBundle\\\\Admin\\\\AdminInterface\\:\\:getFormTabs\\(\\) invoked with 1 parameter, 0 required\\.$#" | ||
count: 1 | ||
path: ../src/Form/FormMapper.php | ||
|
||
- | ||
# will be fixed in v4. Currently BC break | ||
message: "#^Method Sonata\\\\AdminBundle\\\\Admin\\\\FieldDescriptionInterface\\:\\:getLabel\\(\\) invoked with 1 parameter, 0 required\\.$#" | ||
count: 1 | ||
path: ../src/Show/ShowMapper.php | ||
|
||
- | ||
# will be fixed in v4. Currently BC break | ||
message: "#^Method Sonata\\\\AdminBundle\\\\Admin\\\\AdminInterface\\:\\:getShowGroups\\(\\) invoked with 1 parameter, 0 required\\.$#" | ||
count: 1 | ||
path: ../src/Show/ShowMapper.php | ||
|
||
- | ||
# will be fixed in v4. Currently BC break | ||
message: "#^Method Sonata\\\\AdminBundle\\\\Admin\\\\AdminInterface\\:\\:getShowTabs\\(\\) invoked with 1 parameter, 0 required\\.$#" | ||
count: 1 | ||
path: ../src/Show/ShowMapper.php | ||
|
||
- | ||
# will be fixed in v4. Currently BC break | ||
message: "#^Method Sonata\\\\AdminBundle\\\\Translator\\\\Extractor\\\\JMSTranslatorBundle\\\\AdminExtractor\\:\\:buildSecurityInformation\\(\\) should return array\\<string, mixed\\> but return statement is missing\\.$#" | ||
count: 1 | ||
path: ../src/Translator/Extractor/JMSTranslatorBundle/AdminExtractor.php | ||
|
||
- | ||
# will be fixed in v4. Currently BC break | ||
message: "#^Method Sonata\\\\AdminBundle\\\\Translator\\\\Extractor\\\\JMSTranslatorBundle\\\\AdminExtractor\\:\\:getBaseRole\\(\\) should return string but return statement is missing\\.$#" | ||
count: 1 | ||
path: ../src/Translator/Extractor/JMSTranslatorBundle/AdminExtractor.php | ||
|
||
# next 6 errors are due to not installed Doctrine ORM\ODM | ||
- | ||
message: "#^Class Doctrine\\\\ODM\\\\MongoDB\\\\PersistentCollection not found\\.$#" | ||
count: 1 | ||
path: ../src/Admin/AdminHelper.php | ||
|
||
- | ||
message: "#^Class Doctrine\\\\ORM\\\\PersistentCollection not found\\.$#" | ||
count: 1 | ||
path: ../src/Admin/AdminHelper.php | ||
|
||
- | ||
message: "#^Call to method getTypeClass\\(\\) on an unknown class Doctrine\\\\ODM\\\\MongoDB\\\\PersistentCollection\\.$#" | ||
count: 1 | ||
path: ../src/Admin/AdminHelper.php | ||
|
||
- | ||
message: "#^Call to method getTypeClass\\(\\) on an unknown class Doctrine\\\\ORM\\\\PersistentCollection\\.$#" | ||
count: 1 | ||
path: ../src/Admin/AdminHelper.php | ||
|
||
- | ||
message: "#^Call to method add\\(\\) on an unknown class Doctrine\\\\ODM\\\\MongoDB\\\\PersistentCollection\\.$#" | ||
count: 1 | ||
path: ../src/Admin/AdminHelper.php | ||
|
||
- | ||
message: "#^Call to method add\\(\\) on an unknown class Doctrine\\\\ORM\\\\PersistentCollection\\.$#" | ||
count: 1 | ||
path: ../src/Admin/AdminHelper.php | ||
|
||
# Symfony related errors | ||
- | ||
message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeParentInterface\\:\\:arrayNode\\(\\)\\.$#" | ||
count: 1 | ||
path: ../src/DependencyInjection/Configuration.php | ||
|
||
- | ||
# Symfony BC break policy | ||
message: "#^Method Symfony\\\\Contracts\\\\EventDispatcher\\\\EventDispatcherInterface\\:\\:dispatch\\(\\) invoked with 2 parameters, 1 required\\.$#" | ||
count: 1 | ||
path: ../src/Menu/MenuBuilder.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
includes: | ||
- phpstan-baseline.neon | ||
|
||
parameters: | ||
level: 2 | ||
|
||
paths: | ||
- ../src | ||
excludes_analyse: | ||
# temporarily ignore template files | ||
- ../src/Resources/**.tpl.php | ||
scanFiles: | ||
# NEXT_MAJOR: Remove those files | ||
- stubs/MetadataInterface.file | ||
- stubs/Exporter.file | ||
- stubs/TextExtension.file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the Sonata Project package. | ||
* | ||
* (c) Thomas Rabaix <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Sonata\CoreBundle\Exporter; | ||
|
||
use Sonata\Exporter\Handler; | ||
use Sonata\Exporter\Source\SourceIteratorInterface; | ||
use Sonata\Exporter\Writer\CsvWriter; | ||
use Sonata\Exporter\Writer\JsonWriter; | ||
use Sonata\Exporter\Writer\XlsWriter; | ||
use Sonata\Exporter\Writer\XmlWriter; | ||
use Symfony\Component\HttpFoundation\StreamedResponse; | ||
|
||
@trigger_error( | ||
'The '.__NAMESPACE__.'\Exporter class is deprecated since version 3.1 and will be removed in 4.0.'. | ||
' Use Sonata\Exporter\Exporter instead', | ||
E_USER_DEPRECATED | ||
); | ||
|
||
/** | ||
* NEXT_MAJOR: Remove this stub when Exporter file doesn't need the CoreBundle dependency | ||
* | ||
* @deprecated since sonata-project/core-bundle 3.19, to be removed in 4.0. | ||
*/ | ||
class Exporter | ||
{ | ||
/** | ||
* @param string $format | ||
* @param string $filename | ||
* | ||
* @throws \RuntimeException | ||
* | ||
* @return StreamedResponse | ||
*/ | ||
public function getResponse($format, $filename, SourceIteratorInterface $source) | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the Sonata Project package. | ||
* | ||
* (c) Thomas Rabaix <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Sonata\CoreBundle\Model; | ||
|
||
/** | ||
* NEXT_MAJOR: Remove this stub when MetadataInterface file doesn't need the CoreBundle dependency | ||
* | ||
* @author Hugo Briand <[email protected]> | ||
* | ||
* @deprecated since sonata-project/core-bundle 3.13.0, to be removed in 4.0. Use Sonata\BlockBundle\Meta\MetadataInterface instead. | ||
*/ | ||
interface MetadataInterface | ||
{ | ||
/** | ||
* @return string | ||
*/ | ||
public function getTitle(); | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getDescription(); | ||
|
||
/** | ||
* @return mixed | ||
*/ | ||
public function getImage(); | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getDomain(); | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public function getOptions(); | ||
|
||
/** | ||
* @param string $name The option key | ||
* @param mixed $default The default value if option not found | ||
* | ||
* @return mixed | ||
*/ | ||
public function getOption($name, $default = null); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
/** | ||
* NEXT_MAJOR: Remove this stub when StringExtension and DeprecatedTextExtension files doesn't need the Twig\Extensions dependency | ||
* This file is part of Twig. | ||
* | ||
* (c) 2009-2019 Fabien Potencier | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Twig\Extensions | ||
{ | ||
use Twig\Extension\AbstractExtension; | ||
use Twig\TwigFilter; | ||
|
||
/** | ||
* @author Henrik Bjornskov <[email protected]> | ||
*/ | ||
class TextExtension extends AbstractExtension | ||
{ | ||
public function getFilters() | ||
{ | ||
} | ||
} | ||
} | ||
|
||
namespace | ||
{ | ||
use Twig\Environment; | ||
|
||
function twig_truncate_filter(Environment $env, $value, $length = 30, $preserve = false, $separator = '...') | ||
{ | ||
} | ||
|
||
function twig_wordwrap_filter(Environment $env, $value, $length = 80, $separator = "\n", $preserve = false) | ||
{ | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've moved
phpstan
related things to.phpstan
folder. Because It will be too much filles in the root (phpstan.neon.dist
,phpstan-baseline.neon
, 3 files that can't be resolved because ofCoreBundle
)