-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added some tests (due to changes that where made because of PHPStan)
- Loading branch information
1 parent
36902d9
commit 8bbc4ff
Showing
32 changed files
with
666 additions
and
56 deletions.
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.