Skip to content

Support APP_ENV for determining container filename #105

@d42ohpaz

Description

@d42ohpaz

I saw #61 and that works as an okay workaround, but I would posit that developers shouldn't have to carry the burden of dynamically generating a configuration file or symlinking a to a specific file when an extension-level solution could just as easily be introduced in the code.

With that said, my suggestion would be to look for APP_ENV in the environment, and if it exists, use that to determine the container_xml_path automatically. Then we developers can omit that configuration option if we wanted to, or if we absolutely had to, we could still provide it and it would override automatically determining the value (i.e., use current logic).

In other words, if I - the developer - omit container_xml_path, and provide APP_ENV=test, then this extension would produce /path/to/my/var/cache/test/Project_KernelTestContainer.xml file. But, if I omit APP_ENV=test or I provide container_xml_path, then the extension would use the current logic.

The use case for this is to be able to run phpstan in both development and CI environments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions