問題タブ [phpstan]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
php - phpStan エラーの問題: __toString() は文字列を返す必要がありますが、string|false を返します
私の機能は__toString
次のとおりです。
これは PhpStan から受け取るエラーで、コミットをブロックしています。
メソッド App\DTO\GenericMessageDTO::__toString() は文字列を返す必要がありますが、string|false を返します。
例外を試してみましたが、私のphp 7.2と互換性がありません.Throwing an exception from ''__toString'' is only possible since PHP 7.4
どうすればこれを修正できますか?