30) { // to many files.. we can not check that amount without causing serious delays in commits return true; } foreach ($files as $filename) { $pi = pathinfo($filename); switch($pi['extension']) { case 'php': case 'html': $fp = $checker->bridge->getFileStream($filename); $res = $this->checkLineBreaks($filename, $fp); if ($res !== true) { $ret[] = $res; } $fp = null; // remove stream. } } return $ret ? implode("\n", $ret) : true; } function postCommit($msg, $files, $actions) { return true; } function checkLineBreaks($filename, $fp) { $pipes = null; $contents = stream_get_contents($fp); if (preg_match("/\r+/", $contents)) { return "Use Unix line endings only in $filename"; } return true; } }