Thanks to visit codestin.com
Credit goes to github.com

Skip to content

$this can not be used in static methods. #26279

Closed
@OliverLeitner

Description

@OliverLeitner
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? yes
Symfony version current master

file: symfony/console/Tests/Command.php

    private static function createClosure()
    {
        return function (InputInterface $input, OutputInterface $output) {
            $output->writeln(isset($this) ? 'bound' : 'not bound');
        };
    }

Causes linter error in visual studio code:

file: 'file:///.../symfony/console/Tests/Command/CommandTest.php'
severity: 'Error'
message: '$this can not be used in static methods.'
at: '401,36'
source: 'php'
code: 'undefined'

and yes... one could disable the linter...

anyways... i am sure youre already aware of this and a good solid fix is already on the way, just wanted to check in and say hi;-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions