DEVSENSE / phptools-docs

PHP Tools public content
Apache License 2.0
77 stars 10 forks source link

Type hint issue #615

Open lhmuk opened 1 month ago

lhmuk commented 1 month ago

VSCode 1.92.0 PHP Extension: v1.49.15818 (pre-release) Laravel 10.48.8

image

jakubmisek commented 1 month ago

Thank you for the test case; I've rewritten it, added Laravel 10, and tested it. So far there's no error in my case, but I have a clue what may be the culprit sometimes.

image

The code:

<?php

$string = '100, abc';

preg_match('/\d+/', $string, $matches);

collect($matches)

    ->reject(fn($value) => is_numeric($value))

    ->transform(function ($value) {
        return preg_replace('/b/', '', $value);
    });

I'll be looking into it.