Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/qa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ jobs:
env:
REQUIRE_DEV: true
with:
args: analyse -c .phpstan/phpstan.neon.dist
args: analyse
16 changes: 0 additions & 16 deletions .phpstan/phpstan.neon.dist

This file was deleted.

48 changes: 0 additions & 48 deletions .phpstan/stubs/Exporter.file

This file was deleted.

57 changes: 0 additions & 57 deletions .phpstan/stubs/MetadataInterface.file

This file was deleted.

40 changes: 0 additions & 40 deletions .phpstan/stubs/TextExtension.file

This file was deleted.

82 changes: 77 additions & 5 deletions UPGRADE-4.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,86 @@ See also the [diff code](https://github.com/sonata-project/SonataAdminBundle/com

Some classes and methods are now `final` and should not be overridden:

* `Sonata\Admin\AbstractAdmin::getActionButtons`
* `Sonata\Admin\AbstractAdmin::getBatchActions`
* `Sonata\Admin\AbstractAdmin::urlize`
* `Sonata\AdminBundle\Admin\AbstractAdmin::getActionButtons`
* `Sonata\AdminBundle\Admin\AbstractAdmin::getBatchActions`
* `Sonata\AdminBundle\Admin\AbstractAdmin::urlize`
* `Sonata\AdminBundle\Admin\Extension\LockExtension`
* `Sonata\AdminBundle\Admin\FieldDescriptionCollection`
* `Sonata\AdminBundle\Block\AdminListBlockService`
* `Sonata\AdminBundle\Block\AdminSearchBlockService`
* `Sonata\AdminBundle\Block\AdminStatsBlockService`
* `Sonata\AdminBundle\Command\ExplainAdminCommand`
* `Sonata\AdminBundle\Command\GenerateObjectAclCommand`
* `Sonata\AdminBundle\Command\ListAdminCommand`
* `Sonata\AdminBundle\Command\SetupAclCommand`
* `Sonata\AdminBundle\Command\Validators`
* `Sonata\AdminBundle\Datagrid\Datagrid`
* `Sonata\AdminBundle\Datagrid\SimplePager`
* `Sonata\AdminBundle\DependencyInjection\Compiler\AddDependencyCallsCompilerPass`
* `Sonata\AdminBundle\DependencyInjection\Compiler\AddFilterTypeCompilerPass`
* `Sonata\AdminBundle\DependencyInjection\Compiler\ExtensionCompilerPass`
* `Sonata\AdminBundle\DependencyInjection\Compiler\GlobalVariablesCompilerPass`
* `Sonata\AdminBundle\DependencyInjection\Configuration`
* `Sonata\AdminBundle\DependencyInjection\SonataAdminExtension`
* `Sonata\AdminBundle\Translator\Extractor\JMSTranslatorBundle\AdminExtractor`
* `Sonata\AdminBundle\Twig\Extension`
* `Sonata\AdminBundle\DependencyInjection\Compiler\ModelManagerCompilerPass`
* `Sonata\AdminBundle\Event\AdminEventExtension`
* `Sonata\AdminBundle\Event\ConfigureEvent`
* `Sonata\AdminBundle\Event\ConfigureMenuEvent`
* `Sonata\AdminBundle\Event\ConfigureQueryEvent`
* `Sonata\AdminBundle\Event\PersistenceEvent`
* `Sonata\AdminBundle\Exception\LockException`
* `Sonata\AdminBundle\Exception\ModelManagerException`
* `Sonata\AdminBundle\Exception\NoValueException`
* `Sonata\AdminBundle\Filter\FilterFactory`
* `Sonata\AdminBundle\Form\ChoiceList\ModelChoiceLoader`
* `Sonata\AdminBundle\Form\DataTransformer\ArrayToModelTransformer`
* `Sonata\AdminBundle\Form\DataTransformer\ModelToIdPropertyTransformer`
* `Sonata\AdminBundle\Form\DataTransformer\ModelToIdTransformer`
* `Sonata\AdminBundle\Form\DataTransformer\ModelsToArrayTransformer`
* `Sonata\AdminBundle\Form\EventListener\MergeCollectionListener`
* `Sonata\AdminBundle\Form\Extension\ChoiceTypeExtension`
* `Sonata\AdminBundle\Form\Extension\Field\Type\FormTypeFieldExtension`
* `Sonata\AdminBundle\Form\Extension\Field\Type\MopaCompatibilityTypeFieldExtension`
* `Sonata\AdminBundle\Form\Type\AclMatrixType`
* `Sonata\AdminBundle\Form\Type\AdminType`
* `Sonata\AdminBundle\Form\Type\ChoiceFieldMaskType`
* `Sonata\AdminBundle\Form\Type\CollectionType`
* `Sonata\AdminBundle\Form\Type\Filter\ChoiceType`
* `Sonata\AdminBundle\Form\Type\Filter\DateRangeType`
* `Sonata\AdminBundle\Form\Type\Filter\DateTimeRangeType`
* `Sonata\AdminBundle\Form\Type\Filter\DateTimeType`
* `Sonata\AdminBundle\Form\Type\Filter\DateType`
* `Sonata\AdminBundle\Form\Type\Filter\DefaultType`
* `Sonata\AdminBundle\Form\Type\Filter\NumberType`
* `Sonata\AdminBundle\Form\Type\ModelAutocompleteType`
* `Sonata\AdminBundle\Form\Type\ModelHiddenType`
* `Sonata\AdminBundle\Form\Type\ModelListType`
* `Sonata\AdminBundle\Form\Type\ModelReferenceType`
* `Sonata\AdminBundle\Form\Type\ModelType`
* `Sonata\AdminBundle\Guesser\TypeGuesserChain`
* `Sonata\AdminBundle\Manipulator\ServicesManipulator`
* `Sonata\AdminBundle\Menu\MenuBuilder`
* `Sonata\AdminBundle\Model\AuditManager`
* `Sonata\AdminBundle\Route\AdminPoolLoader`
* `Sonata\AdminBundle\Route\DefaultRouteGenerator`
* `Sonata\AdminBundle\Route\RouteCollection`
* `Sonata\AdminBundle\Route\RoutesCache`
* `Sonata\AdminBundle\Route\RoutesCacheWarmUp`
* `Sonata\AdminBundle\Security\Acl\AdminPermissionMap`
* `Sonata\AdminBundle\Security\Acl\Permission\MaskBuilder`
* `Sonata\AdminBundle\Security\Handler\AclSecurityHandler`
* `Sonata\AdminBundle\Security\Handler\NoopSecurityHandler`
* `Sonata\AdminBundle\SonataAdminBundle`
* `Sonata\AdminBundle\Translator\BCLabelTranslatorStrategy`
* `Sonata\AdminBundle\Translator\FormLabelTranslatorStrategy`
* `Sonata\AdminBundle\Translator\NativeLabelTranslatorStrategy`
* `Sonata\AdminBundle\Translator\UnderscoreLabelTranslatorStrategy`
* `Sonata\AdminBundle\Twig\Extension\SonataAdminExtension`
* `Sonata\AdminBundle\Twig\GlobalVariables`
* `Sonata\AdminBundle\Util\AdminAclManipulator`
* `Sonata\AdminBundle\Util\FormBuilderIterator`
* `Sonata\AdminBundle\Util\FormViewIterator`
* `Sonata\AdminBundle\Util\AdminAclManipulator`

## Admin
If you have implemented a custom admin, you must adapt the signature of the following new methods to match the one in `AdminInterface` again:
Expand Down Expand Up @@ -74,3 +143,6 @@ Method `SimplePager::getResults` is always returning an array

## LockInterface
`LockInterface` extends from `ModelManagerInterface`.

## RouteCollectionInterface
`RouteCollection` implements `RouteCollectionInterface`.
9 changes: 2 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"sonata-project/block-bundle": "^4.0",
"sonata-project/doctrine-extensions": "^1.4",
"sonata-project/exporter": "^2.1",
"sonata-project/form-extensions": "^0.1.1 || ^1.4",
"sonata-project/twig-extensions": "^0.1.1 || ^1.3",
"sonata-project/form-extensions": "^1.4",
"sonata-project/twig-extensions": "^1.3",
"symfony/asset": "^4.4",
"symfony/config": "^4.4",
"symfony/console": "^4.4",
Expand Down Expand Up @@ -61,15 +61,11 @@
},
"conflict": {
"doctrine/doctrine-bundle": ">=3",
"sonata-project/core-bundle": "<3.20",
"sonata-project/doctrine-extensions": "<1.1.3",
"sonata-project/media-bundle": "<3.7",
"sonata-project/user-bundle": "<3.3"
},
"require-dev": {
"jms/translation-bundle": "^1.4",
"matthiasnoback/symfony-dependency-injection-test": "^4.1",
"mopa/bootstrap-bundle": "^3.3",
"phpstan/phpstan": "^0.12.29",
"psr/event-dispatcher": "^1.0",
"sonata-project/intl-bundle": "^2.4",
Expand All @@ -81,7 +77,6 @@
"symfony/yaml": "^4.4"
},
"suggest": {
"jms/translation-bundle": "Extract message keys from Admins",
"kunicmarko/sonata-auto-configure-bundle": "Auto configures Admin classes",
"twig/extra-bundle": "Auto configures the Twig Intl extension"
},
Expand Down
36 changes: 9 additions & 27 deletions .phpstan/phpstan-baseline.neon → phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -1,68 +1,50 @@
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

-
# NEXT_MAJOR: Remove this error
message: "#^Call to an undefined method Sonata\\\\AdminBundle\\\\Admin\\\\FieldDescriptionInterface\\:\\:setHelp\\(\\)\\.$#"
count: 1
path: ../src/Form/FormMapper.php
path: src/Action/SearchAction.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
path: src/Admin/AdminHelper.php

-
message: "#^Class Doctrine\\\\ORM\\\\PersistentCollection not found\\.$#"
count: 1
path: ../src/Admin/AdminHelper.php
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
path: src/Admin/AdminHelper.php

-
message: "#^Call to method getTypeClass\\(\\) on an unknown class Doctrine\\\\ORM\\\\PersistentCollection\\.$#"
count: 1
path: ../src/Admin/AdminHelper.php
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
path: src/Admin/AdminHelper.php

-
message: "#^Call to method add\\(\\) on an unknown class Doctrine\\\\ORM\\\\PersistentCollection\\.$#"
count: 1
path: ../src/Admin/AdminHelper.php
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
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
path: src/Menu/MenuBuilder.php
11 changes: 11 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
includes:
- phpstan-baseline.neon

parameters:
level: 2

paths:
- src
excludes_analyse:
# temporarily ignore template files
- src/Resources/**.tpl.php
Loading