=================================== Rule ``native_function_invocation`` =================================== Add leading ``\`` before function invocation to speed up resolving. Warning ------- Using this rule is risky ~~~~~~~~~~~~~~~~~~~~~~~~ Risky when any of the functions are overridden. Configuration ------------- ``exclude`` ~~~~~~~~~~~ List of functions to ignore. Allowed types: ``array`` Default value: ``[]`` ``include`` ~~~~~~~~~~~ List of function names or sets to fix. Defined sets are ``@internal`` (all native functions), ``@all`` (all global functions) and ``@compiler_optimized`` (functions that are specially optimized by Zend). Allowed types: ``array`` Default value: ``['@compiler_optimized']`` ``scope`` ~~~~~~~~~ Only fix function calls that are made within a namespace or fix all. Allowed values: ``'all'`` and ``'namespaced'`` Default value: ``'all'`` ``strict`` ~~~~~~~~~~ Whether leading ``\`` of function call not meant to have it should be removed. Allowed types: ``bool`` Default value: ``true`` Examples -------- Example #1 ~~~~~~~~~~ *Default* configuration. .. code-block:: diff --- Original +++ New ['json_encode']]``. .. code-block:: diff --- Original +++ New 'all']``. .. code-block:: diff --- Original +++ New 'namespaced']``. .. code-block:: diff --- Original +++ New ['myGlobalFunction']]``. .. code-block:: diff --- Original +++ New ['@all']]``. .. code-block:: diff --- Original +++ New ['@internal']]``. .. code-block:: diff --- Original +++ New ['@compiler_optimized']]``. .. code-block:: diff --- Original +++ New `_ with config: ``['include' => ['@compiler_optimized'], 'scope' => 'namespaced', 'strict' => true]`` - `@Symfony:risky <./../../ruleSets/SymfonyRisky.rst>`_ with config: ``['include' => ['@compiler_optimized'], 'scope' => 'namespaced', 'strict' => true]``