private function getNamespaceFromResourceFilename(string $resourceFilename): string
  {
    $name = $this->getPathInResources($resourceFilename);

    // Remove resource dir from name.
    $len = strlen(trim($this->resourceDir, '/'));
    if ($len>0)
    {
      $name = substr($name, $len + 2);
    }

    // Remove extension.
    $parts = pathinfo($name);
    $name  = substr($name, 0, -(strlen($parts['extension']) + 1));

    return $name;
  }
private function getNamespaceFromResourceFilename(string $resourceFilename): string
  {
    $name = $this->getPathInResources($resourceFilename);

    // Remove resource dir from name.
    $len = strlen(trim($this->resourceDir, '/'));
    if ($len>0)
    {
      $name = substr($name, $len + 2);
    }

    // Remove extension.
    $parts = pathinfo($name);
    $name  = substr($name, 0, -(strlen($parts['extension']) + 1));

    return $name;
  }
private function getNamespaceFromResourceFilename ( string $ resourceFilename ) : string { $ name = $ this -> getPathInResources ( $ resourceFilename ) ; // Remove resource dir from name. $ len = strlen ( trim ( $ this -> resourceDir , '/' ) ) ; if ( $ len > 0 ) { $ name = substr ( $ name , $ len + 2 ) ; } // Remove extension. $ parts = pathinfo ( $ name ) ; $ name = substr ( $ name , 0 , - ( strlen ( $ parts [ 'extension' ] ) + 1 ) ) ; return $ name ; }
Returns the namespace based on the name of a JavaScript file.

@param string $resourceFilename The name of the JavaScript file.

@return string
Returns the namespace based on the name of a JavaScript file .