public static function loadPatternsInPath($path)
    {
        $patterns = array();

        if ($handle = opendir($path)) {
            while (false !== ($entry = readdir($handle))) {
                $fullPath = $path . '/' . $entry;

                if ($entry != '..' && $entry != '.' && is_dir($fullPath)) {
                    $id = trim(str_replace(Primer::$PATTERN_PATH, '', $fullPath), '/');

                    // Load the pattern
                    $patterns[] = new Pattern($id);
                }
            }

            closedir($handle);
        }

        return $patterns;
    }