Anatoly Pashin
Anatoly Pashin
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 ```
Code in the controller: ```php /** * @var Transfer|null $transfer */ $transfer = Transfer::find()->one(); if (!$transfer) { return; } $paymentsTransfers = $transfer->getPaymentTransfer()->all(); ``` Model: ```php class Transfer extends \yii\db\ActiveRecord {...
This file can be included in phpstan config using `stubFiles` directive. ```php namespace yii\db { class ActiveRecord { /** * @phpstan-return ActiveQuery */ public static function find(); } /** *...
Php 8
Would be great to be able to allow to set merge request squash option to true/false.
To provide a way to use different mechanism e.g. sodium (https://github.com/paragonie/sodium_compat) or some no-op logic for usage in tests.
### Feature request https://phpstan.org/r/8b50b60a-9c0c-4627-a6c6-103bbe6802a9 ```php /** @param list $input */ public function sayHello(array $input): void { // improvement request: phpstan should suggest adding `unset($item)` after the foreach statement // only...