You are here

static function FileInspector::inspectPhpFile in X Autoload 7.4

Same name and namespace in other branches
  1. 7.5 src/Discovery/FileInspector.php \Drupal\xautoload\Discovery\FileInspector::inspectPhpFile()

Parameters

string $path:

Return value

string[]

Throws

RuntimeException

1 call to FileInspector::inspectPhpFile()
ClassMapGenerator::filesToClassmap in lib/Discovery/ClassMapGenerator.php

File

lib/Discovery/FileInspector.php, line 14

Class

FileInspector

Namespace

Drupal\xautoload\Discovery

Code

static function inspectPhpFile($path) {
  try {
    $contents = php_strip_whitespace($path);
  } catch (\Exception $e) {
    throw new \RuntimeException('Could not scan for classes inside ' . $path . ": \n" . $e
      ->getMessage(), 0, $e);
  }
  return self::inspectFileContents($contents);
}