HippoPHP\Hippo\File::getFilename PHP Method

getFilename() public method

Return the filename.
public getFilename ( ) : string
return string
    public function getFilename()
    {
        return $this->filename;
    }

Usage Example

示例#1
0
 /**
  * Defined by ReportInterface.
  *
  * @see ReportInterface::addCheckResults()
  *
  * @param File          $file
  * @param CheckResult[] $checkResults
  */
 public function addCheckResults(File $file, array $checkResults)
 {
     if (empty($this->loggedSeverities)) {
         return;
     }
     if ($this->firstFile) {
         $this->firstFile = false;
     } else {
         $this->write(PHP_EOL);
     }
     // TODO: Only output if the file has violations?
     $this->write('Checking ' . $file->getFilename() . PHP_EOL);
     $violations = [];
     foreach ($checkResults as $checkResult) {
         $violations = array_merge($violations, $this->getFilteredViolations($checkResult->getViolations()));
     }
     if ($violations) {
         $this->write($file->getFilename() . ':' . PHP_EOL);
         $this->write(str_repeat('-', 80) . PHP_EOL);
         foreach ($violations as $violation) {
             $this->write('Line ' . $violation->getLine());
             if ($violation->getColumn() > 0) {
                 $this->write(':' . $violation->getColumn());
             }
             $this->write(' (' . $violation->getSeverityName() . ') : ');
             $this->write($violation->getMessage() . PHP_EOL);
         }
         $this->write(PHP_EOL);
     }
     flush();
 }
All Usage Examples Of HippoPHP\Hippo\File::getFilename