Releases: blumilksoftware/codestyle
Releases · blumilksoftware/codestyle
v1.0.0
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
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
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
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
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
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
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
v0.4.2 - locked ECS version
ECS locked to "9.3.12"
accordingly to #27.