Skip to content

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

@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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy