php-language-server icon indicating copy to clipboard operation
php-language-server copied to clipboard

Incorect error on class creation

Open Vangoda opened this issue 5 years ago • 1 comments
trafficstars

When PHP IntelliSense 2.3.14 extension is enabled and I try to create a class I get 2 errors and my class name is underlined. Here is the code:

class Xlsx extends Controller{
    public function generateClient(){
        $viewmodel = new XlsxModel();
        $this->returnView($viewmodel->returnView(),true);
    }
}

The errors are "{ expected" and "} expected". This stopped happening when i disabled and re-enabled extension a couple times.

Vangoda avatar Mar 09 '20 16:03 Vangoda

Ditto. I am having the same issue. PHP IntelliSense 2.3.14 on PHP 7.3.9. Here is my code.

<?php 
class Router{
    # ASSOC ARRAY OF ROUTES
    protected $routes = [];
};
?>

Edit: Restarting Visual Studio Code resolved the faulty "{ expected" and "} expected"

hdevilbiss avatar Mar 29 '20 18:03 hdevilbiss