public function removeProperty(string $propertyName) : bool
    {
        $lowerName = strtolower($propertyName);

        foreach ($this->node->stmts as $key => $stmt) {
            if (! ($stmt instanceof PropertyNode)) {
                continue;
            }

            $propertyNames = array_map(static function (Node\Stmt\PropertyProperty $propertyProperty) : string {
                return $propertyProperty->name->toLowerString();
            }, $stmt->props);

            if (in_array($lowerName, $propertyNames, true)) {
                $this->cachedProperties          = null;
                $this->cachedImmediateProperties = null;
                unset($this->node->stmts[$key]);

                return true;
            }
        }

        return false;
    }
public function removeProperty(string $propertyName) : bool
    {
        $lowerName = strtolower($propertyName);

        foreach ($this->node->stmts as $key => $stmt) {
            if (! ($stmt instanceof PropertyNode)) {
                continue;
            }

            $propertyNames = array_map(static function (Node\Stmt\PropertyProperty $propertyProperty) : string {
                return $propertyProperty->name->toLowerString();
            }, $stmt->props);

            if (in_array($lowerName, $propertyNames, true)) {
                $this->cachedProperties          = null;
                $this->cachedImmediateProperties = null;
                unset($this->node->stmts[$key]);

                return true;
            }
        }

        return false;
    }
public function removeProperty ( string $ propertyName ) : bool { $ lowerName = strtolower ( $ propertyName ) ; foreach ( $ this -> node -> stmts as $ key => $ stmt ) { if ( ! ( $ stmt instanceof PropertyNode ) ) { continue ; } $ propertyNames = array_map ( static function ( Node \ Stmt \ PropertyProperty $ propertyProperty ) : string { return $ propertyProperty -> name -> toLowerString ( ) ; } , $ stmt -> props ) ; if ( in_array ( $ lowerName , $ propertyNames , true ) ) { $ this -> cachedProperties = null ; $ this -> cachedImmediateProperties = null ; unset ( $ this -> node -> stmts [ $ key ] ) ; return true ; } } return false ; }
Remove a property from the class.
Remove a property from the class .