Skip to content

Annotations cannot be enabled error occurs when installing anything requiring doctrine/annotations. #24683

Closed
@nesl247

Description

@nesl247
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 4.0.0-BETA1

When running composer require friendsofphp/php-cs-fixer:2.7-x-dev on Symfony 4, I get the following:

composer require --dev friendsofphp/php-cs-fixer:2.7.x-dev                                                                                 0 < 15:32:54
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 12 installs, 0 updates, 0 removals
  - Installing symfony/stopwatch (v4.0.0-BETA1): Loading from cache
  - Installing symfony/process (v4.0.0-BETA1): Loading from cache
  - Installing symfony/polyfill-php72 (v1.6.0): Loading from cache
  - Installing paragonie/random_compat (v2.0.11): Loading from cache
  - Installing symfony/polyfill-php70 (v1.6.0): Loading from cache
  - Installing symfony/options-resolver (v4.0.0-BETA1): Loading from cache
  - Installing php-cs-fixer/diff (v1.2.0): Loading from cache
  - Installing gecko-packages/gecko-php-unit (v2.2): Loading from cache
  - Installing doctrine/lexer (v1.0.1): Loading from cache
  - Installing doctrine/annotations (v1.5.0): Loading from cache
  - Installing composer/semver (1.4.2): Loading from cache
  - Installing friendsofphp/php-cs-fixer (2.7.x-dev fbc5c68): Loading from cache
Writing lock file
Generating autoload files
Symfony operations: 1 recipe (a31ecc32214b0ec17448c074f556d474)
  - Configuring friendsofphp/php-cs-fixer (2.2): From github.com/symfony/recipes:master
Executing script cache:clear [KO]
 [KO]
Script cache:clear returned with error code 1
!!
!!
!!  In FrameworkExtension.php line 1172:
!!
!!    Annotations cannot be enabled as the Doctrine Cache library is not installe
!!    d.
!!
!!
!!
!!

Installation failed, reverting ./composer.json to its original content.

This is a problem in my opinion because installing php-cs-fixer shouldn't require additional packages to make the framework work when I have specifically not installed annotations using flex.

On a related note, it only reverts composer.json, but does not remove the auto-generated .php_cs.dist, changes to .gitignore nor the changes to composer.lock.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions