.. _structures-couldbestatic: .. _could-be-a-static-variable: Could Be A Static Variable ++++++++++++++++++++++++++ This global is only used in one function or method. It may be transformed into a '`static `_' variable, instead of global. This allows you to keep the value between call to the function, but will not be accessible outside this function. .. code-block:: php Connex PHP features ------------------- + `static `_ + `static-variable `_ Specs _____ +--------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Short name | Structures/CouldBeStatic | +--------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Rulesets | :ref:`All `, :ref:`Analyze `, :ref:`Changed Behavior `, :ref:`Class Review ` | +--------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Exakat since | 0.8.4 | +--------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+ | PHP Version | All | +--------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Severity | Major | +--------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Time To Fix | Quick (30 mins) | +--------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Precision | Very high | +--------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Examples | :ref:`case-dolphin-structures-couldbestatic`, :ref:`case-contao-structures-couldbestatic` | +--------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Available in | `Entreprise Edition `_, `Exakat Cloud `_ | +--------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+