SpacePossum
Repos
14
Followers
64
Following
4

A tool to automatically fix PHP Coding Standards issues

11839
1432

Events

issue comment
Fixed range parsing

thansk @dg :+1: :)

Created at 4 days ago
issue comment
Fixed range parsing

Hi!

These changes look valid to me, nice catch :+1: : )

Sadly the CI doesn't run anymore, which seems not related to your changes.

Created at 5 days ago
Created at 5 days ago
closed issue
String cannot be used as a class - triggered for enum

Hi all and thanks for this great tool!

Run into a little thing with enums and strings Minimal example:

<?php

namespace App\Bar;

enum Foo: string
{
    case A = 'B';
}

$enum = 'App\Bar\Foo';

/** @var \BackedEnum $x */
$x = $enum::tryFrom('B');

echo $x->value;

https://psalm.dev/r/7fdff8e8eb

will tell String cannot be used as a class on line 13, however it works fine in PHP :)

this also happens for cases like $someEnumString::cases()

Created at 3 weeks ago
issue comment
String cannot be used as a class - triggered for enum

thanks for the fast reply :+1: I'll refactor : )

Created at 3 weeks ago
opened issue
String cannot be used as a class - triggered for enum

Hi all and thanks for this great tool!

Run into a little thing with enums and strings Minimal example:

<?php

namespace App\Bar;

enum Foo: string
{
    case A = 'B';
}

$enum = 'App\Bar\Foo';

/** @var \BackedEnum $x */
$x = $enum::tryFrom('B');

echo $x->value;

https://psalm.dev/r/7fdff8e8eb

will tell String cannot be used as a class on line 13, however it works fine in PHP :)

this also happens for cases like $someEnumString::cases()

Created at 3 weeks ago
feature: ArraySingleMultiLine - Introduction

I've no plans picking this one up anytime soon sadly. So if anyone else wants to pick it up would be great, :+1: might be wise to discuss the expected behavior with maintainers first before putting time in it.

Created at 3 weeks ago
PHP8.2: test for DNF types

I haven't checked anything for a long time so I cannot say what the state is of https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/pull/6629 If you are up for it, please have a look @Wirone :) but also, feel free to start from scratch, what ever works best for you :+1:

Created at 3 weeks ago
feature: [PHP8.2] Support for readonly classes

nice one @Wirone :+1: :tada:

Created at 3 weeks ago
issue comment
Support simple colored diffs

I wouldn't increase the scope of the library with output formatters.

The lib creates strings in the well known/documented diff format, this should allow any to process the output and apply what ever operation on it (like adding console coloring and sending it to the console).

Created at 1 month ago
opened issue
Changing by refrence in array_walk is not picked up

Hi all!

Thanks for the great tool :)

I've run in a little thingy related to array_walk and references. Consider this code:

<?php declare(strict_types = 1);

/**
 * @return array<
 *     array{
 *         "guid": string
 *     }
 * >
 */
function foo(): array
{
    $a = [1 ,2 ,3];
    $b = $a;
    array_walk(
        $b,
        static fn(int &$x): array => $x = ['guid' => 'foo'],
    );

    return $b;
}

$z = foo();
var_dump($z);
die;

reports:

19 | Function foo() should return array<array{guid: string}> but returns array{1, 2, 3}.

https://phpstan.org/r/c5281446-f880-4f85-9e65-97c6a89f1d8f

I wasn't expecting this.

Did PHPStan help you today? Did it make you happy in any way?

Yes, PHPStan is one of our most reliable reviewers in a bunch of projects, very busy bee! : D

Created at 1 month ago
delete branch
SpacePossum delete branch 5_4_NoUnneededControlParenthesesFixer_v2
Created at 1 month ago
[PHP8.2] Support for `readonly` classes

it is all here https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/pull/6624 , if anyone is interested in finishing it

Created at 2 months ago