phpstan-beberlei-assert
phpstan-beberlei-assert copied to clipboard
PHPStan extension for beberlei/assert
This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [phpunit/phpunit](https://phpunit.de/) ([source](https://redirect.github.com/sebastianbergmann/phpunit)) | `^9.6` -> `^12.0` | [](https://docs.renovatebot.com/merge-confidence/) |...
This issue lists Renovate updates and detected dependencies. Read the [Dependency Dashboard](https://docs.renovatebot.com/key-concepts/dashboard/) docs to learn more.[View this repository on the Mend.io Web Portal](https://developer.mend.io/github/phpstan/phpstan-beberlei-assert). ## Config Migration Needed - [ ]...
Should specify type to a union of the array values. ```php $format = $_GET['foo']; Assertion::inArray($format, [ // or Assertion::choice ExportFormat::FORMAT_CSV, ExportFormat::FORMAT_EXCEL, ]); \PhpStan\dumpType($format); // ExportFormat::FORMAT_CSV|ExportFormat::FORMAT_EXCEL ```
the following code: ```php
Given this case https://phpstan.org/r/ea5dfda5-33b6-49e7-8e5f-1db4214533e4 I'd expect that method `withAssert`will work just like `withIf`. PhpStan will however throw following error ``` Offset 'host' does not exist on false|array('scheme' => string, ?'host'...
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [Eomm/why-don-t-you-tweet](https://redirect.github.com/Eomm/why-don-t-you-tweet) | action | major | `v1` -> `v2` | --- ### Release...
Fixes this: ```php function assertJson(string $value): void { Assert::that($value)->isJsonString(); // Call to method Assert\AssertionChain::isJsonString() will always evaluate to true. } ``` Also narrows type to `non-empty-string`, because the assertion fails...