Moosh\Command\Generic\Tools\ToolsCodeCheck::_get_files PHP Method

_get_files() private method

private _get_files ( $path )
    private function _get_files($path)
    {
        $extensions_to_check = array("php");
        $objects = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path));
        $files = array();
        if ($handle = opendir($path)) {
            foreach ($objects as $entry => $object) {
                if (!$object->isDir()) {
                    $ext = pathinfo($entry, PATHINFO_EXTENSION);
                    if (in_array($ext, $extensions_to_check)) {
                        $files[] = $entry;
                    }
                }
            }
            closedir($handle);
        }
        return $files;
    }