.. _structures-noparenthesisforlanguageconstruct:
.. _no-parenthesis-for-language-construct:
No Parenthesis For Language Construct
+++++++++++++++++++++++++++++++++++++
Some PHP language constructs, such are ``include``, ``require``, ``include_once``, ``require_once``, ``print``, ``echo`` don't need parenthesis. They accept parenthesis, but it is may lead to strange situations.
It it better to avoid using parenthesis with ``echo``, ``print``, ``return``, ``throw``, ``yield``, ``yield from``, ``include``, ``require``, ``include_once``, ``require_once``.
.. code-block:: php
See also `ON PHP LANGUAGE CONSTRUCTS AND PARENTHESES `_ and `include `_.
Connex PHP features
-------------------
+ `parenthesis `_
+ `language-construct `_
+ `return `_
+ `include `_
Suggestions
___________
* Remove parenthesis
Specs
_____
+--------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Short name | Structures/NoParenthesisForLanguageConstruct |
+--------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Rulesets | :ref:`All `, :ref:`Analyze `, :ref:`CE `, :ref:`CI-checks `, :ref:`Changed Behavior `, :ref:`Suggestions ` |
+--------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Exakat since | 0.8.4 |
+--------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| PHP Version | All |
+--------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Severity | Minor |
+--------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Time To Fix | Quick (30 mins) |
+--------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Precision | Very high |
+--------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| ClearPHP | `no-parenthesis-for-language-construct `__ |
+--------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Examples | :ref:`case-phpdocumentor-structures-noparenthesisforlanguageconstruct`, :ref:`case-phpmyadmin-structures-noparenthesisforlanguageconstruct` |
+--------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Available in | `Entreprise Edition `_, `Community Edition `_, `Exakat Cloud `_ |
+--------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+