mirror of
https://github.com/danog/psalm.git
synced 2024-12-04 10:38:49 +01:00
42 lines
552 B
Markdown
42 lines
552 B
Markdown
# AmbiguousConstantInheritance
|
|
|
|
Emitted when a constant is inherited from multiple sources.
|
|
|
|
```php
|
|
<?php
|
|
|
|
interface Foo
|
|
{
|
|
/** @var non-empty-string */
|
|
public const CONSTANT='foo';
|
|
}
|
|
|
|
interface Bar
|
|
{
|
|
/**
|
|
* @var non-empty-string
|
|
*/
|
|
public const CONSTANT='bar';
|
|
}
|
|
|
|
interface Baz extends Foo, Bar {}
|
|
```
|
|
|
|
```php
|
|
<?php
|
|
|
|
interface Foo
|
|
{
|
|
/** @var non-empty-string */
|
|
public const CONSTANT='foo';
|
|
}
|
|
|
|
class Bar
|
|
{
|
|
/** @var non-empty-string */
|
|
public const CONSTANT='bar';
|
|
}
|
|
|
|
class Baz extends Bar implements Foo {}
|
|
```
|