phpantom_lsp 0.7.0

Fast PHP language server with deep type intelligence. Generics, Laravel, PHPStan annotations. Ready in an instant.
Documentation
// test: instanceof on LHS of && narrows type for method call on RHS inside class method
// feature: completion
// expect: fullUrlIs(
// expect: is(
---
<?php

class SymfonyRequest {
    public function getUri(): string { return ''; }
}

class LaravelRequest extends SymfonyRequest {
    public function fullUrlIs(string $pattern): bool { return true; }
    public function is(string $pattern): bool { return true; }
}

class Middleware {
    protected function decrypt(SymfonyRequest $request): SymfonyRequest {
        $except = '/foo';
        if ($request instanceof LaravelRequest && ($request-><>fullUrlIs($except) || $request->is($except))) {
            return $request;
        }
        return $request;
    }
}