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

Breadcrumb

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

function Name::getFirst

Gets the first part of the name, i.e. everything before the first namespace separator.

Return value

string First part of the name

File

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

Class

Name

Namespace

PhpParser\Node

Code

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