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

Breadcrumb

  1. Drupal Core 11.1.x
  2. Name.php

function Name::getLast

Gets the last part of the name, i.e. everything after the last namespace separator.

Return value

string Last part of the name

File

vendor/nikic/php-parser/lib/PhpParser/Node/Name.php, line 63

Class

Name

Namespace

PhpParser\Node

Code

public function getLast() : string {
    if (false !== ($pos = \strrpos($this->name, '\\'))) {
        return \substr($this->name, $pos + 1);
    }
    return $this->name;
}
RSS feed
Powered by Drupal