Skip to main content
3 votes
1 answer
94 views

I migrated project from PHP 7.4 to 8.3. I have left with 1 error in rector that I am not able to solve. $namesArray = explode($separator, $names); $namesArray = explode($separator, (string) $...
tttpapi's user avatar
  • 939
1 vote
1 answer
180 views

Here's the code: <?php declare(strict_types=1); /** * @param array{key?: string} $options */ function hello($options) { var_dump($options); } hello([ 'WRONG_KEY' => '...', ]); I ...
Limon Monte's user avatar
  • 54.8k
0 votes
2 answers
90 views

I've got various instances of code, building options for a dropdown dynamically with a preceding empty field: return State::all() ->map(fn (State $state) => (object) [ ...
Rikaelus's user avatar
  • 627
0 votes
1 answer
298 views

I do not understand why phpstan (at level 9+) flags the concrete factory's makeCollection method (the last class) as returning Collection. <?php declare (strict_types=1); /** * @template ...
Doug Wilbourne's user avatar
0 votes
1 answer
301 views

I'm registering a custom Carbon macro in my Laravel's AppServiceProvider Carbon::macro('itFormat', static function () { return ucwords(self::this()->translatedFormat('l d/m/Y')); }); But ...
madbob's user avatar
  • 660
0 votes
1 answer
101 views

I wrote a custom PHPStan rule, and a test for it. The test analyses a sample PHP class: class CustomRuleTestData { public function hasViolations() { // } public function ...
Zakaria's user avatar
  • 4,776
1 vote
0 answers
103 views

PHPStan is not recognizing my type specification in my docblock preceeding a method. Here's the code: /** * Process (resize and save) all versions of an uploaded file * * @param UploadedFileInterface ...
Quasipickle's user avatar
  • 4,530
1 vote
0 answers
134 views

The following class <?php namespace App; use Illuminate\Support\Str; use stdClass; class Payload { private(set) readonly array $validation; private array $ids = []; public ...
Sebastian Sulinski's user avatar

15 30 50 per page
1
2 3 4 5
15