getPathname(); } $fileInfo = pathinfo($currentFile); $excludeFile = (str_replace($excludeDir, '', $currentFile) != $currentFile); if ($excludeFile === false) { if (isset($fileInfo['extension']) && in_array($fileInfo['extension'], $extensions)) { $data = file($currentFile); $lastLine = $data[count($data) - 1]; $lineEnding = substr($lastLine, -1); if ($lineEnding !== PHP_EOL) { $message .= $currentFile . PHP_EOL; } } } } if (! empty($message)) { echo color('Files without unix ending line:', 'yellow') . PHP_EOL; info($message); exit(1); } else { important('All files OK'); }