For general constants, Coding standards / Naming Conventions says that constants should always be all-uppercase, with underscores to separate words and that module-defined constant names should also be prefixed by the module module machine name, all-uppercase, and an underscore charatercharacter.
Object-oriented names don't follow the normal conventions of prefixing the name with the module or using underscores; instead, they opt for various forms of camel case.
Unfortunately, Object-oriented code doesn't mention class constants at all.
Which of the following is correct?
class Foo {
const FOO_CONSTANT_VALUE = 'bar';
}
class Foo {
const CONSTANT_VALUE = 'bar';
}
class Foo {
const constantValue = 'bar';
}
const FOO_CONSTANT_VALUE = 'bar';
const CONSTANT_VALUE = 'bar';
const constantValue = 'bar';