8000 PropertyInfo does not depend on phpdocumentor/reflection-docblock in require block · Issue #26259 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
PropertyInfo does not depend on phpdocumentor/reflection-docblock in require block #26259
Closed
@hkdobrev

Description

@hkdobrev
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 3.4 and 4.0

The PropertyInfo component lists the phpdocumentor/reflection-docblock package as a developer dependency in require-dev:

"require-dev": {
"symfony/serializer": "~3.4|~4.0",
"symfony/cache": "~3.4|~4.0",
"symfony/dependency-injection": "~3.4|~4.0",
"phpdocumentor/reflection-docblock": "^3.0|^4.0",
"doctrine/annotations": "~1.0"
},

However, the PhpDocExtractor class depends on an interface and a class from that package without you using it directly.

public function __construct(DocBlockFactoryInterface $docBlockFactory = null, array $mutatorPrefixes = null, array $accessorPrefixes = null, array $arrayMutatorPrefixes = null)
{
$this->docBlockFactory = $docBlockFactory ?: DocBlockFactory::createInstance();

The PropertyInfo component documentation states:

PhpDocExtractor

This extractor depends on the phpdocumentor/reflection-docblock library.

https://symfony.com/doc/current/components/property_info.html#phpdocextractor

I believe when the non-tests related code of the component has a dependency on a package, it should be in require instead of require-dev.

This caused a problem for us in production when we had the documentor package installed in development, but not listed in neither our own require nor require-dev dependencies as we do not use it anywhere in our code.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0