Closed
Description
Symfony version(s) affected: 4.2.8
Description
doctrine-bridge uses symfony-form in require-dev.
However, during cache:clear in non-dev mode it does load Form/DoctrineOrmTypeGuesser.php which implements FormTypeGuesserInterface.
The interface FormTypeGuesserInterface can not be found if symfony/form is not installed.
PHP <7.2.0 allowed for such scenario (see https://bugs.php.net/bug.php?id=76980). Starting at PHP 7.2.0 a fatal error is thrown.
How to reproduce
- Install PHP 7.2.0
- require symfony/doctrine-bridge in composer.json
- run 'composer install'
Possible Solution
Move symfony/form from require-dev to require
Additional context
Output :
- Configuring symfony/security-bundle (>=3.3): From github.com/symfony/recipes:master
- Configuring symfony/validator (>=4.1): From github.com/symfony/recipes:master
Executing script cache:clear [KO]
[KO]
Script cache:clear returned with error code 255
!!
!! // Clearing the cache for the prod environment with debug
!! // false
!!
!! PHP Fatal error: During class fetch: Uncaught ReflectionException: Class Symfony\Component\Form\FormTypeGuesserInterface not found in /opt/releases/20190626075527/api/vendor/symfony/doctrine-bridge/Form/DoctrineOrmTypeGuesser.php:25
!! Stack trace:
!! #0 /opt/releases/20190626075527/api/vendor/composer/ClassLoader.php(444): include('/opt/releases/2...')
!! Untitled #1 /opt/releases/20190626075527/api/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile('/opt/releases/2...')
!! Renaming "Entities" to "Entity" #2 [internal function]: Composer\Autoload\ClassLoader->loadClass('Symfony\Bridge\...')
!! Untitled #3 [internal function]: spl_autoload_call('Symfony\Bridge\...')
!! Same change for mapping files #4 /opt/releases/20190626075527/api/vendor/symfony/config/Resource/ClassExistenceResource.php(76): class_exists('Symfony\Bridge\...')
!! Using ORM and MongoDB both in the same bundle. #5 /opt/releases/20190626075527/api/vendor/symfony/dependency-injection/ContainerBuilder.php(353): Symfony\Component\Config\Resource\ClassExistenceResource->isFresh(0)
!! [Form] Outstanding patches for Choice/Collection fields #6 /opt/releases/20190626075527/api/vendor/symfony/dependency-injection/Compiler/AutowirePass.php(338): Sy in /opt/releases/20190626075527/api/vendor/symfony/doctrine-bridge/Form/DoctrineOrmTypeGuesser.php on line 25
!! 14:00:50 CRITICAL [php] Fatal Error: During class fetch: Uncaught ReflectionException: Class Symfony\Component\Form\FormTypeGuesserInterface not found in /opt/releases/20190626075527/api/vendor/symfony/doctrine-bridge/Form/DoctrineOrmTypeGuesser.php:25
!! Stack trace:
!! #0 /opt/releases/20190626075527/api/vendor/composer/ClassLoader.php(444): include('/opt/releases/2...')
!! Untitled #1 /opt/releases/20190626075527/api/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile('/opt/releases/2...')
!! Renaming "Entities" to "Entity" #2 [internal function]: Composer\Autoload\ClassLoader->loadClass('Symfony\Bridge\...')
!! Untitled #3 [internal function]: spl_autoload_call('Symfony\Bridge\...')
!! Same change for mapping files #4 /opt/releases/20190626075527/api/vendor/symfony/config/Resource/ClassExistenceResource.php(76): class_exists('Symfony\Bridge\...')
!! Using ORM and MongoDB both in the same bundle. #5 /opt/releases/20190626075527/api/vendor/symfony/dependency-injection/ContainerBuilder.php(353): Symfony\Component\Config\Resource\ClassExistenceResource->isFresh(0)
!! [Form] Outstanding patches for Choice/Collection fields #6 /opt/releases/20190626075527/api/vendor/symfony/dependency-injection/Compiler/AutowirePass.php(338): Sy ["exception" => Symfony\Component\Debug\Exception\FatalErrorException { â¦}]
!!
!! In DoctrineOrmTypeGuesser.php line 25:
!!
!! Error: During class fetch: Uncaught ReflectionException: Class Symfony\Comp
!! onent\Form\FormTypeGuesserInterface not found in /opt/releases/201906260755
!! 27/api/vendor/symfony/doctrine-bridge/Form/DoctrineOrmTypeGuesser.php:25
!! Stack trace:
!! #0 /opt/releases/20190626075527/api/vendor/composer/ClassLoader.php(444): i
!! nclude('/opt/releases/2...')
!! Untitled #1 /opt/releases/20190626075527/api/vendor/composer/ClassLoader.php(322): C
!! omposer\Autoload\includeFile('/opt/releases/2...')
!! Renaming "Entities" to "Entity" #2 [internal function]: Composer\Autoload\ClassLoader->loadClass('Symfony\
!! Bridge\...')
!! Untitled #3 [internal function]: spl_autoload_call('Symfony\Bridge\...')
!! Same change for mapping files #4 /opt/releases/20190626075527/api/vendor/symfony/config/Resource/ClassExi
!! stenceResource.php(76): class_exists('Symfony\Bridge\...')
!! Using ORM and MongoDB both in the same bundle. #5 /opt/releases/20190626075527/api/vendor/symfony/dependency-injection/Con
!! tainerBuilder.php(353): Symfony\Component\Config\Resource\ClassExistenceRes
!! ource->isFresh(0)
!! [Form] Outstanding patches for Choice/Collection fields #6 /opt/releases/20190626075527/api/vendor/symfony/dependency-injection/Com
!! piler/AutowirePass.php(338): Sy
!!
!!
!! cache:clear [--no-warmup] [--no-optional-warmers] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--test-mode TEST-MODE] [--]
!!
!!
Script @auto-scripts was called via post-install-cmd