I am running into disappearing errors lately, that seem to be caused by errors that were ignored (via a baseline file) and have since been fixed. This is best illustrated by an example.
Suppose I started with this class:
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model as LaravelModel;
class Model extends LaravelModel
{
use HasFactory;
public function array(): array
{
return [];
}
public function string(): string
{
return 1;
}
}
Which gives two errors:
Method App\Models\Model::array() return type has no value type specified in iterable type array.
Method App\Models\Model::string() should return string but returns int.
I then add the first error to my baseline file, which leaves me with one error:
If I then fix the first error, without removing it from the baseline, the second error disappears from vscode:
PHPStan Client output:
[check:1] Check completed for file:///app/app/Models/Model.php errors= {"file:///app/app/Models/Model.php":["Ignored error pattern #^Method App\\\\Models\\\\Model\\:\\:array\\(\\) return type has no value type specified in iterable type array\\.$# in path /app/app/Models/Model.php was not matched in reported errors.","Method App\\Models\\Model::string() should return string but returns int."]}
I am running into disappearing errors lately, that seem to be caused by errors that were ignored (via a baseline file) and have since been fixed. This is best illustrated by an example.
Suppose I started with this class:
Which gives two errors: Method App\Models\Model::array() return type has no value type specified in iterable type array. Method App\Models\Model::string() should return string but returns int.![image](https://github.com/SanderRonde/phpstan-vscode/assets/33746490/eeb33c25-0ba0-476c-824c-2a5d89801da0)
I then add the first error to my baseline file, which leaves me with one error:![image](https://github.com/SanderRonde/phpstan-vscode/assets/33746490/dcb41dd9-e169-4a55-93c0-a6e9acd9ed5f)
If I then fix the first error, without removing it from the baseline, the second error disappears from vscode:![image](https://github.com/SanderRonde/phpstan-vscode/assets/33746490/484bd8fe-b165-4126-9868-53fea207dd49)
PHPStan Client output: