PHP code example of efureev / php-cs-fixer-1

1. Go to this page and download the library: Download efureev/php-cs-fixer-1 library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

efureev / php-cs-fixer-1 example snippets

`` tags or short-echo ``<?=`` tags and not
  other tag variations.

* **fully_qualified_strict_types**

  Transforms imported FQCN parameters and return types in function
  arguments to short version.

* **function_declaration** [@PSR2, @Symfony]

  Spaces should be properly placed in a function declaration.

  Configuration options:

  - ``closure_function_spacing`` (``'none'``, ``'one'``): spacing to use before open
    parenthesis for closures; defaults to ``'one'``

* **function_to_constant** [@Symfony:risky]

  Replace core functions calls returning constants with the constants.

  *Risky rule: risky when any of the configured functions to replace are overridden.*

  Configuration options:

  - ``functions`` (a subset of ``['get_called_class', 'get_class',
    'php_sapi_name', 'phpversion', 'pi']``): list of function names to fix;
    defaults to ``['get_class', 'php_sapi_name', 'phpversion', 'pi']``

* **function_typehint_space** [@Symfony]

  Add missing space between function's argument and its typehint.

* **general_phpdoc_annotation_remove**

  Configured annotations should be omitted from PHPDoc.

  Configuration options:

  - ``annotations`` (``array``): list of annotations to remove, e.g. ``["author"]``;
    defaults to ``[]``

* **hash_to_slash_comment**

  Single line comments should use double slashes ``//`` and not hash ``#``.
  DEPRECATED: use ``single_line_comment_style`` instead.

* **header_comment**

  Add, replace or remove header comment.

  Configuration options:

  - ``comment_type`` (``'comment'``, ``'PHPDoc'``): comment syntax type; defaults to
    ``'comment'``; DEPRECATED alias: ``commentType``
  - ``header`` (``string``): proper header content; the
  configured syntax. Requires PHP >= 7.1.

  Configuration options:

  - ``syntax`` (``'long'``, ``'short'``): whether to use the ``long`` or ``short`` ``list``
    syntax; defaults to ``'long'``

* **logical_operators**

  Use ``&&`` and ``||`` logical operators instead of ``and`` and ``or``.

  *Risky rule: risky, because you must double-check if using and/or with lower precedence was intentional.*

* **lowercase_cast** [@Symfony]

  Cast should be written in lower case.

* **lowercase_constants** [@PSR2, @Symfony]

  The PHP constants ``true``, ``false``, and ``null`` MUST be in lower case.

* **lowercase_keywords** [@PSR2, @Symfony]

  PHP keywords MUST be in lower case.

* **lowercase_static_reference** [@Symfony]

  Class static references ``self``, ``static`` and ``parent`` MUST be in lower
  case.

* **magic_constant_casing** [@Symfony]

  Magic constants should be referred to using the correct casing.

* **magic_method_casing** [@Symfony]

  Magic method definitions and calls must be using the correct casing.

* **mb_str_functions**

  Replace non multibyte-safe functions with corresponding mb function.

  *Risky rule: risky when any of the functions are overridden.*

* **method_argument_space** [@PSR2, @Symfony]

  In method arguments and method call, there MUST NOT be a space before
  each comma and there MUST be one space after each comma. Argument lists
  MAY be split across multiple lines, where each subsequent line is
  indented once. When doing so, the first item in the list MUST be on the
  next line, and there MUST be only one argument per line.

  Configuration options:

  - ``ensure_fully_multiline`` (``bool``): ensure every argument of a multiline
    argument list is on its own line; defaults to ``false``. DEPRECATED: use
    option ``on_multiline`` instead
  - ``keep_multiple_spaces_after_comma`` (``bool``): whether keep multiple spaces
    after comma; defaults to ``false``
  - ``on_multiline`` (``'ensure_fully_multiline'``, ``'ensure_single_line'``, ``'ignore'``):
    defines how to handle function arguments lists that contain newlines;
    defaults to ``'ignore'``

* **method_chaining_indentation**

  Method chaining MUST be properly indented. Method chaining with
  different levels of indentation is not supported.

* **method_separation**

  Methods must be separated with one blank line. DEPRECATED: use
  ``class_attributes_separation`` instead.

* **modernize_types_casting** [@Symfony:risky]

  Replaces ``intval``, ``floatval``, ``doubleval``, ``strval`` and ``boolval``
  function calls with according type casting operator.

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

* **multiline_comment_opening_closing**

  DocBlocks must start with two asterisks, multiline comments must start
  with a single asterisk, after the opening slash. Both must end with a
  single asterisk before the closing slash.

* **multiline_whitespace_before_semicolons**

  Forbid multi-line whitespace before the closing semicolon or move the
  semicolon to the new line for chained calls.

  Configuration options:

  - ``strategy`` (``'new_line_for_chained_calls'``, ``'no_multi_line'``): forbid
    multi-line whitespace or move the semicolon to the new line for chained
    calls; defaults to ``'no_multi_line'``

* **native_constant_invocation** [@Symfony:risky]

  Add leading ``\`` before constant invocation of internal constant to speed
  up resolving. Constant name match is case-sensitive, except for ``null``,
  ``false`` and ``true``.

  *Risky rule: risky when any of the constants are namespaced or overridden.*

  Configuration options:

  - ``exclude`` (``array``): list of constants to ignore; defaults to ``['null',
    'false', 'true']``
  - ``fix_built_in`` (``bool``): whether to fix constants returned by
    ``get_defined_constants``. User constants are not accounted in this list
    and must be specified in the