Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x

Class_.php

Same filename in this branch
  1. 11.1.x vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Class_.php
  2. 11.1.x vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php
  3. 11.1.x vendor/nikic/php-parser/lib/PhpParser/Builder/Class_.php

Namespace

Peast\Syntax\Node

File

vendor/mck89/peast/lib/Peast/Syntax/Node/Class_.php

View source
<?php


/**
 * This file is part of the Peast package
 *
 * (c) Marco Marchiò <marco.mm89@gmail.com>
 *
 * For the full copyright and license information refer to the LICENSE file
 * distributed with this source code
 */
namespace Peast\Syntax\Node;


/**
 * Abstract class for classes.
 * 
 * @author Marco Marchiò <marco.mm89@gmail.com>
 */
abstract class Class_ extends Node {
    
    /**
     * Map of node properties
     * 
     * @var array 
     */
    protected $propertiesMap = array(
        "id" => true,
        "superClass" => true,
        "body" => true,
    );
    
    /**
     * Class name
     * 
     * @var Identifier 
     */
    protected $id;
    
    /**
     * Extended class
     * 
     * @var Expression 
     */
    protected $superClass;
    
    /**
     * Class body
     * 
     * @var ClassBody 
     */
    protected $body;
    
    /**
     * Returns class name
     * 
     * @return Identifier
     */
    public function getId() {
        return $this->id;
    }
    
    /**
     * Sets class name
     * 
     * @param Identifier $id Class name
     * 
     * @return $this
     */
    public function setId($id) {
        $this->assertType($id, "Identifier", true);
        $this->id = $id;
        return $this;
    }
    
    /**
     * Returns extended class
     * 
     * @return Expression
     */
    public function getSuperClass() {
        return $this->superClass;
    }
    
    /**
     * Sets extended class
     * 
     * @param Expression $superClass Extended class
     * 
     * @return $this
     */
    public function setSuperClass($superClass) {
        $this->assertType($superClass, "Expression", true);
        $this->superClass = $superClass;
        return $this;
    }
    
    /**
     * Returns class body
     * 
     * @return ClassBody
     */
    public function getBody() {
        return $this->body;
    }
    
    /**
     * Sets class body
     * 
     * @param ClassBody $body Class body
     * 
     * @return $this
     */
    public function setBody($body) {
        $this->assertType($body, "ClassBody");
        $this->body = $body;
        return $this;
    }

}

Classes

Title Deprecated Summary
Class_ Abstract class for classes.

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal