.. _typehints-couldbeself: .. _could-be-self: Could Be Self +++++++++++++ Mark arguments, return types and properties that can be set to ``self``. This applies only to methods. This analysis works when typehints have already been configured. .. code-block:: php Suggestions ___________ * Add `self` typehint to the code. * Add the literal class/type typehint to the code. Specs _____ +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Short name | Typehints/CouldBeSelf | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Rulesets | :ref:`All `, :ref:`Typechecks ` | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Exakat since | 2.1.2 | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | PHP Version | All | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Severity | Major | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Time To Fix | Quick (30 mins) | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Precision | High | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Features | self | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Available in | `Entreprise Edition `_, `Exakat Cloud `_ | +--------------+-------------------------------------------------------------------------------------------------------------------------+