Skip to content

Random Container class name generation fail #20489

@alexglue

Description

@alexglue

Kernel class method getName(){} has a schroedinger-bug:
when working directory starts with number, generated class has invalied php name:

pwd (root dir is): 112bgf3892d (like name, generated in teamcity etc)

fix:

        public function getName()
        {
            if (null === $this->name)
            {
                //[-] $this->name = preg_replace('/[^a-zA-Z0-9_]+/', '', basename($this->rootDir));
                //[+] $this->name = 'app' . preg_replace('/[^a-zA-Z0-9_]+/', '', basename($this->rootDir));
            }

            return $this->name;
        }

Metadata

Metadata

Assignees

No one assigned

    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