sonata-project / SonataCoreBundle

[deprecated] SonataCoreBundle
MIT License
318 stars 138 forks source link

Declaration of InlineConstraint::__sleep incompatible with parent #715

Closed Devristo closed 5 years ago

Devristo commented 5 years ago

Environment

Sonata packages

$ composer show --latest 'sonata-project/*'
sonata-project/admin-bundle              3.53.0 3.53.0 The missing Symfony Admin Generator
sonata-project/block-bundle              3.17.0 3.17.0 Symfony SonataBlockBundle
sonata-project/cache                     2.0.1  2.0.1  Cache library
sonata-project/core-bundle               3.17.0 3.17.0 Symfony SonataCoreBundle
sonata-project/datagrid-bundle           2.5.0  3.0.0  Symfony SonataDatagridBundle
sonata-project/doctrine-extensions       1.3.0  1.3.0  Doctrine2 behavioral extensions
sonata-project/doctrine-orm-admin-bundle 3.10.0 3.10.0 Symfony Sonata / Integrate Doctrine ORM into the SonataAdminBundle
sonata-project/exporter                  2.0.1  2.0.1  Lightweight Exporter library
sonata-project/intl-bundle               2.7.0  2.7.0  Symfony SonataIntlBundle
sonata-project/translation-bundle        2.4.2  2.4.2  SonataTranslationBundle

Symfony packages

$ composer show --latest 'symfony/*'
symfony/asset                      4.4.x-dev 3000a46  dev-master 67bdcef Symfony Asset Component
symfony/browser-kit                v4.3.4             v4.3.4             Symfony BrowserKit Component
symfony/cache                      dev-master 6aace24 dev-master 6aace24 Symfony Cache component with PSR-6, PSR-16, and tags
symfony/cache-contracts            v1.1.5             v1.1.5             Generic abstractions related to caching
symfony/class-loader               v3.4.31            v3.4.31            Symfony ClassLoader Component
symfony/config                     4.4.x-dev 4430cd5  dev-master 0cacc7d Symfony Config Component
symfony/console                    4.4.x-dev bc32b73  dev-master ba72d80 Symfony Console Component
symfony/css-selector               4.4.x-dev e90d19b  dev-master 2c7a635 Symfony CssSelector Component
symfony/debug                      4.4.x-dev ae236ce  4.4.x-dev ae236ce  Symfony Debug Component
symfony/dependency-injection       4.4.x-dev 956708b  dev-master a66be57 Symfony DependencyInjection Component
symfony/doctrine-bridge            v4.3.4             v4.3.4             Symfony Doctrine Bridge
symfony/dom-crawler                v4.3.4             v4.3.4             Symfony DomCrawler Component
symfony/dotenv                     4.4.x-dev 9426b9d  dev-master a8e6e23 Registers environment variables from a .env file
symfony/error-handler              4.4.x-dev a957d29  dev-master f8c8f65 Symfony ErrorHandler Component
symfony/error-renderer             4.4.x-dev 2b4cf99  dev-master c1154e9 Symfony ErrorRenderer Component
symfony/event-dispatcher           v4.3.4             v4.3.4             Symfony EventDispatcher Component
symfony/event-dispatcher-contracts v1.1.5             v1.1.5             Generic abstractions related to dispatching event
symfony/expression-language        4.4.x-dev 43f9056  dev-master 4692810 Symfony ExpressionLanguage Component
symfony/filesystem                 v4.3.4             v4.3.4             Symfony Filesystem Component
symfony/finder                     v4.3.4             v4.3.4             Symfony Finder Component
symfony/flex                       v1.4.5             v1.4.5             Composer plugin for Symfony
symfony/form                       4.4.x-dev 7bc5efd  dev-master 0e1b6c6 Symfony Form Component
symfony/framework-bundle           4.4.x-dev d9b5f13  dev-master e0fbc3b Symfony FrameworkBundle
symfony/http-client                4.4.x-dev d353ac5  dev-master d9290cb Symfony HttpClient component
symfony/http-client-contracts      dev-master 4886bd2 dev-master 4886bd2 Generic abstractions related to HTTP clients
symfony/http-foundation            4.4.x-dev 4646e1d  dev-master f0cbc6e Symfony HttpFoundation Component
symfony/http-kernel                4.4.x-dev 471b050  dev-master 4353973 Symfony HttpKernel Component
symfony/inflector                  v4.3.4             v4.3.4             Symfony Inflector Component
symfony/intl                       v4.3.4             v4.3.4             A PHP replacement layer for the C intl extension that includes ad...
symfony/mailer                     4.4.x-dev fb94598  dev-master 288952c Symfony Mailer Component
symfony/maker-bundle               v1.13.0            v1.13.0            Symfony Maker helps you create empty commands, controllers, form ...
symfony/messenger                  4.4.x-dev 9936298  dev-master 268eaa5 Symfony Messenger Component
symfony/mime                       dev-master d183d1e dev-master d183d1e A library to manipulate MIME messages
symfony/monolog-bridge             v4.3.4             v4.3.4             Symfony Monolog Bridge
symfony/monolog-bundle             v3.4.0             v3.4.0             Symfony MonologBundle
symfony/options-resolver           v4.3.4             v4.3.4             Symfony OptionsResolver Component
symfony/phpunit-bridge             4.4.x-dev e226482  dev-master cc0b8c7 Symfony PHPUnit Bridge
symfony/polyfill-intl-icu          v1.12.0            v1.12.0            Symfony polyfill for intl's ICU-related data and classes
symfony/polyfill-intl-idn          v1.12.0            v1.12.0            Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions
symfony/polyfill-mbstring          v1.12.0            v1.12.0            Symfony polyfill for the Mbstring extension
symfony/polyfill-php72             v1.12.0            v1.12.0            Symfony polyfill backporting some PHP 7.2+ features to lower PHP ...
symfony/polyfill-php73             v1.12.0            v1.12.0            Symfony polyfill backporting some PHP 7.3+ features to lower PHP ...
symfony/process                    v4.3.4             v4.3.4             Symfony Process Component
symfony/property-access            v4.3.4             v4.3.4             Symfony PropertyAccess Component
symfony/property-info              v4.3.4             v4.3.4             Symfony Property Info Component
symfony/proxy-manager-bridge       v4.3.4             v4.3.4             Symfony ProxyManager Bridge
symfony/routing                    4.4.x-dev 08b9ce3  dev-master 0aceff5 Symfony Routing Component
symfony/security-acl               v3.0.2             v3.0.2             Symfony Security Component - ACL (Access Control List)
symfony/security-bundle            v4.3.4             v4.3.4             Symfony SecurityBundle
symfony/security-core              v4.3.4             v4.3.4             Symfony Security Component - Core Library
symfony/security-csrf              v4.3.4             v4.3.4             Symfony Security Component - CSRF Library
symfony/security-guard             v4.3.4             v4.3.4             Symfony Security Component - Guard
symfony/security-http              v4.3.4             v4.3.4             Symfony Security Component - HTTP Integration
symfony/serializer                 4.4.x-dev ccf9612  dev-master 8e09209 Symfony Serializer Component
symfony/service-contracts          v1.1.6             v1.1.6             Generic abstractions related to writing services
symfony/stopwatch                  v4.3.4             v4.3.4             Symfony Stopwatch Component
symfony/templating                 v4.3.4             v4.3.4             Symfony Templating Component
symfony/translation                v4.3.4             v4.3.4             Symfony Translation Component
symfony/translation-contracts      v1.1.6             v1.1.6             Generic abstractions related to translation
symfony/twig-bridge                4.4.x-dev 4fcb9ac  dev-master b2f40c4 Symfony Twig Bridge
symfony/twig-bundle                4.4.x-dev 370730e  dev-master 3d9b04d Symfony TwigBundle
symfony/validator                  4.4.x-dev 7ee9e20  dev-master 82fbecb Symfony Validator Component
symfony/var-dumper                 dev-master 1809bb9 dev-master 1809bb9 Symfony mechanism for exploring and dumping PHP variables
symfony/var-exporter               dev-master f1a3445 dev-master f1a3445 A blend of var_export() + serialize() to turn any serializable da...
symfony/web-link                   v4.3.4             v4.3.4             Symfony WebLink Component
symfony/web-profiler-bundle        4.4.x-dev 774de03  dev-master 6a04789 Symfony WebProfilerBundle
symfony/workflow                   4.4.x-dev 83c73d0  dev-master e9b60ed Symfony Workflow Component
symfony/yaml                       4.4.x-dev 3ef0425  dev-master d5aad7d Symfony Yaml Component

PHP version

$ php -v
PHP 7.3.9 (cli) (built: Aug 27 2019 22:52:39) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.9, Copyright (c) 1998-2018 Zend Technologies

Subject

Symfony 4.4 adds typehints throughout the codebase. The public API should remain backward-compatible. However \Sonata\Form\Validator\Constraints\InlineConstraint overrides the @internal __sleep method and breaks because of the change in signature. The AbstractAdmin attaches this inline constraint for each admin.

Steps to reproduce

Expected results

No compile errors

Actual results

Compile Error: Declaration of Sonata\Form\Validator\Constraints\InlineConstraint::__sleep() must be compatible with Symfony\Component\Validator\Constraint::__sleep(): array