Skip to content

Commit db8f2f3

Browse files
author
Jake Bell
committed
Fixing some code style issues.
1 parent 891bf6c commit db8f2f3

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

gist_filter.module

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ function gist_filter_filter_tips($filter, $format, $long = FALSE) {
7979
function theme_gist_filter_code($vars) {
8080
$file = $vars['file'];
8181

82-
return '<div class="drupal-gist-file"><pre type="' . strtolower($file['language']) . '">' . check_plain($file['content']) . '</pre></div>';
82+
return '<div class="drupal-gist-file"><pre type="' . drupal_strtolower($file['language']) . '">' . check_plain($file['content']) . '</pre></div>';
8383
}
8484

8585
/**
@@ -119,7 +119,6 @@ function _gist_display_embed($matches) {
119119
$gist_url = isset($matches[2]) && !empty($matches[2]) ? $gist_url . '.js?file=' . $matches[2] : $gist_url . '.js';
120120

121121
// Also grab the content and display it in code tags (in case the user does not have JS).
122-
// TODO: 1. there is some caching going on here. 2. this is expensive.
123122
$output = '<noscript>' . _gist_display_code($matches) . '</noscript>';
124123

125124
$output .= '<script src="' . $gist_url . '"></script>';
@@ -153,7 +152,7 @@ function gist_filter_get_gist($id) {
153152
$cid = 'gist_filter:gist:' . $id;
154153
// Check if this gist is already in the cache
155154
$gist = cache_get($cid);
156-
155+
157156
if ($cached = cache_get($cid)) {
158157
$gist = $cached->data;
159158
}
@@ -162,7 +161,7 @@ function gist_filter_get_gist($id) {
162161
$url = 'https://api.github.com/gists/' . $id;
163162
$response = drupal_http_request($url, array('headers' => array('Content-Type' => 'application/json')));
164163
$gist = drupal_json_decode($response->data);
165-
164+
166165
// Cache the gist until the next cache flush
167166
cache_set($cid, $gist, 'cache', CACHE_TEMPORARY);
168167
}

gist_filter.test

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
<?php
22

3+
/**
4+
* @file
5+
* Tests for the Gist Filter module.
6+
*/
7+
38
/**
49
* Test class.
510
*/

0 commit comments

Comments
 (0)