Skip to content

Latest commit

 

History

History
17 lines (14 loc) · 411 Bytes

InheritorViolation.md

File metadata and controls

17 lines (14 loc) · 411 Bytes

InheritorViolation

Emitted when a class/interface using @psalm-inheritors is extended/implemented by a class that does not fulfil it's requirements.

<?php

/**
 * @psalm-inheritors FooClass|BarClass
 */
class BaseClass {}
class BazClass extends BaseClass {}
// InheritorViolation is emitted, as BaseClass can only be extended
// by FooClass|BarClass, which is not the case
$a = new BazClass();