Markus Staab

Results 1071 comments of Markus Staab
trafficstars

> Thanks! Although cache invalidation doesn't seem to work across functions in phpstan? PHPStan does not track state across functions/methods. you could mark your function as impure: https://phpstan.org/r/e9678592-8bf8-498f-9968-2e50ba011195

the stat-cache is super confusing. it seem to only cache a single entry so when mixing file path we can also get sometimes cached and sometimes non-cached results. https://tideways.com/profiler/blog/the-php-stat-cache-explained

> But when we insert `clearstatcache()` call, the error message does not disappear, but changes to ([phpstan.org/r/aba1966b-be12-4f83-a004-00977b128f19](https://phpstan.org/r/aba1966b-be12-4f83-a004-00977b128f19)): I can't reproduce this error locally. I don't run into errors for this...

I did not see any code yet, but looking at the description it feels like it would be great place to have some constants to ease reading the API calls...

I think we should be able to remove the AST walking complexity added in https://github.com/phpstan/phpstan-src/commit/579402b64bce9b20619ba33ed1e4df1f61c074a6 and instead should try to rewrite the regex pattern like `'/Price: (£|(\d)|(x))/i'` -> `'/Price: (£)/i'|'/Price:...

@ondrejmirtes could you give me a hint, why the snippet https://phpstan.org/r/c9ee9e22-f7ef-452a-9cc7-bb6f57c6707e does not yield into a tagged union? I think the separate contant-array type are lost in the TypeCombinator in...

something similar is implemented here: https://github.com/symplify/phpstan-rules/blob/main/src/Rules/NoMissingDirPathRule.php

another example combining int-cast and smaller-then (copied from https://github.com/phpstan/phpstan/issues/11262) https://phpstan.org/r/0d011355-4446-4bd8-9b8d-0c44907f9a07

I had a look into it. As far as I understand it, when processing a immediately-invoked-callable we only take into account ImpurePoints, ThrowPoints and InvalidateExpressions. So from my understanding it...