Skip to content

Class constants

Choose a tag to compare

@spaze spaze released this 11 Feb 00:33
d78e950

Support for disallowing (class) constants was added in v1.1.0 but it has never worked.

Now it should work. To disallow a class constant, you have to specify it using two keys, class & constant like:

parameters:
    disallowedConstants:
        -
            class: 'DateTimeInterface'
            constant: 'ISO8601'
            message: 'use DateTimeInterface::ATOM instead'

instead of just constant: 'DateTimeInterface::ISO8601'. This is to "mask" the constant to avoid it being detected and replaced by its value.

This is released as a "patch" version only despite requiring a new config key because it has never worked with the old one anyway so I think there's no need to preserve backwards compatibility.

(#49, thanks @ruudk for the report)