1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-02 09:37:59 +01:00
psalm/docs/running_psalm/issues/ExtensionRequirementViolation.md
Niclas van Eyk 5f019cef53
Initial proposal for psalm-require-{extends, implements} (#4361)
* initial implementation of psalm-require-extends

* Added @psalm-require-implements

* Added shortcode for ExtensionRequirementViolation

* Docs & cofig entries for @pasalm-require-{implements,extends}

* Added requirement violations to issues.md
2021-01-29 11:41:10 +01:00

361 B

ExtensionRequirementViolation

Emitted when a using class of a trait does not extend the class specified using @psalm-require-extends.

<?php

class A { }

/**
 * @psalm-require-extends A
 */
trait T { }

class B {
  // ExtensionRequirementViolation is emitted, as T requires
  // the using class B to extend A, which is not the case
  use T; 
}