- american_english
- argument_variable_must_match_type
- avoid_repetetive_words
- be_kind_to_newcomers β
- blank_line_after_anchor
- blank_line_after_colon
- blank_line_after_directive
- blank_line_after_filepath_in_code_block
- blank_line_after_filepath_in_php_code_block
- blank_line_after_filepath_in_twig_code_block
- blank_line_after_filepath_in_xml_code_block
- blank_line_after_filepath_in_yaml_code_block
- blank_line_before_directive
- composer_dev_option_at_the_end
- composer_dev_option_not_at_the_end
- correct_code_block_directive_based_on_the_content
- deprecated_directive_major_version
- deprecated_directive_min_version
- deprecated_directive_should_have_version
- ensure_bash_prompt_before_composer_command
- ensure_correct_format_for_phpfunction
- ensure_exactly_one_space_before_directive_type
- ensure_exactly_one_space_between_link_definition_and_link
- ensure_explicit_nullable_types
- ensure_github_directive_start_with_prefix
- ensure_link_bottom
- ensure_link_definition_contains_valid_url
- ensure_order_of_code_blocks_in_configuration_block
- ensure_php_reference_syntax
- extend_abstract_admin
- extend_abstract_controller
- extend_controller
- extension_xlf_instead_of_xliff
- filename_uses_dashes_only
- filename_uses_underscores_only
- final_admin_classes
- final_admin_extension_classes
- forbidden_directives
- indention β
- kernel_instead_of_app_kernel
- line_length
- lowercase_as_in_use_statements
- max_blank_lines
- max_colons
- no_admin_yaml
- no_app_bundle
- no_app_console
- no_attribute_redundant_parenthesis
- no_bash_prompt
- no_blank_line_after_filepath_in_code_block
- no_blank_line_after_filepath_in_php_code_block
- no_blank_line_after_filepath_in_twig_code_block
- no_blank_line_after_filepath_in_xml_code_block
- no_blank_line_after_filepath_in_yaml_code_block
- no_brackets_in_method_directive
- no_broken_ref_directive
- no_composer_phar
- no_composer_req
- no_config_yaml
- no_contraction
- no_directive_after_shorthand
- no_duplicate_use_statements
- no_explicit_use_of_code_block_php
- no_footnotes
- no_inheritdoc_in_code_examples
- no_merge_conflict
- no_namespace_after_use_statements
- no_php_open_tag_in_code_block_php_directive
- no_php_prefix_before_bin_console
- no_php_prefix_before_composer
- no_space_before_self_xml_closing_tag
- non_static_phpunit_assertions
- only_backslashes_in_namespace_in_php_code_block
- only_backslashes_in_use_statements_in_php_code_block
- ordered_use_statements
- php_open_tag_in_code_block_php_directive
- php_prefix_before_bin_console
- remove_trailing_whitespace
- replace_code_block_types
- replacement
- short_array_syntax
- space_before_self_xml_closing_tag
- space_between_label_and_link_in_doc
- space_between_label_and_link_in_ref
- string_replacement
- title_underline_length_must_match_title_length
- typo
- unused_links
- use_deprecated_directive_instead_of_versionadded
- use_https_xsd_urls
- use_named_constructor_without_new_keyword_rule
- valid_inline_highlighted_namespaces
- valid_use_statements
- versionadded_directive_major_version
- versionadded_directive_min_version
- versionadded_directive_should_have_version
- yaml_instead_of_yml_suffix
- yarn_dev_option_at_the_end
- yarn_dev_option_not_at_the_end
Ensure only American English is used.
Pattern | Message |
---|---|
/(B|b)ehaviour(s)?/ |
Please use American English for: %s |
/(I|i)nitialise/i |
Please use American English for: %s |
/normalise/i |
Please use American English for: %s |
/organise/i |
Please use American English for: %s |
/recognise/i |
Please use American English for: %s |
/centre/i |
Please use American English for: %s |
/colour/i |
Please use American English for: %s |
/flavour/i |
Please use American English for: %s |
/licence/i |
Please use American English for: %s |
This is a nice behavior...
This is a nice behaviour...
Make sure argument variable name match for type
Name | Required | Allowed Types | Default |
---|---|---|---|
arguments |
false |
array |
[] |
Make sure that a word is not used twice in a row.
Please do not use it this way...
Please do not not use it this way...
Do not use belittling words!
Pattern | Message |
---|---|
/simply/i |
Please remove the word: %s |
/easy/i |
Please remove the word: %s |
/easily/i |
Please remove the word: %s |
/obvious/i |
Please remove the word: %s |
/trivial/i |
Please remove the word: %s |
/of course/i |
Please remove the word: %s |
/logically/i |
Please remove the word: %s |
/merely/i |
Please remove the word: %s |
/basic/i |
Please remove the word: %s |
Make sure you have a blank line after anchor (
.. anchor:
).
Make sure you have a blank line after a sentence which ends with a colon (
:
).
Make sure you have a blank line after each directive.
Make sure you have a blank line after a filepath in a code block. This rule respects PHP, YAML, XML and Twig.
Make sure you have a blank line after a filepath in a PHP code block.
Make sure you have a blank line after a filepath in a Twig code block.
Make sure you have a blank line after a filepath in a XML code block.
Make sure you have a blank line after a filepath in a YAML code block.
Make sure you have a blank line before each directive.
Make sure Composer
--dev
option forrequire
command is used at the end.
composer require symfony/var-dumper --dev
composer require --dev symfony/var-dumper
Make sure Composer
--dev
option forrequire
command is not used at the end.
composer require --dev symfony/var-dumper
composer require symfony/var-dumper --dev
Name | Required |
---|---|
major_version |
true |
Name | Required |
---|---|
min_version |
true |
Ensure a deprecated directive has a version which follows SemVer.
.. deprecated:: 3.4
.. deprecated::
.. deprecated:: foo-bar
Make sure Composer command in a terminal/bash code block is prefixed with a $.
$ composer require symfony/var-dumper
composer require symfony/var-dumper
Ensure phpfunction directive do not end with ().
:phpfunction:`mb_detect_encoding`.
:phpfunction:`mb_detect_encoding()`.
Ensure exactly one space before directive type.
.. code-block:: php
.. code-block:: php
Ensure exactly one space between link definition and link.
.. _DOCtor-RST: https://github.com/OskarStark/DOCtor-RST
.. _DOCtor-RST: https://github.com/OskarStark/DOCtor-RST
Ensure explicit nullable types in method arguments.
function foo(?string $bar = null)
function foo(string|null $bar = null)
function foo(string $bar = null)
Name | Required |
---|---|
prefix |
true |
Ensure link lines are at the bottom of the file.
Ensure link definition contains valid link.
.. _DOCtor-RST: https://github.com/OskarStark/DOCtor-RST
.. _DOCtor-RST: htt//github.com/OskarStark/DOCtor-RST
Ensure php reference syntax is valid.
The :class:`Symfony\Component\Notifier\Transport` class
The :class:`Symfony\Component\Notifier\Transport`` class
Ensure
AbstractAdmin
and the corresponding namespaceSonata\AdminBundle\Admin\AbstractAdmin
is used.
Ensure
AbstractController
and the corresponding namespaceSymfony\Bundle\FrameworkBundle\Controller\AbstractController
is used. Instead ofSymfony\Bundle\FrameworkBundle\Controller\Controller
.
Ensure
Controller
and the corresponding namespaceSymfony\Bundle\FrameworkBundle\Controller\Controller
is used. Instead ofSymfony\Bundle\FrameworkBundle\Controller\AbstractController
.
Make sure to only use
.xlf
instead of.xliff
.
messages.xlf
messages.xliff
Ensures a filename uses only dashes (
-
), but are allowed to start with underscore (_
). It is a common practice to prefix included files with underscores (_
).
custom-extensions.rst
_custom-extensions.rst
custom_extensions.rst
Ensures a filename uses only underscores (
_
).
custom_extensions.rst
_custom_extensions.rst
custom-extensions.rst
Make sure forbidden directives are not used
Name | Required | Allowed Types | Default |
---|---|---|---|
directives |
false |
array |
[] |
Name | Required | Allowed Types | Default |
---|---|---|---|
size |
false |
int |
4 |
Name | Required | Allowed Types | Default |
---|---|---|---|
max |
false |
int |
80 |
Name | Required | Allowed Types | Default |
---|---|---|---|
max |
false |
int |
2 |
Make sure you have max 2 colons (
::
).
composer require symfony/var-dumper --dev
composer require --dev symfony/var-dumper
Make sure there is no redundant parenthesis on attribute
#[Bar]
#[Bar('foo')]
#[Bar()]
Ensure no bash prompt
$
is used before commands inbash
,shell
orterminal
code blocks.
bin/console list
$ bin/console list
Ensure a :method: directive has special format.
:method:`Symfony\\Component\\OptionsResolver\\Options::offsetGet`
:method:`Symfony\\Component\\OptionsResolver\\Options::offsetGet()`
Ensure only valid :ref: directives.
See this :ref:`Foo`
See this ref:`Foo`
Ensure contractions are not used.
Pattern | Message |
---|---|
/(^|[^[:alnum:]])(?<contraction>i\'m)/i |
Please do not use contraction for: %s |
/(^|[^[:alnum:]])(?<contraction>(you|we|they)\'re)/i |
Please do not use contraction for: %s |
/(^|[^[:alnum:]])(?<contraction>(he|she|it)\'s)/i |
Please do not use contraction for: %s |
/(^|[^[:alnum:]])(?<contraction>(you|we|they)\'ve)/i |
Please do not use contraction for: %s |
/(^|[^[:alnum:]])(?<contraction>(i|you|he|she|it|we|they)\'ll)/i |
Please do not use contraction for: %s |
/(^|[^[:alnum:]])(?<contraction>(i|you|he|she|it|we|they)\'d)/i |
Please do not use contraction for: %s |
/(^|[^[:alnum:]])(?<contraction>(aren|can|couldn|didn|hasn|haven|isn|mustn|shan|shouldn|wasn|weren|won|wouldn)\'t)/i |
Please do not use contraction for: %s |
It is an example
It's an example
Ensure that no directive follows the shorthand
::
. This could lead to broken markup.
Ensure there is not same use statement twice
Make sure there is no footnotes
.. [5] A numerical footnote. Note
Ensure that the files does not contain merge conflicts.
Ensure
bin/console
is not prefixed withphp
.
bin/console list
php bin/console list
Use
$this->assert*
over static calls.
$this->assertTrue($foo);
self::assertTrue($foo);
A namespace declaration in a PHP code-block should only contain backslashes.
namespace Foo\Bar;
namespace Foo/Bar;
A use statement in a PHP code-block should only contain backslashes.
use Foo\Bar;
use Foo/Bar;
Ensure
bin/console
is prefixed withphp
to be safe executable on Microsoft Windows.
php bin/console list
bin/console list
Make sure there is not trailing whitespace.
Valid sentence
Invalid sentence
Propose alternatives for disallowed code block types.
Pattern | Message |
---|---|
jinja |
Please do not use type "jinja" for code-block, use "twig" instead |
html+jinja |
Please do not use type "html+jinja" for code-block, use "html+twig" instead |
js |
Please do not use type "js" for code-block, use "javascript" instead |
Pattern | Message |
---|---|
/^([\s]+)?\/\/.\.(\.)?$/ |
Please replace "%s" with "// ..." |
/^([\s]+)?#.\.(\.)?$/ |
Please replace "%s" with "# ..." |
/^([\s]+)?<!--(.\.(\.)?|[\s]+\.\.[\s]+)-->$/ |
Please replace "%s" with "" |
/^([\s]+)?{#(.\.(\.)?|[\s]+\.\.[\s]+)#}$/ |
Please replace "%s" with "{# ... #}" |
/apps/ |
Please replace "%s" with "applications" |
/Apps/ |
Please replace "%s" with "Applications" |
/typehint/ |
Please replace "%s" with "type-hint" |
/Typehint/ |
Please replace "%s" with "Type-hint" |
/encoding="utf-8"/ |
Please replace "%s" with "encoding="UTF-8"" |
/\$fileSystem/ |
Please replace "%s" with "$filesystem" |
/Content-type/ |
Please replace "%s" with "Content-Type" |
/\-\-env prod/ |
Please replace "%s" with "--env=prod" |
/\-\-env test/ |
Please replace "%s" with "--env=test" |
/End 2 End/i |
Please replace "%s" with "End-to-End" |
/E2E/ |
Please replace "%s" with "End-to-End" |
/informations/ |
Please replace "%s" with "information" |
/Informations/ |
Please replace "%s" with "Information" |
/performances/ |
Please replace "%s" with "performance" |
/Performances/ |
Please replace "%s" with "Performance" |
/``'%kernel.debug%'``/ |
Please replace "%s" with "%%kernel.debug%% " |
/PHPdoc/ |
Please replace "%s" with "PHPDoc" |
/eg\./ |
Please replace "%s" with "e.g." |
Ensure a space between label and link in :doc: directive.
:doc:`File </reference/constraints/File>`
:doc:`File</reference/constraints/File>`
Ensure a space between label and link in :ref: directive.
:ref:`receiving them via a worker <messenger-worker>`
:ref:`receiving them via a worker<messenger-worker>`
Pattern | Message |
---|---|
`type: ``int``` | Please replace "%s" with "type: integer " |
`type: ``bool``` | Please replace "%s" with "type: boolean " |
Report common typos.
Pattern | Message |
---|---|
/compsoer/i |
Typo in word "%s" |
/registerbundles\(\)/ |
Typo in word "%s", use "registerBundles()" |
/retun/ |
Typo in word "%s" |
/displayes/i |
Typo in word "%s" |
/mantains/i |
Typo in word "%s" |
/doctine/i |
Typo in word "%s" |
/adress/i |
Typo in word "%s" |
/argon21/ |
Typo in word "%s", use "argon2i" |
/descritpion/i |
Typo in word "%s" |
/recalcuate/i |
Typo in word "%s" |
/achived/i |
Typo in word "%s" |
/overriden/i |
Typo in word "%s" |
/succesfully/i |
Typo in word "%s" |
/optionnally/i |
Typo in word "%s" |
/esimated/i |
Typo in word "%s" |
/strengh/i |
Typo in word "%s" |
/mehtod/i |
Typo in word "%s" |
/contraint/i |
Typo in word "%s" |
/instanciation/i |
Typo in word "%s", use "instantiation" |
Report all links which are defined, but not used in the file anymore.
Ensures that named constructor is used without "new" keyword.
new Uuid()
new Uuid::fromString()
Ensures to have 2 backslashes when highlighting a namespace to have valid output.
``App\Entity\Foo``
`App\\Entity\\Foo`
``App\\Entity\\Foo``
`App\Entity\Foo`
Name | Required |
---|---|
major_version |
true |
Name | Required |
---|---|
min_version |
true |
Ensure a versionadded directive has a version which follows SemVer.
.. versionadded:: 3.4
.. versionadded::
.. versionadded:: foo-bar
Make sure to only use
yaml
instead ofyml
.
.travis.yml
..code-block:: yaml
Please add this to your services.yaml file.
..code-block:: yml
Please add this to your services.yml file.
Make sure yarn
--dev
option foradd
command is used at the end.
yarn add jquery --dev
yarn add --dev jquery
Make sure yarn
--dev
option foradd
command is used at the end.
yarn add --dev jquery
yarn add jquery --dev