Skip to content
Snippets Groups Projects
Unverified Commit 5428b380 authored by Daniel Siepmann's avatar Daniel Siepmann
Browse files

TASK: Document new feature in docs

parent 28329844
Branches
1 merge request!78Feature/72 refactor sniff architecture
......@@ -156,3 +156,24 @@ Example:
.. code:: bash
--runtime-set removedConstantConfigFiles "/Some/Absolute/Path/*.yaml"
.. _configuration-features:
features
--------
Configure where to look for configuration files defining the feature mappings. Default is
``Configuration/Features/*.yaml`` inside the standard itself. Globing is used, so placeholders like
``*`` are possible, see https://secure.php.net/manual/en/function.glob.php
Using :file:`ruleset.xml`:
.. code:: xml
<config name="features" value="/Some/Absolute/Path/*.yaml"/>
Example:
.. code:: bash
--runtime-set features "/Some/Absolute/Path/*.yaml"
......@@ -24,6 +24,24 @@ The following resources might be helpful during working with ``phpcs``:
- :file:`CodeSniffer/File.php`
.. _extending-features:
Features
--------
Sniffs do not always add errors or warnings in our standard, instead for more flexibility, we use
them to find specific "tokens", e.g. class names. We then attach so called *Features* to sniffs to
work on that token.
E.g. we deliver the Feature ``LegacyClassnameFeature`` which will check whether a given class name
is legacy and should be replaced. As class names may occur in many places like type hints or php doc
blocks, the sniffs will detect the class names and the feature will work on them.
Features can be attached to the sniffs. A feature has to implement the ``FeatureInterface`` and will
work on tokens found by sniffs.
To attach a Feature to Sniffs, provide a yaml-configuration, see :ref:`configuration-features`.
.. _extending-tests:
Tests
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment