Skip to content

emit diagnostic for invalid code #201

Description

@Disservin

PHPantom version

phpantom_lsp 0.8.0-86-gefdc9ae4

Installation method

Pre-built binary from GitHub Releases

Operating system

macOS aarch64 (Apple Silicon)

Editor

VS Code

Bug description

The following
causes a php error, phpantom, however should report a diagnostic for this, since the return type and the declared type (void) don't match.

Fatal error: A void method must not return a value..

Steps to reproduce

<?php

class Foo {
    public function foo(): void
    {
        return 1;
    }
}

Error output or panic trace


.phpantom.toml

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions