Vincent Langlet

Results 1004 comments of Vincent Langlet

As a first step, could we have something benevolent like ``` /** @var array $array */ $array $key = array_keys($array)[0]; $this->methodNeedString($key); // No error $this->methodNeedInt($key); // Error $this->methodNeedString((string) $key); //...

> What is blocking infering the type as `int|string` when unknown/non-constant string key is used to assign array element? The issue would be reporting false-positive everywhere. `$array[$string] = ...` is...

> To chime in: it is one thing to assume an explicitly declared `array` to mean `array`, but where this really bites is when the array key type is inferred....

> > Hy @StingyJack, Just my two cents as a fellow user: I think this is expected and desired behavior. > > No, it isn't. Yes it is. This is...

> I do not think that the proposed change would improve reporter experience in all cases. Still it's understandable people want a different behavior, but then it should be an...

> Would you be open to that ? Yes, but I would say it requires some thought about what should be the right aliases. > If yes do you think...

> So that'd give here: > > * define the check alias in the existing command (as it's 100% an alias) > * create a fix command that extends the...

I think I'll follow your strategy, it seems to be the simplest @smnandre https://github.com/VincentLanglet/Twig-CS-Fixer/pull/240

> Most tools similar to this one (e.g. phpstan, php-cs-fixer) make a phar version available for download. It would be nice to see the same here. Hi, thanks for the...

Hi @llaville, would you be ok to provide a PR then ? Big thanks