-
-
Notifications
You must be signed in to change notification settings - Fork 740
Closed
rectorphp/rector-src
#6018Labels
Description
Bug Report
| Subject | Details |
|---|---|
| Rector version | last dev-main |
Minimal PHP Code Causing Issue
See https://getrector.com/demo/c32efdb4-a075-4a39-9686-259bed08325d
<?php
declare(strict_types=1);
namespace Rector\Tests\Php80\Rector\Class_\StringableForToStringRector\Fixture;
class View
{
public function __construct(private string $template, private array $data)
{
}
public static function make(string $template, array $data)
{
return new self($template, $data);
}
public function render(): string
{
return $this->template;
}
}
class SkipOnAnonymousFunctions implements \Stringable
{
public function __construct(private array $items)
{
}
public function __toString(): string
{
return View::make('index', [
'only_uppercase' => array_filter(
$this->items,
static function (string $item) {
return mb_strtoupper($item) === $item;
}
),
])->render();
}
}
Expected Behaviour
Rector should not add string casting to array_filter
Reactions are currently unavailable