Skip to content

Commit

Permalink
minor #6269 Docs: redo warnings in RST docs to fix issue on website d…
Browse files Browse the repository at this point in the history
…ocs (keradus)

This PR was squashed before being merged into the master branch (closes #6269).

Discussion
----------

Docs: redo warnings in RST docs to fix issue on website docs

Fixes:
![Screenshot 2022-02-04 at 21 47 17](https://user-images.githubusercontent.com/2716794/152600863-8d598748-f1d6-4579-bac8-a355363efa5e.png)

Closes:
PHP-CS-Fixer/PHP-CS-Fixer.github.io#4

Commits
-------

f1a0942 Docs: redo warnings in RST docs to fix issue on website docs
  • Loading branch information
SpacePossum committed Feb 5, 2022
2 parents 86d0a4c + f1a0942 commit 42a449a
Show file tree
Hide file tree
Showing 65 changed files with 473 additions and 197 deletions.
8 changes: 6 additions & 2 deletions doc/rules/alias/array_push.rst
Expand Up @@ -4,9 +4,13 @@ Rule ``array_push``

Converts simple usages of ``array_push($x, $y);`` to ``$x[] = $y;``.

.. warning:: Using this rule is risky.
Warning
-------

Risky when the function ``array_push`` is overridden.
Using this rule is risky
~~~~~~~~~~~~~~~~~~~~~~~~

Risky when the function ``array_push`` is overridden.

Examples
--------
Expand Down
8 changes: 6 additions & 2 deletions doc/rules/alias/ereg_to_preg.rst
Expand Up @@ -4,9 +4,13 @@ Rule ``ereg_to_preg``

Replace deprecated ``ereg`` regular expression functions with ``preg``.

.. warning:: Using this rule is risky.
Warning
-------

Risky if the ``ereg`` function is overridden.
Using this rule is risky
~~~~~~~~~~~~~~~~~~~~~~~~

Risky if the ``ereg`` function is overridden.

Examples
--------
Expand Down
10 changes: 7 additions & 3 deletions doc/rules/alias/mb_str_functions.rst
Expand Up @@ -4,10 +4,14 @@ Rule ``mb_str_functions``

Replace non multibyte-safe functions with corresponding mb function.

.. warning:: Using this rule is risky.
Warning
-------

Risky when any of the functions are overridden, or when relying on the string
byte size rather than its length in characters.
Using this rule is risky
~~~~~~~~~~~~~~~~~~~~~~~~

Risky when any of the functions are overridden, or when relying on the string
byte size rather than its length in characters.

Examples
--------
Expand Down
10 changes: 7 additions & 3 deletions doc/rules/alias/modernize_strpos.rst
Expand Up @@ -5,10 +5,14 @@ Rule ``modernize_strpos``
Replace ``strpos()`` calls with ``str_starts_with()`` or ``str_contains()`` if
possible.

.. warning:: Using this rule is risky.
Warning
-------

Risky if ``strpos``, ``str_starts_with`` or ``str_contains`` functions are
overridden.
Using this rule is risky
~~~~~~~~~~~~~~~~~~~~~~~~

Risky if ``strpos``, ``str_starts_with`` or ``str_contains`` functions are
overridden.

Examples
--------
Expand Down
8 changes: 6 additions & 2 deletions doc/rules/alias/no_alias_functions.rst
Expand Up @@ -4,9 +4,13 @@ Rule ``no_alias_functions``

Master functions shall be used instead of aliases.

.. warning:: Using this rule is risky.
Warning
-------

Risky when any of the alias functions are overridden.
Using this rule is risky
~~~~~~~~~~~~~~~~~~~~~~~~

Risky when any of the alias functions are overridden.

Configuration
-------------
Expand Down
8 changes: 6 additions & 2 deletions doc/rules/alias/pow_to_exponentiation.rst
Expand Up @@ -4,9 +4,13 @@ Rule ``pow_to_exponentiation``

Converts ``pow`` to the ``**`` operator.

.. warning:: Using this rule is risky.
Warning
-------

Risky when the function ``pow`` is overridden.
Using this rule is risky
~~~~~~~~~~~~~~~~~~~~~~~~

Risky when the function ``pow`` is overridden.

Examples
--------
Expand Down
10 changes: 7 additions & 3 deletions doc/rules/alias/random_api_migration.rst
Expand Up @@ -5,10 +5,14 @@ Rule ``random_api_migration``
Replaces ``rand``, ``srand``, ``getrandmax`` functions calls with their ``mt_*``
analogs or ``random_int``.

.. warning:: Using this rule is risky.
Warning
-------

Risky when the configured functions are overridden. Or when relying on the
seed based generating of the numbers.
Using this rule is risky
~~~~~~~~~~~~~~~~~~~~~~~~

Risky when the configured functions are overridden. Or when relying on the seed
based generating of the numbers.

Configuration
-------------
Expand Down
10 changes: 7 additions & 3 deletions doc/rules/alias/set_type_to_cast.rst
Expand Up @@ -4,10 +4,14 @@ Rule ``set_type_to_cast``

Cast shall be used, not ``settype``.

.. warning:: Using this rule is risky.
Warning
-------

Risky when the ``settype`` function is overridden or when used as the 2nd or
3rd expression in a ``for`` loop .
Using this rule is risky
~~~~~~~~~~~~~~~~~~~~~~~~

Risky when the ``settype`` function is overridden or when used as the 2nd or 3rd
expression in a ``for`` loop .

Examples
--------
Expand Down
8 changes: 6 additions & 2 deletions doc/rules/basic/non_printable_character.rst
Expand Up @@ -5,9 +5,13 @@ Rule ``non_printable_character``
Remove Zero-width space (ZWSP), Non-breaking space (NBSP) and other invisible
unicode symbols.

.. warning:: Using this rule is risky.
Warning
-------

Risky when strings contain intended invisible characters.
Using this rule is risky
~~~~~~~~~~~~~~~~~~~~~~~~

Risky when strings contain intended invisible characters.

Configuration
-------------
Expand Down
10 changes: 7 additions & 3 deletions doc/rules/basic/psr_autoloading.rst
Expand Up @@ -5,10 +5,14 @@ Rule ``psr_autoloading``
Classes must be in a path that matches their namespace, be at least one
namespace deep and the class name should match the file name.

.. warning:: Using this rule is risky.
Warning
-------

This fixer may change your class name, which will break the code that depends
on the old name.
Using this rule is risky
~~~~~~~~~~~~~~~~~~~~~~~~

This fixer may change your class name, which will break the code that depends on
the old name.

Configuration
-------------
Expand Down
10 changes: 7 additions & 3 deletions doc/rules/cast_notation/modernize_types_casting.rst
Expand Up @@ -5,10 +5,14 @@ Rule ``modernize_types_casting``
Replaces ``intval``, ``floatval``, ``doubleval``, ``strval`` and ``boolval``
function calls with according type casting operator.

.. warning:: Using this rule is risky.
Warning
-------

Risky if any of the functions ``intval``, ``floatval``, ``doubleval``,
``strval`` or ``boolval`` are overridden.
Using this rule is risky
~~~~~~~~~~~~~~~~~~~~~~~~

Risky if any of the functions ``intval``, ``floatval``, ``doubleval``,
``strval`` or ``boolval`` are overridden.

Examples
--------
Expand Down
8 changes: 6 additions & 2 deletions doc/rules/class_notation/final_class.rst
Expand Up @@ -17,9 +17,13 @@ need to extend a standalone class, create an interface and use the Composite
pattern. If you aren't ready yet for serious OOP, go with
FinalInternalClassFixer, it's fine.

.. warning:: Using this rule is risky.
Warning
-------

Risky when subclassing non-abstract classes.
Using this rule is risky
~~~~~~~~~~~~~~~~~~~~~~~~

Risky when subclassing non-abstract classes.

Examples
--------
Expand Down
8 changes: 6 additions & 2 deletions doc/rules/class_notation/final_internal_class.rst
Expand Up @@ -4,9 +4,13 @@ Rule ``final_internal_class``

Internal classes should be ``final``.

.. warning:: Using this rule is risky.
Warning
-------

Changing classes to ``final`` might cause code execution to break.
Using this rule is risky
~~~~~~~~~~~~~~~~~~~~~~~~

Changing classes to ``final`` might cause code execution to break.

Configuration
-------------
Expand Down
Expand Up @@ -10,9 +10,13 @@ Description
Enforce API encapsulation in an inheritance architecture. If you want to
override a method, use the Template method pattern.

.. warning:: Using this rule is risky.
Warning
-------

Risky when overriding ``public`` methods of ``abstract`` classes.
Using this rule is risky
~~~~~~~~~~~~~~~~~~~~~~~~

Risky when overriding ``public`` methods of ``abstract`` classes.

Examples
--------
Expand Down
10 changes: 7 additions & 3 deletions doc/rules/class_notation/no_php4_constructor.rst
Expand Up @@ -4,10 +4,14 @@ Rule ``no_php4_constructor``

Convert PHP4-style constructors to ``__construct``.

.. warning:: Using this rule is risky.
Warning
-------

Risky when old style constructor being fixed is overridden or overrides
parent one.
Using this rule is risky
~~~~~~~~~~~~~~~~~~~~~~~~

Risky when old style constructor being fixed is overridden or overrides parent
one.

Examples
--------
Expand Down
8 changes: 6 additions & 2 deletions doc/rules/class_notation/no_unneeded_final_method.rst
Expand Up @@ -5,9 +5,13 @@ Rule ``no_unneeded_final_method``
A ``final`` class must not have ``final`` methods and ``private`` methods must
not be ``final``.

.. warning:: Using this rule is risky.
Warning
-------

Risky when child class overrides a ``private`` method.
Using this rule is risky
~~~~~~~~~~~~~~~~~~~~~~~~

Risky when child class overrides a ``private`` method.

Configuration
-------------
Expand Down
12 changes: 8 additions & 4 deletions doc/rules/class_notation/ordered_interfaces.rst
Expand Up @@ -4,11 +4,15 @@ Rule ``ordered_interfaces``

Orders the interfaces in an ``implements`` or ``interface extends`` clause.

.. warning:: Using this rule is risky.
Warning
-------

Risky for ``implements`` when specifying both an interface and its parent
interface, because PHP doesn't break on ``parent, child`` but does on
``child, parent``.
Using this rule is risky
~~~~~~~~~~~~~~~~~~~~~~~~

Risky for ``implements`` when specifying both an interface and its parent
interface, because PHP doesn't break on ``parent, child`` but does on ``child,
parent``.

Configuration
-------------
Expand Down
8 changes: 6 additions & 2 deletions doc/rules/class_notation/ordered_traits.rst
Expand Up @@ -4,9 +4,13 @@ Rule ``ordered_traits``

Trait ``use`` statements must be sorted alphabetically.

.. warning:: Using this rule is risky.
Warning
-------

Risky when depending on order of the imports.
Using this rule is risky
~~~~~~~~~~~~~~~~~~~~~~~~

Risky when depending on order of the imports.

Examples
--------
Expand Down
9 changes: 6 additions & 3 deletions doc/rules/class_notation/self_accessor.rst
Expand Up @@ -5,10 +5,13 @@ Rule ``self_accessor``
Inside class or interface element ``self`` should be preferred to the class name
itself.

.. warning:: Using this rule is risky.
Warning
-------

Risky when using dynamic calls like get_called_class() or late static
binding.
Using this rule is risky
~~~~~~~~~~~~~~~~~~~~~~~~

Risky when using dynamic calls like get_called_class() or late static binding.

Examples
--------
Expand Down
10 changes: 7 additions & 3 deletions doc/rules/class_usage/date_time_immutable.rst
Expand Up @@ -4,10 +4,14 @@ Rule ``date_time_immutable``

Class ``DateTimeImmutable`` should be used instead of ``DateTime``.

.. warning:: Using this rule is risky.
Warning
-------

Risky when the code relies on modifying ``DateTime`` objects or if any of the
``date_create*`` functions are overridden.
Using this rule is risky
~~~~~~~~~~~~~~~~~~~~~~~~

Risky when the code relies on modifying ``DateTime`` objects or if any of the
``date_create*`` functions are overridden.

Examples
--------
Expand Down
10 changes: 7 additions & 3 deletions doc/rules/comment/comment_to_phpdoc.rst
Expand Up @@ -4,10 +4,14 @@ Rule ``comment_to_phpdoc``

Comments with annotation should be docblock when used on structural elements.

.. warning:: Using this rule is risky.
Warning
-------

Risky as new docblocks might mean more, e.g. a Doctrine entity might have a
new column in database.
Using this rule is risky
~~~~~~~~~~~~~~~~~~~~~~~~

Risky as new docblocks might mean more, e.g. a Doctrine entity might have a new
column in database.

Configuration
-------------
Expand Down
8 changes: 6 additions & 2 deletions doc/rules/constant_notation/native_constant_invocation.rst
Expand Up @@ -6,9 +6,13 @@ Add leading ``\`` before constant invocation of internal constant to speed up
resolving. Constant name match is case-sensitive, except for ``null``, ``false``
and ``true``.

.. warning:: Using this rule is risky.
Warning
-------

Risky when any of the constants are namespaced or overridden.
Using this rule is risky
~~~~~~~~~~~~~~~~~~~~~~~~

Risky when any of the constants are namespaced or overridden.

Configuration
-------------
Expand Down
8 changes: 6 additions & 2 deletions doc/rules/function_notation/combine_nested_dirname.rst
Expand Up @@ -5,9 +5,13 @@ Rule ``combine_nested_dirname``
Replace multiple nested calls of ``dirname`` by only one call with second
``$level`` parameter. Requires PHP >= 7.0.

.. warning:: Using this rule is risky.
Warning
-------

Risky when the function ``dirname`` is overridden.
Using this rule is risky
~~~~~~~~~~~~~~~~~~~~~~~~

Risky when the function ``dirname`` is overridden.

Examples
--------
Expand Down

0 comments on commit 42a449a

Please sign in to comment.