2017 © Pedro PelΓ‘ez
 

library php-cs-fixer

A tool to automatically fix PHP code style

image

avto-dev/php-cs-fixer

A tool to automatically fix PHP code style

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 12 Versions
  • 50 % Grown

The README.md

logo , (*1)

АвтоматичСский Code Style Fixer для PHP

![Version][badge_packagist_version] Version Build Status ![Downloads count][badge_downloads_count] License, (*2)

Π”Π°Π½Π½Ρ‹ΠΉ ΠΏΠ°ΠΊΠ΅Ρ‚ для composer позволяСт Π·Π°ΠΏΡƒΡΠΊΠ°Ρ‚ΡŒ автоматичСский Code Style Fixer для PHP с фиксированным Π½Π°Π±ΠΎΡ€ΠΎΠΌ ΠΏΡ€Π°Π²ΠΈΠ», принятых Π² качСствС основных для оформлСния исходного php ΠΊΠΎΠ΄Π°., (*3)

Install

Require this package with composer using the following command:, (*4)

$ composer require avto-dev/php-cs-fixer "^1.6"

Installed composer is required (how to install composer)., (*5)

ИспользованиС

Π’ Π΄ΠΈΡ€Π΅ΠΊΡ‚ΠΎΡ€ΠΈΠΈ с вашим ΠΏΡ€ΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅ΠΌ Π²Ρ‹ΠΏΠΎΠ»Π½ΠΈΡ‚Π΅ Π² Ρ‚Π΅Ρ€ΠΌΠΈΠ½Π°Π»Π΅:, (*6)

$ php ./vendor/bin/cs-fix

ΠžΠΏΡ†ΠΈΠΎΠ½Π°Π»ΡŒΠ½ΠΎ ΠΌΠΎΠΆΠ΅Ρ‚Π΅ ΠΏΠ΅Ρ€Π΅Π΄Π°Ρ‚ΡŒ свои ΠΏΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€Ρ‹ запуска. ΠŸΡ€ΠΈ ΠΏΠ΅Ρ€Π΅Π΄Π°Ρ‡Π΅ ΠΏΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€Π° --config - всС ΠΏΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€Ρ‹, Ρ‡Ρ‚ΠΎ Ρ„ΠΎΡ€ΠΌΠΈΡ€ΡƒΠ΅Ρ‚ Π΄Π°Π½Π½Ρ‹ΠΉ ΠΏΠ°ΠΊΠ΅Ρ‚ - Π±ΡƒΠ΄ΡƒΡ‚ ΠΏΡ€ΠΎΠΈΠ³Π½ΠΎΡ€ΠΈΡ€ΠΎΠ²Π°Π½Ρ‹, ΠΈ Π±ΡƒΠ΄Π΅Ρ‚ ΠΏΡ€ΠΎΠΈΠ·Π²Π΅Π΄Π΅Π½ запуск ΠΈΠΌΠ΅Π½Π½ΠΎ с Ρ‚Π΅ΠΌΠΈ ΠΏΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€Π°ΠΌΠΈ, Ρ‡Ρ‚ΠΎ Π±ΡƒΠ΄ΡƒΡ‚ ΠΏΠ΅Ρ€Π΅Π΄Π°Π½Ρ‹ Π²Π°ΠΌΠΈ., (*7)

Если Π²Π°ΠΌ трСбуСтся ΠΎΠΏΡ†ΠΈΠΎΠ½Π°Π»ΡŒΠ½ΠΎ ΠΏΠ΅Ρ€Π΅ΠΎΠΏΡ€Π΅Π΄Π΅Π»ΠΈΡ‚ΡŒ ΠΏΠ΅Ρ€Π΅ΠΎΠΏΡ€Π΅Π΄Π΅Π»ΠΈΡ‚ΡŒ ΠΏΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€Ρ‹ ΠΏΡ€Π°Π²ΠΈΠ» fixer-Π°, Ρ‚ΠΎ создайтС Π² ΠΊΠΎΡ€Π½Π΅ вашСго прилоТСния Ρ„Π°ΠΉΠ» .cs_rules.php, Π²ΠΎΠ·Π²Ρ€Π°Ρ‰Π°ΡŽΡ‰ΠΈΠΉ ассоциированный массив ΠΏΡ€Π°Π²ΠΈΠ» (Π±ΠΎΠ»Π΅Π΅ ΠΏΠΎΠ΄Ρ€ΠΎΠ±Π½ΠΎ ΠΎ самих ΠΏΡ€Π°Π²ΠΈΠ»Π°Ρ… моТСшь ΠΎΠ·Π½Π°ΠΊΠΎΠΌΠΈΡ‚ΡŒΡΡ ΠΏΠΎ этой ссылкС). ΠŸΡ€ΠΈ Π΅Π³ΠΎ Π½Π°Π»ΠΈΡ‡ΠΈΠΈ Π΅Π³ΠΎ ΠΊΠΎΠ½Ρ‚Π΅Π½Ρ‚ Π±ΡƒΠ΄Π΅Ρ‚ ΠΌΠ΅Ρ€Π΄ΠΆΠΈΡ‚ΡŒΡΡ с ΠΊΠΎΠ½Ρ„ΠΈΠ³ΠΎΠΌ ΠΏΠ°ΠΊΠ΅Ρ‚Π°, ΠΎΠΏΡ†ΠΈΠΎΠ½Π°Π»ΡŒΠ½ΠΎ пСрСкрывая Π½Π΅ΠΎΠ±Ρ…ΠΎΠ΄ΠΈΠΌΡ‹Π΅ ΠΏΡ€Π°Π²ΠΈΠ»Π°. Π˜ΠΌΠ΅Ρ‚ΡŒ ΠΎΠ½ Π΄ΠΎΠ»ΠΆΠ΅Π½ ΡΠ»Π΅Π΄ΡƒΡŽΡ‰ΠΈΠΉ Π²ΠΈΠ΄:, (*8)

<?php

/**
 * CS Fixer Rules.
 *
 * @see https://github.com/FriendsOfPHP/PHP-CS-Fixer
 * @see https://mlocati.github.io/php-cs-fixer-configurator/
 */
return [
    '@PSR2'                  => true,
    '@PHP71Migration'        => true,
    'binary_operator_spaces' => [
        'operators' => [
            '='  => 'align_single_space',
            '=>' => 'align_single_space',
        ],
    ],
    'blank_line_after_namespace'         => true,
    'blank_line_after_opening_tag'       => true,
];

Π’Π°ΠΊ ΠΆΠ΅ Π² ΠΊΠΎΡ€Π½Π΅ ΠΌΠΎΠΆΠ΅Ρ‚Π΅ Ρ€Π°Π·ΠΌΠ΅ΡΡ‚ΠΈΡ‚ΡŒ Ρ„Π°ΠΉΠ» .cs_excludes.php, содСрТащий ΠΏΡƒΡ‚ΠΈ Π΄ΠΈΡ€Π΅ΠΊΡ‚ΠΎΡ€ΠΈΠΉ, ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Π΅ слСдуСт ΠΈΡΠΊΠ»ΡŽΡ‡ΠΈΡ‚ΡŒ ΠΏΡ€ΠΈ ΠΎΠ±Ρ€Π°Π±ΠΎΡ‚ΠΊΠ΅, Π²ΠΈΠ΄Π°:, (*9)

<?php

/**
 * Excludes directories names.
 *
 * NOTE: excludes will works only for directories.
 */
return [
    'bootstrap',
    'storage',
    'vendor',
    'public',
    'resources',
];

Для пСрСопрСдСлСния ΠΏΡƒΡ‚ΠΈ Ρ„Π°ΠΉΠ»Π° кэша - установитС Π² ΠΏΠ΅Ρ€Π΅ΠΌΠ΅Π½Π½ΠΎΠΉ окруТСния ΠΏΠ΅Ρ€Π΅ΠΌΠ΅Π½Π½ΡƒΡŽ с ΠΈΠΌΠ΅Π½Π΅ΠΌ PHP_CS_FIX_CACHE_FILE_PATH, Π·Π½Π°Ρ‡Π΅Π½ΠΈΠ΅ ΠΊΠΎΡ‚ΠΎΡ€ΠΎΠΉ - Π½Π΅ΠΎΠ±Ρ…ΠΎΠ΄ΠΈΠΌΡ‹ΠΉ ΠΏΡƒΡ‚ΡŒ. НапримСр:, (*10)

$ PHP_CS_FIX_CACHE_FILE_PATH=./.new.cache ./cs-fix

Π‘ΠΎΠ»Π΅Π΅ ΠΏΠΎΠ΄Ρ€ΠΎΠ±Π½ΠΎ ΠΎ Ρ€Π°Π±ΠΎΡ‚Π΅ ΠΏΠ°ΠΊΠ΅Ρ‚Π° - Look into the sources, Luke., (*11)

Changes log

![Release date][badge_release_date] Commits since latest release, (*12)

Changes log can be found here., (*13)

Support

![Issues][badge_issues] Issues, (*14)

If you will find any package errors, please, make an issue in current repository., (*15)

License

This is open-sourced software licensed under the MIT License., (*16)

The Versions

16/05 2018

dev-master

9999999-dev

A tool to automatically fix PHP code style

  Sources   Download

MIT

The Requires

 

The Development Requires

cs fixer codestyle avto-dev

16/05 2018

v1.0.11

1.0.11.0

A tool to automatically fix PHP code style

  Sources   Download

MIT

The Requires

 

The Development Requires

cs fixer codestyle avto-dev

20/03 2018

v1.0.10

1.0.10.0

A tool to automatically fix PHP code style

  Sources   Download

MIT

The Requires

 

The Development Requires

cs fixer codestyle avto-dev

18/02 2018

v1.0.9

1.0.9.0

A tool to automatically fix PHP code style

  Sources   Download

MIT

The Requires

 

The Development Requires

cs fixer codestyle avto-dev

17/02 2018

v1.0.8

1.0.8.0

A tool to automatically fix PHP code style

  Sources   Download

MIT

The Requires

 

The Development Requires

cs fixer codestyle avto-dev

07/12 2017

v1.0.6

1.0.6.0

A tool to automatically fix PHP code style

  Sources   Download

MIT

The Requires

 

The Development Requires

cs fixer codestyle avto-dev

09/11 2017

v1.0.5

1.0.5.0

A tool to automatically fix PHP code style

  Sources   Download

MIT

The Requires

 

The Development Requires

cs fixer codestyle avto-dev

08/11 2017

v1.0.4

1.0.4.0

A tool to automatically fix PHP code style

  Sources   Download

MIT

The Requires

 

The Development Requires

cs fixer codestyle avto-dev

08/11 2017

v1.0.3

1.0.3.0

A tool to automatically fix PHP code style

  Sources   Download

MIT

The Requires

 

The Development Requires

cs fixer codestyle avto-dev

07/11 2017

v1.0.2

1.0.2.0

A tool to automatically fix PHP code style

  Sources   Download

MIT

The Requires

 

The Development Requires

cs fixer codestyle avto-dev

07/11 2017

v1.0.1

1.0.1.0

A tool to automatically fix PHP code style

  Sources   Download

MIT

The Requires

 

The Development Requires

cs fixer codestyle avto-dev

07/11 2017

v1.0.0

1.0.0.0

A tool to automatically fix PHP code style

  Sources   Download

MIT

The Requires

 

The Development Requires

cs fixer codestyle avto-dev