sonata-project / SonataCoreBundle

[deprecated] SonataCoreBundle
MIT License
319 stars 139 forks source link

Migrate to new classes and services #667

Closed greg0ire closed 5 years ago

greg0ire commented 5 years ago

Subject

I am targeting this branch, because this is BC.

Refs #664

Changelog

### Deprecated
- not registering `Sonata\Doctrine\Bridge\Symfony\Bundle\SonataDoctrineBundle` in the kernel of your app
### Fixed
- several deprecations about services

How can I test this?

composer config repositories.greg0ire vcs https://github.com/greg0ire/SonataCoreBundle
composer require sonata-project/core-bundle "dev-use-new-classes as 3.15.1"
greg0ire commented 5 years ago

@lukepass @ossinkine please test this and confirm everything works as before, but with fewer deprecations.

OskarStark commented 5 years ago

Let’s wait for feedback of the guys before merging it

lukepass commented 5 years ago

Hello and thanks greg, unfortunately I am getting this exception:

composer require sonata-project/core-bundle "dev-use-new-classes as 3.15.1"
./composer.json has been updated                                                    
Loading composer repositories with package information
Updating dependencies (including require-dev)                                       
gPackage operations: 0 installs, 1 update, 0 removals
  - Removing sonata-project/core-bundle (3.15.1)
  - Installing sonata-project/core-bundle (dev-use-new-classes 500d68f): Cloning 500d68ffb7 from cache
Package symfony/assetic-bundle is abandoned, you should avoid using it. Use symfony/webpack-encore-pack instead.
Writing lock file
Generating autoload files
ocramius/package-versions:  Generating version class...
ocramius/package-versions: ...done generating version class
> Incenteev\ParameterHandler\ScriptHandler::buildParameters
Updating the "app/config/parameters.yml" file
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache

In CheckExceptionOnInvalidReferenceBehaviorPass.php line 31:

  The service "sonata.core.twig.template_extension" has a dependency on a non  
  -existent service "sonata.doctrine.model.adapter.chain".                     

Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the symfony-scripts event terminated with an exception

  [RuntimeException]                                                               
  An error occurred when executing the "'cache:clear --no-warmup'" command:        

  In CheckExceptionOnInvalidReferenceBehaviorPass.php line 31:                     

    The service "sonata.core.twig.template_extension" has a dependency on a non    
    -existent service "sonata.doctrine.model.adapter.chain".                       

require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-suggest] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--update-with-all-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--] [<packages>]...
greg0ire commented 5 years ago

Argh! I suppose you have to register this bundle for this to work… that means I we cannot merge as is, the change must be conditional, based on whether that bundle is registered or not :/

lukepass commented 5 years ago

Ok, I added this class in my AppKernel and it worked:

composer update --with-dependencies
Loading composer repositories with package information
Updating dependencies (including require-dev)                                       
Nothing to install or update
Package symfony/assetic-bundle is abandoned, you should avoid using it. Use symfony/webpack-encore-pack instead.
Generating autoload files
ocramius/package-versions:  Generating version class...
ocramius/package-versions: ...done generating version class
> Incenteev\ParameterHandler\ScriptHandler::buildParameters
Updating the "app/config/parameters.yml" file
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache

 // Clearing the cache for the dev environment with debug                       
 // true                                                                        

 [OK] Cache for the "dev" environment (debug=true) was successfully cleared.    

> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installAssets

 Trying to install assets as relative symbolic links.

 --- ------------------------- ------------------ 
      Bundle                    Method / Error    
 --- ------------------------- ------------------ 
  ✔   SonataCoreBundle          relative symlink  
  ✔   SonataAdminBundle         relative symlink  
  ✔   SonataUserBundle          relative symlink  
  ✔   SonataMediaBundle         relative symlink  
  ✔   SonataTranslationBundle   relative symlink  
  ✔   TranslationBundle         relative symlink  
  ✔   WebLogViewerBundle        relative symlink  
 --- ------------------------- ------------------ 

 [OK] All assets were successfully installed.                                   

> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installRequirementsFile
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::prepareDeploymentTarget

Now I have just the following deprecations:

User Deprecated: The Sonata\CoreBundle\Twig\Extension\FlashMessageExtension class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Twig\Extension\FlashMessageExtension instead.
Hide context    Hide trace
[▶]
{▼
  /home/luca/Sites/base_project/vendor/sonata-project/core-bundle/src/CoreBundle/Twig/Extension/FlashMessageExtension.php:22 {▶}
  /home/luca/Sites/base_project/var/cache/dev/ContainerMmcxcfg/appDevDebugProjectContainer.php:1582 {▼
    › include_once $this->targetDirs[3].'/vendor/sonata-project/core-bundle/src/Twig/Extension/FlashMessageExtension.php';
    › include_once $this->targetDirs[3].'/vendor/sonata-project/core-bundle/src/CoreBundle/Twig/Extension/FlashMessageExtension.php';
    › include_once $this->targetDirs[3].'/vendor/sonata-project/core-bundle/src/Twig/Extension/FormTypeExtension.php';
  }
  /home/luca/Sites/base_project/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php:174 {▶}
  /home/luca/Sites/base_project/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:585 {▶}
  /home/luca/Sites/base_project/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:135 {▶}
  /home/luca/Sites/base_project/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:195 {▶}
  /home/luca/Sites/base_project/web/app_dev.php:29 {▶}
}
The Sonata\CoreBundle\Serializer\BaseSerializerHandler class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Serializer\BaseSerializerHandler instead.
Show context    Hide trace
{▼
  /home/luca/Sites/base_project/vendor/sonata-project/core-bundle/src/CoreBundle/Serializer/BaseSerializerHandler.php:20 {▶}
  /home/luca/Sites/base_project/vendor/symfony/symfony/src/Symfony/Component/Debug/DebugClassLoader.php:156 {▶}
}
The Sonata\AdminBundle\Command\CreateClassCacheCommand class is deprecated since version 3.39.0 and will be removed in 4.0.
Show context    Hide trace
{▼
  /home/luca/Sites/base_project/vendor/sonata-project/admin-bundle/src/Command/CreateClassCacheCommand.php:23 {▶}
  /home/luca/Sites/base_project/vendor/symfony/symfony/src/Symfony/Component/Debug/DebugClassLoader.php:156 {▶}
}
lukepass commented 5 years ago

I fixed one of the FOSRestBundle deprecations and a few more SonataCoreBundle deprecations popped up. This is the complete list:

09:53:05 | php | User Deprecated: The Sonata\CoreBundle\Twig\Extension\FlashMessageExtension class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Twig\Extension\FlashMessageExtension instead.Show context    Hide trace{▼   /home/luca/Sites/base_project/vendor/sonata-project/core-bundle/src/CoreBundle/Twig/Extension/FlashMessageExtension.php:22 {▶}   /home/luca/Sites/base_project/var/cache/dev/ContainerWa67rqp/appDevDebugProjectContainer.php:1582 {▼     › include_once $this->targetDirs[3].'/vendor/sonata-project/core-bundle/src/Twig/Extension/FlashMessageExtension.php';     › include_once $this->targetDirs[3].'/vendor/sonata-project/core-bundle/src/CoreBundle/Twig/Extension/FlashMessageExtension.php';     › include_once $this->targetDirs[3].'/vendor/sonata-project/core-bundle/src/Twig/Extension/FormTypeExtension.php';   }   /home/luca/Sites/base_project/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php:174 {▶}   /home/luca/Sites/base_project/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:585 {▶}   /home/luca/Sites/base_project/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:135 {▶}   /home/luca/Sites/base_project/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:195 {▶}   /home/luca/Sites/base_project/web/app_dev.php:29 {▶} }
-- | -- | --
09:53:02 | - | The Sonata\CoreBundle\Serializer\BaseSerializerHandler class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Serializer\BaseSerializerHandler instead.Show context    Hide trace{▼   /home/luca/Sites/base_project/vendor/sonata-project/core-bundle/src/CoreBundle/Serializer/BaseSerializerHandler.php:20 {▶}   /home/luca/Sites/base_project/vendor/symfony/symfony/src/Symfony/Component/Debug/DebugClassLoader.php:152 {▶} }
09:53:02 | - | The Sonata\CoreBundle\Date\MomentFormatConverter class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Form\Date\MomentFormatConverter instead.Show context    Hide trace{▼   /home/luca/Sites/base_project/vendor/sonata-project/core-bundle/src/CoreBundle/Date/MomentFormatConverter.php:20 {▶}   /home/luca/Sites/base_project/vendor/symfony/symfony/src/Symfony/Component/Debug/DebugClassLoader.php:152 {▶} }
09:53:02 | - | The Sonata\CoreBundle\FlashMessage\FlashManager class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Twig\FlashMessage\FlashManager instead.Show context    Hide trace{▼   /home/luca/Sites/base_project/vendor/sonata-project/core-bundle/src/CoreBundle/FlashMessage/FlashManager.php:20 {▶}   /home/luca/Sites/base_project/vendor/symfony/symfony/src/Symfony/Component/Debug/DebugClassLoader.php:152 {▶} }
09:53:02 | - | The Sonata\CoreBundle\Twig\Extension\FlashMessageExtension class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Twig\Extension\FlashMessageExtension instead.Show context    Hide trace{▼   /home/luca/Sites/base_project/vendor/sonata-project/core-bundle/src/CoreBundle/Twig/Extension/FlashMessageExtension.php:22 {▶}   /home/luca/Sites/base_project/vendor/symfony/symfony/src/Symfony/Component/Debug/DebugClassLoader.php:152 {▶} }
09:53:02 | - | The Sonata\CoreBundle\Validator\InlineValidator class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Form\Validator\InlineValidator instead.Show context    Hide trace{▼   /home/luca/Sites/base_project/vendor/sonata-project/core-bundle/src/CoreBundle/Validator/InlineValidator.php:20 {▶}   /home/luca/Sites/base_project/vendor/symfony/symfony/src/Symfony/Component/Debug/DebugClassLoader.php:152 {▶} }
09:53:02 | - | The Sonata\CoreBundle\Twig\Extension\FormTypeExtension class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Twig\Extension\FormTypeExtension instead.Show context    Hide trace{▼   /home/luca/Sites/base_project/vendor/sonata-project/core-bundle/src/CoreBundle/Twig/Extension/FormTypeExtension.php:20 {▶}   /home/luca/Sites/base_project/vendor/symfony/symfony/src/Symfony/Component/Debug/DebugClassLoader.php:152 {▶} }
09:53:02 | - | The Sonata\CoreBundle\Twig\Extension\StatusRuntime class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Twig\Extension\StatusRuntime instead.Show context    Hide trace{▼   /home/luca/Sites/base_project/vendor/sonata-project/core-bundle/src/CoreBundle/Twig/Extension/StatusRuntime.php:20 {▶}   /home/luca/Sites/base_project/vendor/symfony/symfony/src/Symfony/Component/Debug/DebugClassLoader.php:152 {▶} }
09:53:02 | - | The Sonata\CoreBundle\Twig\Extension\DeprecatedTemplateExtension class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Twig\Extension\DeprecatedTemplateExtension instead.Show context    Hide trace{▼   /home/luca/Sites/base_project/vendor/sonata-project/core-bundle/src/CoreBundle/Twig/Extension/DeprecatedTemplateExtension.php:20 {▶}   /home/luca/Sites/base_project/vendor/symfony/symfony/src/Symfony/Component/Debug/DebugClassLoader.php:152 {▶} }
09:53:02 | - | The Sonata\AdminBundle\Command\CreateClassCacheCommand class is deprecated since version 3.39.0 and will be removed in 4.0.Show context    Hide trace{▼   /home/luca/Sites/base_project/vendor/sonata-project/admin-bundle/src/Command/CreateClassCacheCommand.php:23 {▶}   /home/luca/Sites/base_project/vendor/symfony/symfony/src/Symfony/Component/Debug/DebugClassLoader.php:152 {▶} }
09:53:02 | - | The Sonata\CoreBundle\Model\PageableManagerInterface class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\DatagridBundle\Pager\PageableInterface instead.Show context    Hide trace{▼   /home/luca/Sites/base_project/vendor/sonata-project/core-bundle/src/CoreBundle/Model/PageableManagerInterface.php:20 {▶}   /home/luca/Sites/base_project/vendor/symfony/symfony/src/Symfony/Component/Debug/DebugClassLoader.php:152 {▶} }
09:53:02 | - | The Sonata\CoreBundle\Model\ManagerInterface class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Doctrine\Model\ManagerInterface instead.Show context    Hide trace{▼   /home/luca/Sites/base_project/vendor/sonata-project/core-bundle/src/CoreBundle/Model/ManagerInterface.php:20 {▶}   /home/luca/Sites/base_project/vendor/symfony/symfony/src/Symfony/Component/Debug/DebugClassLoader.php:152 {▶} }
09:53:02 | - | The Sonata\CoreBundle\Model\BaseEntityManager class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Doctrine\Entity\BaseEntityManager instead.Show context    Hide trace{▼   /home/luca/Sites/base_project/vendor/sonata-project/core-bundle/src/CoreBundle/Model/BaseEntityManager.php:20 {▶}   /home/luca/Sites/base_project/vendor/symfony/symfony/src/Symfony/Component/Debug/DebugClassLoader.php:152 {▶} }
ossinkine commented 5 years ago

I got similar messages

The Sonata\AdminBundle\Command\CreateClassCacheCommand class is deprecated since version 3.39.0 and will be removed in 4.0.
The Sonata\CoreBundle\Twig\Extension\DeprecatedTemplateExtension class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Twig\Extension\DeprecatedTemplateExtension instead.
The Sonata\CoreBundle\Twig\Extension\StatusRuntime class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Twig\Extension\StatusRuntime instead.
The Sonata\CoreBundle\Twig\Extension\FormTypeExtension class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Twig\Extension\FormTypeExtension instead.
The Sonata\CoreBundle\Twig\Extension\FlashMessageExtension class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Twig\Extension\FlashMessageExtension instead.
The Sonata\CoreBundle\FlashMessage\FlashManager class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Twig\FlashMessage\FlashManager instead.
greg0ire commented 5 years ago

More deprecations that did not pop up before might pop up after depending on whether the deprecated class or the new class is autoloaded first.

greg0ire commented 5 years ago

New version, with hopefully fewer deprecations. Please try with and without the SonataDoctrineBundle

OskarStark commented 5 years ago

You mean sonata-doctrine-extensions?

ossinkine commented 5 years ago

@greg0ire I still get these messages

The Sonata\CoreBundle\Twig\Extension\FlashMessageExtension class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Twig\Extension\FlashMessageExtension instead.
The Sonata\CoreBundle\Twig\Extension\FormTypeExtension class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Twig\Extension\FormTypeExtension instead.
The Sonata\CoreBundle\Twig\Extension\StatusRuntime class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Twig\Extension\StatusRuntime instead.
The Sonata\CoreBundle\Twig\Extension\DeprecatedTemplateExtension class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Twig\Extension\DeprecatedTemplateExtension instead.
The Sonata\AdminBundle\Command\CreateClassCacheCommand class is deprecated since version 3.39.0 and will be removed in 4.0.

If I don't register SonataDoctrineBundle I additionally get these messages

The "sonata.core.model.adapter.chain" service is deprecated in favor of service "sonata.doctrine.model.adapter.chain" since 3.x and will be removed in 4.0.
The "sonata.core.model.adapter.doctrine_orm" service is deprecated in favor of service "sonata.doctrine.adapter.doctrine_orm" since 3.x and will be removed in 4.0.
Not registering bundle "Sonata\Doctrine\Bridge\Symfony\Bundle\SonataDoctrineBundle" is deprecated since 3.x, registering it will be mandatory in 4.0
The Sonata\CoreBundle\FlashMessage\FlashManager class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Twig\FlashMessage\FlashManager instead.
The Sonata\CoreBundle\Model\Adapter\AdapterChain class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Doctrine\Adapter\AdapterChain instead.
The Sonata\CoreBundle\Model\Adapter\DoctrineORMAdapter class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Doctrine\Adapter\ORM\DoctrineORMAdapter instead.
greg0ire commented 5 years ago

Great then, it works! Please provide stack traces for the new messages.

@OskarStark I mean Sonata\Doctrine\Bridge\Symfony\Bundle\SonataDoctrineBundle which is in that repo

greg0ire commented 5 years ago

@ossinkine oh wait, I can actually fix some of the new messages easily.

greg0ire commented 5 years ago

Just pushed a new version, please try again.

lukepass commented 5 years ago

Hello, I still have a lot of deprecations. This is my composer:

composer show --latest         
behat/transliterator                     v1.2.0                      v1.2.0                     
cocur/slugify                            v3.2                        v3.2                       
composer/ca-bundle                       1.1.4                       1.1.4                      
doctrine/annotations                     v1.6.0                      v1.6.0                     
doctrine/cache                           v1.8.0                      v1.8.0                     
doctrine/collections                     v1.5.0                      v1.5.0                     
doctrine/common                          v2.10.0                     v2.10.0                    
doctrine/data-fixtures                   v1.3.1                      v1.3.1                     
doctrine/dbal                            v2.9.2                      v2.9.2                     
doctrine/doctrine-bundle                 1.10.2                      1.10.2                     
doctrine/doctrine-cache-bundle           1.3.5                       1.3.5                      
doctrine/doctrine-fixtures-bundle        3.1.0                       3.1.0                      
doctrine/event-manager                   v1.0.0                      v1.0.0                     
doctrine/inflector                       v1.3.0                      v1.3.0                     
doctrine/instantiator                    1.1.0                       1.1.0                      
doctrine/lexer                           v1.0.1                      v1.0.1                     
doctrine/orm                             v2.6.3                      v2.6.3                     
doctrine/persistence                     v1.1.0                      v1.1.0                     
doctrine/reflection                      v1.0.0                      v1.0.0                     
fig/link-util                            1.0.0                       1.0.0                      
friendsofsymfony/rest-bundle             2.5.0                       2.5.0                      
friendsofsymfony/user-bundle             v2.1.2                      v2.1.2                     
gedmo/doctrine-extensions                v2.4.36                     v2.4.36                    
greenskies/collection                    v0.0.3                      v0.0.3                     
greenskies/web-log-viewer-bundle         v0.0.8                      v0.0.8                     
guzzlehttp/psr7                          1.5.2                       1.5.2                      
imagine/imagine                          v0.7.1                      1.2.0                      
incenteev/composer-parameter-handler     v2.1.3                      v2.1.3                     
jdorn/sql-formatter                      v1.2.17                     v1.2.17                    
jean85/pretty-package-versions           1.2                         1.2                        
jms/metadata                             1.7.0                       2.0.0                      
jms/parser-lib                           1.0.0                       1.0.0                      
jms/serializer                           1.13.0                      2.1.0                      
jms/serializer-bundle                    2.4.3                       3.1.0                      
knplabs/gaufrette                        v0.8.1                      v0.8.1                     
knplabs/knp-menu                         2.3.0                       2.3.0                      
knplabs/knp-menu-bundle                  v2.2.1                      v2.2.1                     
kriswallsmith/assetic                    v1.4.0                      v1.4.0                     
kriswallsmith/buzz                       v0.16.1                     0.17.2                     
leafo/scssphp                            v0.7.7                      v0.7.7                     
liip/functional-test-bundle              2.0.0-alpha12               2.0.0-alpha12              
monolog/monolog                          1.24.0                      1.24.0                     
nette/bootstrap                          v2.4.6                      v2.4.6                     
nette/di                                 v2.4.15                     v2.4.15                    
nette/finder                             v2.4.2                      v2.4.2                     
nette/neon                               v2.4.3                      v2.4.3                     
nette/php-generator                      v3.2.1                      v3.2.1                     
nette/robot-loader                       v3.1.0                      v3.1.0                     
nette/utils                              v2.5.3                      v2.5.3                     
nikic/php-parser                         v3.1.5                      v4.2.0                     
nyholm/nsa                               1.1.0                       1.1.0                      
ocramius/package-versions                1.3.0                       1.3.0                      
paragonie/random_compat                  v2.0.18                     v9.99.99                   
patchwork/jsqueeze                       v2.0.5                      v2.0.5                     
php-translation/common                   1.0.0                       1.0.0                      
php-translation/extractor                1.7.1                       1.7.1                      
php-translation/symfony-bundle           0.8.1                       0.8.1                      
php-translation/symfony-storage          1.0.1                       1.0.1                      
phpcollection/phpcollection              0.5.0                       0.5.0                      
phpoption/phpoption                      1.5.0                       1.5.0                      
phpstan/phpdoc-parser                    0.2                         0.3.1                      
phpstan/phpstan                          0.9.2                       0.11.1                     
psr/cache                                1.0.1                       1.0.1                      
psr/container                            1.0.0                       1.0.0                      
psr/http-message                         1.0.1                       1.0.1                      
psr/link                                 1.0.0                       1.0.0                      
psr/log                                  1.1.0                       1.1.0                      
psr/simple-cache                         1.0.1                       1.0.1                      
ralouphie/getallheaders                  2.0.5                       3.0.2                      
sensio/distribution-bundle               v5.0.24                     v5.0.24                    
sensio/framework-extra-bundle            v5.2.4                      v5.2.4                     
sensio/generator-bundle                  v3.1.7                      v3.1.7                     
sensiolabs/security-checker              v5.0.3                      v5.0.3                     
sonata-project/admin-bundle              3.45.1                      3.45.1                     
sonata-project/block-bundle              3.14.0                      3.14.0                     
sonata-project/cache                     2.0.1                       2.0.1                      
sonata-project/core-bundle               dev-use-new-classes 633c1cf dev-use-new-classes 633c1cf
sonata-project/datagrid-bundle           2.4.0                       2.4.0                      
sonata-project/doctrine-extensions       1.1.5                       1.1.5                      
sonata-project/doctrine-orm-admin-bundle 3.8.2                       3.8.2                      
sonata-project/easy-extends-bundle       2.5.0                       2.5.0                      
sonata-project/exporter                  2.0.1                       2.0.1                      
sonata-project/media-bundle              3.18.1                      3.18.1                     
sonata-project/translation-bundle        2.4.0                       2.4.0                      
sonata-project/user-bundle               4.3.0                       4.3.0                      
stof/doctrine-extensions-bundle          v1.3.0                      v1.3.0                     
swiftmailer/swiftmailer                  v5.4.12                     v6.1.3                     
symfony/assetic-bundle                   v2.8.2                      v2.8.2                     
Package symfony/assetic-bundle is abandoned, you should avoid using it. Use symfony/webpack-encore-pack instead.
symfony/monolog-bundle                   v3.3.1                      v3.3.1                     
symfony/phpunit-bridge                   v4.2.3                      v4.2.3                     
symfony/polyfill-apcu                    v1.10.0                     v1.10.0                    
symfony/polyfill-ctype                   v1.10.0                     v1.10.0                    
symfony/polyfill-intl-icu                v1.10.0                     v1.10.0                    
symfony/polyfill-mbstring                v1.10.0                     v1.10.0                    
symfony/polyfill-php56                   v1.10.0                     v1.10.0                    
symfony/polyfill-php70                   v1.10.0                     v1.10.0                    
symfony/polyfill-util                    v1.10.0                     v1.10.0                    
symfony/security-acl                     v3.0.1                      v3.0.1                     
symfony/swiftmailer-bundle               v2.6.7                      v3.2.5                     
symfony/symfony                          v3.4.22                     v4.2.3                     
twig/extensions                          v1.5.4                      v1.5.4                     
twig/twig                                v2.6.2                      v2.6.2                     
webmozart/assert                         1.4.0                       1.4.0                      
willdurand/jsonp-callback-validator      v1.1.0                      v1.1.0                     
willdurand/negotiation                   v2.3.1                      v2.3.1    

These are the deprecations:

09:27:59 | php | User Deprecated: The Sonata\CoreBundle\Twig\Extension\FlashMessageExtension class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Twig\Extension\FlashMessageExtension instead.Show context    Show trace
-- | -- | --
09:27:27 | - | The Sonata\CoreBundle\Serializer\BaseSerializerHandler class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Serializer\BaseSerializerHandler instead.Show context    Show trace
09:27:27 | - | The Sonata\CoreBundle\Date\MomentFormatConverter class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Form\Date\MomentFormatConverter instead.Show context    Show trace
09:27:27 | - | The Sonata\CoreBundle\FlashMessage\FlashManager class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Twig\FlashMessage\FlashManager instead.Show context    Show trace
09:27:27 | - | The Sonata\CoreBundle\Twig\Extension\FlashMessageExtension class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Twig\Extension\FlashMessageExtension instead.Show context    Show trace
09:27:27 | - | The Sonata\CoreBundle\Validator\InlineValidator class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Form\Validator\InlineValidator instead.Show context    Show trace
09:27:27 | - | The Sonata\AdminBundle\Command\CreateClassCacheCommand class is deprecated since version 3.39.0 and will be removed in 4.0.Show context    Show trace
09:27:27 | - | The Sonata\CoreBundle\Model\PageableManagerInterface class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\DatagridBundle\Pager\PageableInterface instead.Show context    Show trace
09:27:27 | - | The Sonata\CoreBundle\Model\ManagerInterface class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Doctrine\Model\ManagerInterface instead.Show context    Show trace
09:27:27 | - | The Sonata\CoreBundle\Model\BaseEntityManager class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Doctrine\Entity\BaseEntityManager instead.Show context    Show trace
greg0ire commented 5 years ago

OK well, that's another issue, will have to get stack traces for those

lukepass commented 5 years ago

Is this format ok? I can get a screenshot or maybe try to format it better:

09:27:59 | php | User Deprecated: The Sonata\CoreBundle\Twig\Extension\FlashMessageExtension class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Twig\Extension\FlashMessageExtension instead.Show context    Hide trace{▼   /home/luca/Sites/base_project/vendor/sonata-project/core-bundle/src/CoreBundle/Twig/Extension/FlashMessageExtension.php:22 {▶}   /home/luca/Sites/base_project/var/cache/dev/ContainerBjjpsjk/appDevDebugProjectContainer.php:1582 {▼     › include_once $this->targetDirs[3].'/vendor/sonata-project/core-bundle/src/Twig/Extension/FlashMessageExtension.php';     › include_once $this->targetDirs[3].'/vendor/sonata-project/core-bundle/src/CoreBundle/Twig/Extension/FlashMessageExtension.php';     › include_once $this->targetDirs[3].'/vendor/sonata-project/core-bundle/src/Twig/Extension/FormTypeExtension.php';   }   /home/luca/Sites/base_project/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php:174 {▶}   /home/luca/Sites/base_project/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:585 {▶}   /home/luca/Sites/base_project/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:135 {▶}   /home/luca/Sites/base_project/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:195 {▶}   /home/luca/Sites/base_project/web/app_dev.php:29 {▶} }
-- | -- | --
09:27:27 | - | The Sonata\CoreBundle\Serializer\BaseSerializerHandler class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Serializer\BaseSerializerHandler instead.Show context    Hide trace{▼   /home/luca/Sites/base_project/vendor/sonata-project/core-bundle/src/CoreBundle/Serializer/BaseSerializerHandler.php:20 {▶}   /home/luca/Sites/base_project/vendor/symfony/symfony/src/Symfony/Component/Debug/DebugClassLoader.php:156 {▶} }
09:27:27 | - | The Sonata\CoreBundle\Date\MomentFormatConverter class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Form\Date\MomentFormatConverter instead.Show context    Hide trace{▼   /home/luca/Sites/base_project/vendor/sonata-project/core-bundle/src/CoreBundle/Date/MomentFormatConverter.php:20 {▶}   /home/luca/Sites/base_project/vendor/symfony/symfony/src/Symfony/Component/Debug/DebugClassLoader.php:156 {▶} }
09:27:27 | - | The Sonata\CoreBundle\FlashMessage\FlashManager class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Twig\FlashMessage\FlashManager instead.Show context    Hide trace{▼   /home/luca/Sites/base_project/vendor/sonata-project/core-bundle/src/CoreBundle/FlashMessage/FlashManager.php:20 {▶}   /home/luca/Sites/base_project/vendor/symfony/symfony/src/Symfony/Component/Debug/DebugClassLoader.php:156 {▶} }
09:27:27 | - | The Sonata\CoreBundle\Twig\Extension\FlashMessageExtension class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Twig\Extension\FlashMessageExtension instead.Show context    Hide trace{▼   /home/luca/Sites/base_project/vendor/sonata-project/core-bundle/src/CoreBundle/Twig/Extension/FlashMessageExtension.php:22 {▶}   /home/luca/Sites/base_project/vendor/symfony/symfony/src/Symfony/Component/Debug/DebugClassLoader.php:156 {▶} }
09:27:27 | - | The Sonata\CoreBundle\Validator\InlineValidator class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Form\Validator\InlineValidator instead.Show context    Hide trace{▼   /home/luca/Sites/base_project/vendor/sonata-project/core-bundle/src/CoreBundle/Validator/InlineValidator.php:20 {▶}   /home/luca/Sites/base_project/vendor/symfony/symfony/src/Symfony/Component/Debug/DebugClassLoader.php:156 {▶} }
09:27:27 | - | The Sonata\AdminBundle\Command\CreateClassCacheCommand class is deprecated since version 3.39.0 and will be removed in 4.0.Show context    Hide trace{▼   /home/luca/Sites/base_project/vendor/sonata-project/admin-bundle/src/Command/CreateClassCacheCommand.php:23 {▶}   /home/luca/Sites/base_project/vendor/symfony/symfony/src/Symfony/Component/Debug/DebugClassLoader.php:156 {▶} }
09:27:27 | - | The Sonata\CoreBundle\Model\PageableManagerInterface class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\DatagridBundle\Pager\PageableInterface instead.Show context    Hide trace{▼   /home/luca/Sites/base_project/vendor/sonata-project/core-bundle/src/CoreBundle/Model/PageableManagerInterface.php:20 {▶}   /home/luca/Sites/base_project/vendor/symfony/symfony/src/Symfony/Component/Debug/DebugClassLoader.php:156 {▶} }
09:27:27 | - | The Sonata\CoreBundle\Model\ManagerInterface class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Doctrine\Model\ManagerInterface instead.Show context    Hide trace{▼   /home/luca/Sites/base_project/vendor/sonata-project/core-bundle/src/CoreBundle/Model/ManagerInterface.php:20 {▶}   /home/luca/Sites/base_project/vendor/symfony/symfony/src/Symfony/Component/Debug/DebugClassLoader.php:156 {▶} }
09:27:27 | - | The Sonata\CoreBundle\Model\BaseEntityManager class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Doctrine\Entity\BaseEntityManager instead.Show context    Hide trace{▼   /home/luca/Sites/base_project/vendor/sonata-project/core-bundle/src/CoreBundle/Model/BaseEntityManager.php:20 {▶}   /home/luca/Sites/base_project/vendor/symfony/symfony/src/Symfony/Component/Debug/DebugClassLoader.php:156 {▶}
greg0ire commented 5 years ago

It's a bit hairy, but the biggest problem is that it is not completely unfolded

lukepass commented 5 years ago

Yes, you're right :smile:

User Deprecated: The Sonata\CoreBundle\Twig\Extension\FlashMessageExtension class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Twig\Extension\FlashMessageExtension instead.
Show context    Hide trace
{▼
  /home/luca/Sites/base_project/vendor/sonata-project/core-bundle/src/CoreBundle/Twig/Extension/FlashMessageExtension.php:22 {▶}
  /home/luca/Sites/base_project/var/cache/dev/ContainerBjjpsjk/appDevDebugProjectContainer.php:1582 {▼
    › include_once $this->targetDirs[3].'/vendor/sonata-project/core-bundle/src/Twig/Extension/FlashMessageExtension.php';
    › include_once $this->targetDirs[3].'/vendor/sonata-project/core-bundle/src/CoreBundle/Twig/Extension/FlashMessageExtension.php';
    › include_once $this->targetDirs[3].'/vendor/sonata-project/core-bundle/src/Twig/Extension/FormTypeExtension.php';
  }
  /home/luca/Sites/base_project/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php:174 {▼
    ›     unset($this->privates['service_container']);
    ›     $initialize();
    › }
  }
  /home/luca/Sites/base_project/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:585 {▼
    › if (file_exists($cache->getPath()) && \is_object($this->container = include $cache->getPath())) {
    ›     $this->container->set('kernel', $this);
    ›     $oldContainer = $this->container;
  }
  /home/luca/Sites/base_project/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:135 {▼
    › // init container
    › $this->initializeContainer();
    › 
  }
  /home/luca/Sites/base_project/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:195 {▼
    › {
    ›     $this->boot();
    ›     ++$this->requestStackSize;
  }
  /home/luca/Sites/base_project/web/app_dev.php:29 {▼
    › $request = Request::createFromGlobals();
    › $response = $kernel->handle($request);
    › $response->send();
  }
}
The Sonata\CoreBundle\Serializer\BaseSerializerHandler class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Serializer\BaseSerializerHandler instead.
Show context    Hide trace
{▼
  /home/luca/Sites/base_project/vendor/sonata-project/core-bundle/src/CoreBundle/Serializer/BaseSerializerHandler.php:20 {▼
    ›     .' Use Sonata\Serializer\BaseSerializerHandler instead.',
    ›     E_USER_DEPRECATED
    › );
  }
  /home/luca/Sites/base_project/vendor/symfony/symfony/src/Symfony/Component/Debug/DebugClassLoader.php:156 {▼
    › } else {
    ›     require $file;
    › }
    arguments: {▼
      "/home/luca/Sites/base_project/vendor/sonata-project/core-bundle/src/CoreBundle/Model/BaseEntityManager.php"
    }
  }
}
The Sonata\CoreBundle\Date\MomentFormatConverter class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Form\Date\MomentFormatConverter instead.
Show context    Hide trace
{▼
  /home/luca/Sites/base_project/vendor/sonata-project/core-bundle/src/CoreBundle/Date/MomentFormatConverter.php:20 {▼
    ›     .' Use Sonata\Form\Date\MomentFormatConverter instead.',
    ›     E_USER_DEPRECATED
    › );
  }
  /home/luca/Sites/base_project/vendor/symfony/symfony/src/Symfony/Component/Debug/DebugClassLoader.php:156 {▼
    › } else {
    ›     require $file;
    › }
    arguments: {▼
      "/home/luca/Sites/base_project/vendor/sonata-project/core-bundle/src/CoreBundle/Model/BaseEntityManager.php"
    }
  }
}
The Sonata\CoreBundle\FlashMessage\FlashManager class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Twig\FlashMessage\FlashManager instead.
Show context    Hide trace
{▼
  /home/luca/Sites/base_project/vendor/sonata-project/core-bundle/src/CoreBundle/FlashMessage/FlashManager.php:20 {▼
    ›     .' Use Sonata\Twig\FlashMessage\FlashManager instead.',
    ›     E_USER_DEPRECATED
    › );
  }
  /home/luca/Sites/base_project/vendor/symfony/symfony/src/Symfony/Component/Debug/DebugClassLoader.php:156 {▼
    › } else {
    ›     require $file;
    › }
    arguments: {▼
      "/home/luca/Sites/base_project/vendor/sonata-project/core-bundle/src/CoreBundle/Model/BaseEntityManager.php"
    }
  }
}
The Sonata\CoreBundle\Twig\Extension\FlashMessageExtension class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Twig\Extension\FlashMessageExtension instead.
Show context    Hide trace
{▼
  /home/luca/Sites/base_project/vendor/sonata-project/core-bundle/src/CoreBundle/Twig/Extension/FlashMessageExtension.php:22 {▼
    ›     .' Use Sonata\Twig\Extension\FlashMessageExtension instead.',
    ›     E_USER_DEPRECATED
    › );
  }
  /home/luca/Sites/base_project/vendor/symfony/symfony/src/Symfony/Component/Debug/DebugClassLoader.php:156 {▼
    › } else {
    ›     require $file;
    › }
    arguments: {▼
      "/home/luca/Sites/base_project/vendor/sonata-project/core-bundle/src/CoreBundle/Model/BaseEntityManager.php"
    }
  }
}
The Sonata\CoreBundle\Validator\InlineValidator class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Form\Validator\InlineValidator instead.
Show context    Hide trace
{▼
  /home/luca/Sites/base_project/vendor/sonata-project/core-bundle/src/CoreBundle/Validator/InlineValidator.php:20 {▼
    ›     .' Use Sonata\Form\Validator\InlineValidator instead.',
    ›     E_USER_DEPRECATED
    › );
  }
  /home/luca/Sites/base_project/vendor/symfony/symfony/src/Symfony/Component/Debug/DebugClassLoader.php:156 {▼
    › } else {
    ›     require $file;
    › }
    arguments: {▼
      "/home/luca/Sites/base_project/vendor/sonata-project/core-bundle/src/CoreBundle/Model/BaseEntityManager.php"
    }
  }
}
The Sonata\AdminBundle\Command\CreateClassCacheCommand class is deprecated since version 3.39.0 and will be removed in 4.0.
Show context    Hide trace
{▼
  /home/luca/Sites/base_project/vendor/sonata-project/admin-bundle/src/Command/CreateClassCacheCommand.php:23 {▼
    ›     'The '.__NAMESPACE__.'\CreateClassCacheCommand class is deprecated since version 3.39.0 and will be removed in 4.0.',
    ›     E_USER_DEPRECATED
    › );
  }
  /home/luca/Sites/base_project/vendor/symfony/symfony/src/Symfony/Component/Debug/DebugClassLoader.php:156 {▼
    › } else {
    ›     require $file;
    › }
    arguments: {▼
      "/home/luca/Sites/base_project/vendor/sonata-project/core-bundle/src/CoreBundle/Model/BaseEntityManager.php"
    }
  }
}
The Sonata\CoreBundle\Model\PageableManagerInterface class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\DatagridBundle\Pager\PageableInterface instead.
Show context    Hide trace
{▼
  /home/luca/Sites/base_project/vendor/sonata-project/core-bundle/src/CoreBundle/Model/PageableManagerInterface.php:20 {▼
    ›     .' Use Sonata\DatagridBundle\Pager\PageableInterface instead.',
    ›     E_USER_DEPRECATED
    › );
  }
  /home/luca/Sites/base_project/vendor/symfony/symfony/src/Symfony/Component/Debug/DebugClassLoader.php:156 {▼
    › } else {
    ›     require $file;
    › }
    arguments: {▼
      "/home/luca/Sites/base_project/vendor/sonata-project/core-bundle/src/CoreBundle/Model/BaseEntityManager.php"
    }
  }
}
The Sonata\CoreBundle\Model\ManagerInterface class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Doctrine\Model\ManagerInterface instead.
Show context    Hide trace
{▼
  /home/luca/Sites/base_project/vendor/sonata-project/core-bundle/src/CoreBundle/Model/ManagerInterface.php:20 {▼
    ›     .' Use Sonata\Doctrine\Model\ManagerInterface instead.',
    ›     E_USER_DEPRECATED
    › );
  }
  /home/luca/Sites/base_project/vendor/symfony/symfony/src/Symfony/Component/Debug/DebugClassLoader.php:156 {▼
    › } else {
    ›     require $file;
    › }
    arguments: {▼
      "/home/luca/Sites/base_project/vendor/sonata-project/core-bundle/src/CoreBundle/Model/BaseEntityManager.php"
    }
  }
}
The Sonata\CoreBundle\Model\BaseEntityManager class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Doctrine\Entity\BaseEntityManager instead.
Show context    Hide trace
{▼
  /home/luca/Sites/base_project/vendor/sonata-project/core-bundle/src/CoreBundle/Model/BaseEntityManager.php:20 {▼
    ›     .' Use Sonata\Doctrine\Entity\BaseEntityManager instead.',
    ›     E_USER_DEPRECATED
    › );
  }
  /home/luca/Sites/base_project/vendor/symfony/symfony/src/Symfony/Component/Debug/DebugClassLoader.php:156 {▼
    › } else {
    ›     require $file;
    › }
    arguments: {▼
      "/home/luca/Sites/base_project/vendor/sonata-project/core-bundle/src/CoreBundle/Model/BaseEntityManager.php"
    }
  }
}
OskarStark commented 5 years ago

Are you done here @greg0ire ?

greg0ire commented 5 years ago

Yes

OskarStark commented 5 years ago

Thank you

ossinkine commented 5 years ago

This PR breaks BC, right?

greg0ire commented 5 years ago

Uuuuh no? Why do you think it does?

ossinkine commented 5 years ago

For example, my service depends on sonata.core.twig.status_runtime service (let's say this is a decorator) and it has Sonata\CoreBundle\Twig\Extension\StatusRuntime in constructor arguments. After update I get an error because the constructor argument is instance of Sonata\Twig\Extension\StatusRuntime, not Sonata\CoreBundle\Twig\Extension\StatusRuntime.

greg0ire commented 5 years ago

Weird… it's a class_alias, which means it is supposed to be the same thing. Is this BC-break something you think will probably happened or something you observed?

ossinkine commented 5 years ago

My bad, I have not seen class_alias

lukepass commented 5 years ago

@greg0ire any news about the remaining deprecations? Thanks!