.. _diagnostics: Diagnostics =========== .. This document is generated via the `development:generate-documentation` command .. contents:: :depth: 2 :backlinks: none :local: ``missing_method`` ------------------ Report if trying to call a class method which does not exist. .. tabs:: .. tab:: missing method on instance .. code-block:: php bar(); Diagnostic(s): - ``ERROR``: ``Method "bar" does not exist on class "Foobar"`` .. tab:: missing method for static invocation .. code-block:: php bar = 'foo'; } } Diagnostic(s): - ``WARN``: ``Property "bar" has not been defined`` ``missing_return_type`` ----------------------- Report if a method is missing a return type. .. tabs:: .. tab:: missing return type .. code-block:: php deprecated(); $this->notDeprecated(); } /** @deprecated This is deprecated */ public function deprecated(): void {} public function notDeprecated(): void {} } Diagnostic(s): - ``WARN``: ``Call to deprecated method "deprecated": This is deprecated`` .. tab:: deprecated on trait .. code-block:: php deprecated(); $this->notDeprecated(); } public function notDeprecated(): void {} } Diagnostic(s): - ``WARN``: ``Call to deprecated method "deprecated": This is deprecated`` .. tab:: deprecated on property .. code-block:: php deprecated; $ba = $this->notDeprecated; } } Diagnostic(s): - ``WARN``: ``Call to deprecated property "deprecated": This is deprecated`` ``undefined_variable`` ---------------------- Report if a variable is undefined and suggest variables with similar names. .. tabs:: .. tab:: undefined variable .. code-block:: php $data) { $list[$index] = $data; } return $list; ``docblock_missing_extends_tag`` -------------------------------- Report when a class extends a generic class but does not provide an @extends tag. .. tabs:: .. tab:: extends class requiring generic annotation .. code-block:: php ``` .. tab:: does not provide enough arguments .. code-block:: php */ class Foobar extends NeedGeneric { } Diagnostic(s): - ``WARN``: ``Generic tag `@extends NeedGeneric` should be compatible with `@extends NeedGeneric``` .. tab:: does not provide any arguments .. code-block:: php ``` .. tab:: provides empty arguments .. code-block:: php */ class Foobar extends NeedGeneric { } Diagnostic(s): - ``WARN``: ``Missing generic tag `@extends NeedGeneric``` .. tab:: wrong class .. code-block:: php */ class Foobar extends NeedGeneric { } Diagnostic(s): - ``WARN``: ``Missing generic tag `@extends NeedGeneric``` .. tab:: does not provide multiple arguments .. code-block:: php */ class Foobar extends NeedGeneric { } Diagnostic(s): - ``WARN``: ``Generic tag `@extends NeedGeneric` should be compatible with `@extends NeedGeneric``` ``docblock_missing_implements_tag`` ----------------------------------- Report when a class extends a generic class but does not provide an @extends tag. .. tabs:: .. tab:: implements class requiring generic annotation .. code-block:: php ``` .. tab:: does not provide enough arguments .. code-block:: php */ class Foobar implements NeedGeneric { } Diagnostic(s): - ``WARN``: ``Generic tag `@implements NeedGeneric` should be compatible with `@implements NeedGeneric``` .. tab:: provides one but not another .. code-block:: php */ class Foobar implements NeedGeneric1, NeedGeneric2 { } Diagnostic(s): - ``WARN``: ``Missing generic tag `@implements NeedGeneric2```