Skip to content

Releases: blumilksoftware/codestyle

v1.0.0

31 Mar 08:45
5e5e578
Compare
Choose a tag to compare

With 1.x we removed symplify/easy-coding-standard dependency and Blumilk codestyle depends solely on PHP-CS-Fixer.

Updating guide is available here: https://github.com/blumilksoftware/codestyle#upgrading-guide-from-0x

v0.10.0 - promoted constructors styling

23 Feb 07:32
39da9ec
Compare
Choose a tag to compare

We are intentionally breaking PSR rule, but we believe it will be fixed in some PSR update:

Before:

class Foo {
    public function __construct(
        $param1,
        $param2
    ) {
    }
}

After:

class Foo {
    public function __construct(
        $param1,
        $param2,
    ) {}
}

Also, these were added as default:

PhpCsFixerCustomFixers\Fixer\ConstructorEmptyBracesFixer;
PhpCsFixerCustomFixers\Fixer\MultilinePromotedPropertiesFixer;
PhpCsFixerCustomFixers\Fixer\NoUselessCommentFixer;
PhpCsFixerCustomFixers\Fixer\PhpdocArrayStyleFixer;
PhpCsFixerCustomFixers\Fixer\PromotedConstructorPropertyFixer;
PhpCsFixerCustomFixers\Fixer\SingleSpaceAfterStatementFixer;
PhpCsFixerCustomFixers\Fixer\SingleSpaceBeforeStatementFixer;
PhpCsFixerCustomFixers\Fixer\StringableInterfaceFixer;

v0.9.0 - PHP 8.1 features

04 Jan 07:23
c1e06d9
Compare
Choose a tag to compare

Codestyle will understand PHP 8.1 features in right way.

Before:

<?php

class ReadonlyThing
{
    protected readonly bool $true;

    public function __construct(protected readonly string $string)
    {
    }

    protected function test(array & $param): void
    {
    }
}

After:

<?php

declare(strict_types=1);

class ReadonlyThing
{
    protected readonly bool $true;

    public function __construct(
        protected readonly string $string,
    ) {
    }

    protected function test(array &$param): void
    {
    }
}

v0.8.0 - enums handled

16 Dec 11:14
9d8bda5
Compare
Choose a tag to compare

Codestyle will understand PHP 8.1 enums in right way.

Before:

enum HTTPMethods: string {
    case GET = "get":
    case POST = "post":
}

After:

enum HTTPMethods: string {
    case GET = "get";
    case POST = "post";
}

v0.7.0 - enforce nullable type declaration for default null values

29 Nov 09:22
0b24f70
Compare
Choose a tag to compare

Before:

<?php

class NullableTypeForDefaultNull
{
    public function getNameLabel(string $name, string $title = null): string
    {
        $label = $name;
        if ($title !== null) {
            $label .= " " . $title;
        }

        return $label;
    }
}

After:

<?php

declare(strict_types=1);

class NullableTypeForDefaultNull
{
    public function getNameLabel(string $name, ?string $title = null): string
    {
        $label = $name;
        if ($title !== null) {
            $label .= " " . $title;
        }

        return $label;
    }
}

v0.6.0 - removing extra blank line

08 Oct 08:35
e96f41e
Compare
Choose a tag to compare

Fixes #25

Before
<?php

declare(strict_types=1);

$a = [
    1,
    2,

];

function b(): int
{
    $a = 1;

    return $a;

}

function c(int $a, int $b, int $c): int
{

    return $a + $b + $c;






}

$d = c(

    1,
    2,
    3,

);
After
<?php

declare(strict_types=1);

$a = [
    1,
    2,
];

function b(): int
{
    $a = 1;

    return $a;
}

function c(int $a, int $b, int $c): int
{
    return $a + $b + $c;
}

$d = c(
    1,
    2,
    3,
);

v0.5.0 - trailing commas and spaces around operators

06 Sep 17:14
02df56d
Compare
Choose a tag to compare

Issues #26 and #30 were implemented with pull requests #32 and #31 respectively. With these changes ECS will require:

  • adding trailing commas in all multiline arrays and methods,
  • adding spaces around almost all operators.

So:

        return $this->testParameters(
            "a"===$this->getValue()
        );

shoud be changed into:

        return $this->testParameters(
            "a" === $this->getValue(),
        );

v0.4.3 - e2e tests provided

27 Jul 06:28
e4868bc
Compare
Choose a tag to compare

The codestyle has been pre-tested as described in #24 and implemented in #29.

v0.4.2 - locked ECS version

14 Jul 06:28
494cbdb
Compare
Choose a tag to compare

ECS locked to "9.3.12" accordingly to #27.

v0.4.1 - fixing deprecated ECS features

18 May 08:21
fa02efc
Compare
Choose a tag to compare

Problems from #14, #21 and #22 were fixed here.