private function checkFile(SplFileInfo $file)
    {
        $tokens = token_get_all($file->getContents());
        $licenseTokenIndex = $this->getLicenseTokenIndex($tokens);

        if ($licenseTokenIndex === null) {
            $this->log(sprintf('Missing license header in "%s"', $file->getRealPath()));
        } elseif ($tokens[$licenseTokenIndex][1] != $this->getLicenseAsComment()) {
            $this->log(sprintf('Different license header in "%s"', $file->getRealPath()));
        }
    }