Get the name of the package in which the exception was created.

@since 1.0.0

@return string Package name, or empty string if not part of a package.
499352
public function getPackageName(): string
    {
        $this->findPackage();

        if (!isset($this->package->name)) {
            return '';
        }

        return $this->package->name;
    }
200615
public String getPackageGroup() {
    String packageName = interfaceClass.getPackage().getName();
    String[] parts = packageName.split("\\.");
    return parts[parts.length - 1];
  }
907055
private String getGroupIdFromName(PhpPackage phpPackage) {
        String groupId = null;
        if (StringUtils.isNotBlank(phpPackage.getName())) {
            String packageName = phpPackage.getName();
            String[] gavCoordinates = packageName.split(FORWARD_SLASH);
            groupId = gavCoordinates[0];
        }
        return groupId;
    }
1064881
private String getEffectiveVisitorPackageName ()
  {
    if (this.packageName != null)
      return this.packageName.length () <= 0 ? VISITOR : this.packageName + '.' + VISITOR;
    if (this.visitorPackageName != null)
      return this.visitorPackageName;
    return VISITOR;
  }
352349
public static function getServiceAccountName() {
    $req = new GetServiceAccountNameRequest();
    $resp = new GetServiceAccountNameResponse();

    try {
      ApiProxy::makeSyncCall(self::PACKAGE_NAME, 'GetServiceAccountName', $req,
          $resp);
    } catch (ApplicationError $e) {
      throw self::applicationErrorToException($e);
    }

    return $resp->getServiceAccountName();
  }
230260
static function getName(\Throwable $exception): string
    {
        $name = null;

        if ($exception instanceof \ErrorException) {
            $name = Error::getName($exception->getSeverity());
        }

        if ($name === null) {
            $name = get_class($exception);
        }

        if (($code = $exception->getCode()) !== 0) {
            $name .= " ({$code})";
        }

        return $name;
    }
599980
public static String getDomainPackageName() {
        String domainPackageName = getMetaDataString(METADATA_DOMAIN_PACKAGE_NAME);

        if (domainPackageName == null) {
            domainPackageName = "";
        }

        return domainPackageName;
    }
161192
private function guessTemplateName()
	{
		if ($this->package === null) {
			throw new \RuntimeException(sprintf(
				'Block package is unknown, thus it is impossible to guess template name for block [%s].',
				$this->getTitle()
			));
		}

		$name = (new \ReflectionClass($this))->getShortName();

		if (($pos = strpos($name, 'Config')) !== false
			&& $pos === (strlen($name) - 6)) {

			$name = substr($name, 0, -6);
		}

		return $this->package->getName() . ':blocks' . DIRECTORY_SEPARATOR . Inflector::tableize($name) . '.html.twig';
	}
878380
public Content getPackageName(PackageElement packageElement) {
        return packageElement == null || packageElement.isUnnamed()
                ? contents.defaultPackageLabel
                : getPackageLabel(packageElement.getQualifiedName());
    }
1165977
private String getEffectiveNodePackageName ()
  {
    if (this.packageName != null)
      return this.packageName.length () <= 0 ? SYNTAX_TREE : this.packageName + '.' + SYNTAX_TREE;

    if (this.nodePackageName != null)
      return this.nodePackageName;
    return SYNTAX_TREE;
  }
760538
public static String packageNameOf(Class<?> clazz) {
        String name = clazz.getName();
        int pos = name.lastIndexOf('.');
        E.unexpectedIf(pos < 0, "Class does not have package: " + name);
        return name.substring(0, pos);
    }
834037
public static function GetPackagePath () {
		$called_class = static::class;
		$offset = strpos($called_class, "\\") + 1;
		return str_replace("\\", '/', substr($called_class, 0, strpos($called_class, "\\", $offset)));
	}
106458
public function getPackageName()
    {
        $reflection = new \ReflectionClass($this);
        $inflector = new Inflector();

        return str_replace('_', '-', $inflector->tableize(str_replace('ServiceProvider', '', $reflection->getShortName())));
    }
396067
public function getPackagePath()
    {
        $packageHandle = $this->getPackageHandle();
        $result = $this->DIR_PACKAGES . '/' . $packageHandle;
        if (!is_dir($result)) {
            $result = $this->DIR_PACKAGES_CORE . '/' . $packageHandle;
        }

        return $result;
    }
873355
public function getName()
	{
		$class = get_class($this);

		$class = explode('\\', $class);

		$class = $class[count($class) - 1];

		$class = str_replace(array('Supra', 'Package'), '', $class);

		$inflector = new Inflector();
		$name = $inflector->tableize($class);

		return $name;
	}
1343989
public function getSystemId()
    {
        if (!is_null($this->_systemId)) {
            return $this->_systemId;
        }
        preg_match('/' . ucfirst($this->moduleType) . '([A-Za-z]+)\\\Module/', get_class($this), $matches);
        if (!isset($matches[1])) {
            throw new Exception(get_class($this) . " is not set up correctly!");
        }

        return $this->_systemId = $matches[1];
    }
1079075
public function getPackageHandle()
    {
        if (!isset($this->pkgHandle)) {
            $this->pkgHandle = PackageList::getHandle($this->pkgID);
        }

        return $this->pkgHandle;
    }