New in Symplify 5: 3 News in EasyCodingStandard to Smoother Your Experience

This post was updated at August 2020 with fresh know-how.
What is new?

Updated ECS YAML to PHP configuration since ECS 8.


Let's get lazier and lazier.

You don't have this package installed yet?

composer require symplify/easy-coding-standard --dev

Now enjoy the news ↓

1. Friendlier Skips

See pull-request #948

Little details make more pleasant developer experience UX. You already know you can use fnmatch() for skipping files. The problem is, it requires very specific format people struggle with and often end up using explicit 10 paths to many files.

Before you had to hit the format:

use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symplify\EasyCodingStandard\ValueObject\Option;

return function (ContainerConfigurator $containerConfigurator): void {
    $parameters = $containerConfigurator->parameters();

    $parameters->set(Option::SKIP, [
        SomeFixer::class => [
            // this worked
            '*src/*CaseConverter.php',

            // this didn't work
            'src/*CaseConverter.php',
        ]]
    );
};

Now you can use your intuition, copy paste the filename from error result and both versions work.

2. In Lazy We Trust

See pull-request #832

Before you had to type the whole config name and use YAML:

easy-coding-standard.yaml
easy-coding-standard.yml

As you've already noticed, now you can use short version with normal PHP - ecs.php:

3. Are There Some "array" Checkers?

See pull-request #967

Many people asked for an overview of all checkers there are, if there any related to an array, to strict_types position and so on.

Before you had to go to huge README.md files of PHP CS Fixer and PHP_CodeSniffer on Github to read it all. But why leave the luxury of CLI if these checkers are already downloaded on your machine?

Now you can use "find" command:

Next time you'll wonder what are "Symplify" rules, keep your browser closed and just find them:

vendor/bin/ecs find symplify

Enjoy laziness, intuitive use and faster access to the information you look for.

We'll continue to make it this way!




Do you learn from my contents or use open-source packages like Rector every day?
Consider supporting it on GitHub Sponsors. I'd really appreciate it!