@@ -10,11 +10,11 @@ discard block |
||
10 | 10 | |
11 | 11 | protected function execute() |
12 | 12 | { |
13 | - if(stristr($this->content, 'http') === false) |
|
13 | + if (stristr($this->content, 'http') === false) |
|
14 | 14 | return; |
15 | 15 | |
16 | 16 | $parameters = func_get_args(); |
17 | - if(count($parameters) > 1 || (count($parameters) == 1 && !is_array($parameters[0]))) |
|
17 | + if (count($parameters) > 1 || (count($parameters) == 1 && !is_array($parameters[0]))) |
|
18 | 18 | { |
19 | 19 | trigger_error('Unexpected parameters passed into AutolinkTwitterURL!'); |
20 | 20 | return; |
@@ -22,10 +22,10 @@ discard block |
||
22 | 22 | $parameters = array_shift($parameters); |
23 | 23 | |
24 | 24 | $found_link = preg_match_all(self::$LINK_PATTERN, $this->content, $matches, PREG_SET_ORDER); |
25 | - if($found_link === false || $found_link === 0) |
|
25 | + if ($found_link === false || $found_link === 0) |
|
26 | 26 | return; |
27 | 27 | |
28 | - foreach($matches as $match) |
|
28 | + foreach ($matches as $match) |
|
29 | 29 | { |
30 | 30 | $parameters['href'] = $match[0]; |
31 | 31 | $display_url = $this->get_display_url($match); |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | { |
42 | 42 | $display_url = $this->check_for_redirect($match[0]); |
43 | 43 | |
44 | - if(strlen($display_url) > (self::$DISPLAY_URL_LENGTH - 2)) |
|
44 | + if (strlen($display_url) > (self::$DISPLAY_URL_LENGTH - 2)) |
|
45 | 45 | { |
46 | 46 | $display_url = substr($display_url, 0, self::$DISPLAY_URL_LENGTH); |
47 | 47 | $display_url .= '...'; |
@@ -53,12 +53,12 @@ discard block |
||
53 | 53 | private function get_replacement_link($parameters, $display_url) |
54 | 54 | { |
55 | 55 | $link = '<a'; |
56 | - foreach($parameters as $attribute => $value) |
|
56 | + foreach ($parameters as $attribute => $value) |
|
57 | 57 | { |
58 | 58 | $link .= ' '; |
59 | 59 | $link .= $attribute; |
60 | 60 | $link .= '='; |
61 | - $link .= '"' . $value .'"'; |
|
61 | + $link .= '"' . $value . '"'; |
|
62 | 62 | } |
63 | 63 | $link .= '>'; |
64 | 64 | $link .= $display_url; |
@@ -70,14 +70,14 @@ discard block |
||
70 | 70 | private function check_for_redirect($url) |
71 | 71 | { |
72 | 72 | $headers = @get_headers($url); |
73 | - if($headers === false) |
|
73 | + if ($headers === false) |
|
74 | 74 | $headers = $this->get_headers($url); |
75 | 75 | |
76 | - if(stristr($headers[0], '301') !== false || stristr($headers[0], '302') !== false) |
|
76 | + if (stristr($headers[0], '301') !== false || stristr($headers[0], '302') !== false) |
|
77 | 77 | { |
78 | - foreach($headers as $header) |
|
78 | + foreach ($headers as $header) |
|
79 | 79 | { |
80 | - if(substr($header, 0, 9) == 'Location:') |
|
80 | + if (substr($header, 0, 9) == 'Location:') |
|
81 | 81 | break; |
82 | 82 | } |
83 | 83 |
@@ -10,12 +10,12 @@ discard block |
||
10 | 10 | |
11 | 11 | protected function execute() |
12 | 12 | { |
13 | - if(stristr($this->content, '#') === false) |
|
13 | + if (stristr($this->content, '#') === false) |
|
14 | 14 | return; |
15 | 15 | |
16 | 16 | // yeah yeah, i'm currently ignoring the link, whatevs |
17 | 17 | $parameters = func_get_args(); |
18 | - if(count($parameters) > 1 || (count($parameters) == 1 && !is_array($parameters[0]))) |
|
18 | + if (count($parameters) > 1 || (count($parameters) == 1 && !is_array($parameters[0]))) |
|
19 | 19 | { |
20 | 20 | trigger_error('Unexpected parameters passed into AutolinkTwitterHash!'); |
21 | 21 | return; |
@@ -23,10 +23,10 @@ discard block |
||
23 | 23 | $parameters = array_shift($parameters); |
24 | 24 | |
25 | 25 | $found_hash = preg_match_all(self::$HASH_PATTERN, $this->content, $matches, PREG_SET_ORDER); |
26 | - if($found_hash === false || $found_hash === 0) |
|
26 | + if ($found_hash === false || $found_hash === 0) |
|
27 | 27 | return; |
28 | 28 | |
29 | - foreach($matches as $match) |
|
29 | + foreach ($matches as $match) |
|
30 | 30 | { |
31 | 31 | $replacement = $this->get_replacement_link($match[1], $match[0]); |
32 | 32 | $this->content = str_replace($match[0], $replacement, $this->content); |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | protected function execute($is_absolute = false, $size = 'medium') |
13 | 13 | { |
14 | 14 | preg_match_all(self::$PHOTO_PLACEHOLDER_MATCH, $this->content, $matches); |
15 | - foreach($matches[1] as $key => $match) |
|
15 | + foreach ($matches[1] as $key => $match) |
|
16 | 16 | { |
17 | 17 | $photo_content = $this->get_photo_content($match, $size, $is_absolute); |
18 | 18 | $this->content = str_replace($matches[0][$key], $photo_content, $this->content); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | |
38 | 38 | Loader::load('collector', 'image/PhotoCollector'); |
39 | 39 | $photo_result = PhotoCollector::fetchRow($category, $photo); |
40 | - if($photo_result == false) |
|
40 | + if ($photo_result == false) |
|
41 | 41 | return ''; |
42 | 42 | |
43 | 43 | $height = $file_size[1]; |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | } |
50 | 50 | |
51 | 51 | $domain = '/'; |
52 | - if($is_absolute) |
|
52 | + if ($is_absolute) |
|
53 | 53 | $domain = Loader::getRootUrl('blog'); |
54 | 54 | |
55 | 55 | return sprintf(self::$PHOTO_CONTENT, $domain, $category, $photo, $size, $height, $width, $description, $description); |
@@ -10,61 +10,61 @@ |
||
10 | 10 | $previous_time = strtotime($this->content); |
11 | 11 | $current_time = time(); |
12 | 12 | |
13 | - if($current_time <= $previous_time) |
|
13 | + if ($current_time <= $previous_time) |
|
14 | 14 | $this->content = 'few seconds ago'; |
15 | - else if(($current_time - $previous_time) < 30) |
|
15 | + else if (($current_time - $previous_time) < 30) |
|
16 | 16 | $this->content = 'few seconds ago'; |
17 | - else if(($current_time - $previous_time) < 1.5 * 60) |
|
17 | + else if (($current_time - $previous_time) < 1.5 * 60) |
|
18 | 18 | $this->content = 'a minute ago'; |
19 | - else if(($current_time - $previous_time) < 4 * 60) |
|
19 | + else if (($current_time - $previous_time) < 4 * 60) |
|
20 | 20 | $this->content = 'few minutes ago'; |
21 | - else if(($current_time - $previous_time) < 7 * 60) |
|
21 | + else if (($current_time - $previous_time) < 7 * 60) |
|
22 | 22 | $this->content = 'five minutes ago'; |
23 | - else if(($current_time - $previous_time) < 12 * 60) |
|
23 | + else if (($current_time - $previous_time) < 12 * 60) |
|
24 | 24 | $this->content = 'ten minutes ago'; |
25 | - else if(($current_time - $previous_time) < 17 * 60) |
|
25 | + else if (($current_time - $previous_time) < 17 * 60) |
|
26 | 26 | $this->content = 'fifteen minutes ago'; |
27 | - else if(($current_time - $previous_time) < 22 * 60) |
|
27 | + else if (($current_time - $previous_time) < 22 * 60) |
|
28 | 28 | $this->content = 'twenty minutes ago'; |
29 | - else if(($current_time - $previous_time) < 37 * 60) |
|
29 | + else if (($current_time - $previous_time) < 37 * 60) |
|
30 | 30 | $this->content = 'half hour ago'; |
31 | - else if(($current_time - $previous_time) < 52 * 60) |
|
31 | + else if (($current_time - $previous_time) < 52 * 60) |
|
32 | 32 | $this->content = 'forty-five minutes ago'; |
33 | - else if(($current_time - $previous_time) < 1.5 * 60 * 60) |
|
33 | + else if (($current_time - $previous_time) < 1.5 * 60 * 60) |
|
34 | 34 | $this->content = 'an hour ago'; |
35 | - else if(($current_time - $previous_time) < 2.5 * 60 * 60) |
|
35 | + else if (($current_time - $previous_time) < 2.5 * 60 * 60) |
|
36 | 36 | $this->content = 'two hours ago'; |
37 | - else if(($current_time - $previous_time) < 3.5 * 60 * 60) |
|
37 | + else if (($current_time - $previous_time) < 3.5 * 60 * 60) |
|
38 | 38 | $this->content = 'three hours ago'; |
39 | - else if(($current_time - $previous_time) < 4.5 * 60 * 60) |
|
39 | + else if (($current_time - $previous_time) < 4.5 * 60 * 60) |
|
40 | 40 | $this->content = 'few hours ago'; |
41 | - else if(($current_time - $previous_time) < 1 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) && date('a', $previous_time) == 'pm') |
|
41 | + else if (($current_time - $previous_time) < 1 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) && date('a', $previous_time) == 'pm') |
|
42 | 42 | $this->content = 'this afternoon'; |
43 | - else if(($current_time - $previous_time) < 1 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) && date('a', $previous_time) == 'am') |
|
43 | + else if (($current_time - $previous_time) < 1 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) && date('a', $previous_time) == 'am') |
|
44 | 44 | $this->content = 'this morning'; |
45 | - else if(($current_time - $previous_time) < 2 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 1 && date('a', $previous_time) == 'pm' && date('G', $previous_time) >= 17) |
|
45 | + else if (($current_time - $previous_time) < 2 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 1 && date('a', $previous_time) == 'pm' && date('G', $previous_time) >= 17) |
|
46 | 46 | $this->content = 'yesterday evening'; |
47 | - else if(($current_time - $previous_time) < 2 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 1 && date('a', $previous_time) == 'pm') |
|
47 | + else if (($current_time - $previous_time) < 2 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 1 && date('a', $previous_time) == 'pm') |
|
48 | 48 | $this->content = 'yesterday afternoon'; |
49 | - else if(($current_time - $previous_time) < 2 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 1 && date('a', $previous_time) == 'am') |
|
49 | + else if (($current_time - $previous_time) < 2 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 1 && date('a', $previous_time) == 'am') |
|
50 | 50 | $this->content = 'yesterday morning'; |
51 | - else if(($current_time - $previous_time) < 3 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 2) |
|
51 | + else if (($current_time - $previous_time) < 3 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 2) |
|
52 | 52 | $this->content = 'two days ago'; |
53 | - else if(($current_time - $previous_time) < 4 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 3) |
|
53 | + else if (($current_time - $previous_time) < 4 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 3) |
|
54 | 54 | $this->content = 'three days ago'; |
55 | - else if(($current_time - $previous_time) < 1 * 7 * 24 * 60 * 60 && date('W', $current_time) == date('W', $previous_time)) |
|
55 | + else if (($current_time - $previous_time) < 1 * 7 * 24 * 60 * 60 && date('W', $current_time) == date('W', $previous_time)) |
|
56 | 56 | $this->content = 'earlier this week'; |
57 | - else if(($current_time - $previous_time) < 2 * 7 * 24 * 60 * 60 && date('W', $current_time) == date('W', $previous_time) + 1 && date('w', $previous_time) >= 3) |
|
57 | + else if (($current_time - $previous_time) < 2 * 7 * 24 * 60 * 60 && date('W', $current_time) == date('W', $previous_time) + 1 && date('w', $previous_time) >= 3) |
|
58 | 58 | $this->content = 'late last week'; |
59 | - else if(($current_time - $previous_time) < 2 * 7 * 24 * 60 * 60 && date('W', $current_time) == date('W', $previous_time) + 1) |
|
59 | + else if (($current_time - $previous_time) < 2 * 7 * 24 * 60 * 60 && date('W', $current_time) == date('W', $previous_time) + 1) |
|
60 | 60 | $this->content = 'early last week'; |
61 | - else if(($current_time - $previous_time) < 3 * 7 * 24 * 60 * 60) |
|
61 | + else if (($current_time - $previous_time) < 3 * 7 * 24 * 60 * 60) |
|
62 | 62 | $this->content = 'few weeks ago'; |
63 | - else if(($current_time - $previous_time) < 1.25* 4 * 7 * 24 * 60 * 60 && date('n', $current_time) == date('n', $previous_time)) |
|
63 | + else if (($current_time - $previous_time) < 1.25 * 4 * 7 * 24 * 60 * 60 && date('n', $current_time) == date('n', $previous_time)) |
|
64 | 64 | $this->content = 'earlier this month'; |
65 | - else if(($current_time - $previous_time) < 2 * 4 * 7 * 24 * 60 * 60 && date('n', $current_time) == date('n', $previous_time) + 1) |
|
65 | + else if (($current_time - $previous_time) < 2 * 4 * 7 * 24 * 60 * 60 && date('n', $current_time) == date('n', $previous_time) + 1) |
|
66 | 66 | $this->content = 'last month'; |
67 | - else if(($current_time - $previous_time) < 4 * 4 * 7 * 24 * 60 * 60) |
|
67 | + else if (($current_time - $previous_time) < 4 * 4 * 7 * 24 * 60 * 60) |
|
68 | 68 | $this->content = 'several months ago'; |
69 | 69 | else |
70 | 70 | $this->content = 'long ago'; |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | protected function execute($is_absolute = false, $size = 'thumb') |
13 | 13 | { |
14 | - if(preg_match(self::$PHOTO_PLACEHOLDER_MATCH, $this->content, $match) === 1) |
|
14 | + if (preg_match(self::$PHOTO_PLACEHOLDER_MATCH, $this->content, $match) === 1) |
|
15 | 15 | $this->content = $this->get_thumb($match[1], $is_absolute, $size); |
16 | 16 | else |
17 | 17 | $this->content = self::$DEFAULT_RETURN; |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | |
35 | 35 | Loader::load('collector', 'image/PhotoCollector'); |
36 | 36 | $photo_result = PhotoCollector::fetchRow($category, $photo); |
37 | - if($photo_result == false) |
|
37 | + if ($photo_result == false) |
|
38 | 38 | return ''; |
39 | 39 | |
40 | 40 | $height = $file_size[1]; |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | $description = $photo_result->description; |
43 | 43 | |
44 | 44 | $domain = '/'; |
45 | - if($is_absolute) |
|
45 | + if ($is_absolute) |
|
46 | 46 | $domain = Loader::getRootUrl(); |
47 | 47 | |
48 | 48 | return sprintf(self::$IMAGE_NODE, $domain, $category, $photo, $size, $extension, $height, $width, $description); |
@@ -40,10 +40,10 @@ discard block |
||
40 | 40 | { |
41 | 41 | $match_count = preg_match_all($pattern, $this->content, $matches, PREG_SET_ORDER); |
42 | 42 | |
43 | - if($match_count < 1) |
|
43 | + if ($match_count < 1) |
|
44 | 44 | return; |
45 | 45 | |
46 | - foreach($matches as $match) |
|
46 | + foreach ($matches as $match) |
|
47 | 47 | { |
48 | 48 | $full_match = array_shift($match); |
49 | 49 | $placeholder = $this->create_placeholder($full_match); |
@@ -79,10 +79,10 @@ discard block |
||
79 | 79 | { |
80 | 80 | $match_count = preg_match_all($pattern, $this->content, $matches, PREG_SET_ORDER); |
81 | 81 | |
82 | - if($match_count < 1) |
|
82 | + if ($match_count < 1) |
|
83 | 83 | return; |
84 | 84 | |
85 | - foreach($matches as $match) |
|
85 | + foreach ($matches as $match) |
|
86 | 86 | { |
87 | 87 | $full_match = array_shift($match); |
88 | 88 | $full_match_pattern = $this->create_full_match_pattern($full_match); |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | |
100 | 100 | private function replace_element_patterns() |
101 | 101 | { |
102 | - foreach($this->replacement_array as $key => $replace) |
|
102 | + foreach ($this->replacement_array as $key => $replace) |
|
103 | 103 | { |
104 | 104 | $this->content = str_replace($key, $replace, $this->content); |
105 | 105 | } |
@@ -10,12 +10,12 @@ discard block |
||
10 | 10 | |
11 | 11 | protected function execute() |
12 | 12 | { |
13 | - if(stristr($this->content, '@') === false) |
|
13 | + if (stristr($this->content, '@') === false) |
|
14 | 14 | return; |
15 | 15 | |
16 | 16 | // yeah yeah, i'm currently ignoring the link, whatevs |
17 | 17 | $parameters = func_get_args(); |
18 | - if(count($parameters) > 1 || (count($parameters) == 1 && !is_array($parameters[0]))) |
|
18 | + if (count($parameters) > 1 || (count($parameters) == 1 && !is_array($parameters[0]))) |
|
19 | 19 | { |
20 | 20 | trigger_error('Unexpected parameters passed into AutolinkTwitterUser!'); |
21 | 21 | return; |
@@ -23,10 +23,10 @@ discard block |
||
23 | 23 | $parameters = array_shift($parameters); |
24 | 24 | |
25 | 25 | $found_user = preg_match_all(self::$USER_PATTERN, $this->content, $matches, PREG_SET_ORDER); |
26 | - if($found_user === false || $found_user === 0) |
|
26 | + if ($found_user === false || $found_user === 0) |
|
27 | 27 | return; |
28 | 28 | |
29 | - foreach($matches as $match) |
|
29 | + foreach ($matches as $match) |
|
30 | 30 | { |
31 | 31 | $replacement = $this->get_replacement_link($match[1], $match[0]); |
32 | 32 | $this->content = str_replace($match[0], $replacement, $this->content); |
@@ -22,13 +22,13 @@ |
||
22 | 22 | |
23 | 23 | public function activate() |
24 | 24 | { |
25 | - foreach($this->post_array as $post) |
|
25 | + foreach ($this->post_array as $post) |
|
26 | 26 | { |
27 | 27 | $blog_result = BlogCollector::getBlogByTitle($post->title); |
28 | - if($blog_result !== null) |
|
28 | + if ($blog_result !== null) |
|
29 | 29 | { |
30 | 30 | $comments = CommentCollector::getCommentCountForURL(2, $post->path); |
31 | - if($blog_result->comments != $comments) |
|
31 | + if ($blog_result->comments != $comments) |
|
32 | 32 | { |
33 | 33 | $query = sprintf(self::$UPDATE_COMMENTS_QUERY, $comments, $blog_result->id); |
34 | 34 | Database::execute($query); |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | private $oauth_array; |
84 | 84 | private function get_oauth_array() |
85 | 85 | { |
86 | - if(!isset($this->oauth_array)) |
|
86 | + if (!isset($this->oauth_array)) |
|
87 | 87 | { |
88 | 88 | $this->oauth_array = array( |
89 | 89 | 'screen_name' => self::$SCREEN_NAME, |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | { |
117 | 117 | $encoded_array = array(); |
118 | 118 | ksort($array); |
119 | - foreach($array as $key => $value) |
|
119 | + foreach ($array as $key => $value) |
|
120 | 120 | { |
121 | 121 | $value = rawurlencode($value); |
122 | 122 | $value = ($wrap_values) ? '"' . $value . '"' : $value; |
@@ -127,27 +127,27 @@ discard block |
||
127 | 127 | |
128 | 128 | public function activate() |
129 | 129 | { |
130 | - if(!$this->json) |
|
130 | + if (!$this->json) |
|
131 | 131 | return $this->error('Could not connect to twitter json feed.'); |
132 | 132 | |
133 | 133 | $count = 0; |
134 | - foreach($this->json as $status) |
|
134 | + foreach ($this->json as $status) |
|
135 | 135 | { |
136 | 136 | $text = Database::escape($status->text); |
137 | 137 | $date = date('Y-m-d H:i:s', strtotime($status->created_at)); |
138 | 138 | |
139 | 139 | $tweet_result = TwitterCollector::getTweetByFields($date, $text); |
140 | - if($tweet_result !== null) |
|
140 | + if ($tweet_result !== null) |
|
141 | 141 | { |
142 | 142 | $favorites = (int) $status->favorite_count; |
143 | - if($favorites != 0 && $tweet_result->favorites != $favorites) |
|
143 | + if ($favorites != 0 && $tweet_result->favorites != $favorites) |
|
144 | 144 | { |
145 | 145 | $query = sprintf(self::$UPDATE_FAVORITES_QUERY, $favorites, $tweet_result->id); |
146 | 146 | Database::execute($query); |
147 | 147 | } |
148 | 148 | |
149 | 149 | $retweets = (int) $status->retweet_count; |
150 | - if($retweets != 0 && $tweet_result->retweets != $retweets) |
|
150 | + if ($retweets != 0 && $tweet_result->retweets != $retweets) |
|
151 | 151 | { |
152 | 152 | $query = sprintf(self::$UPDATE_RETWEETS_QUERY, $retweets, $tweet_result->id); |
153 | 153 | Database::execute($query); |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | { |
158 | 158 | $twitter_id = (string) $status->id_str; |
159 | 159 | |
160 | - if(isset($status->retweeted_status)) |
|
160 | + if (isset($status->retweeted_status)) |
|
161 | 161 | { |
162 | 162 | $text_formatted = $this->get_formatted($status->retweeted_status->text, $status->retweeted_status->entities); |
163 | 163 | $text_formatted_full = $this->get_formatted($status->retweeted_status->text, $status->retweeted_status->entities, 'full'); |
@@ -200,9 +200,9 @@ discard block |
||
200 | 200 | |
201 | 201 | private function get_source($source) |
202 | 202 | { |
203 | - if(stristr($source, 'tweetdeck')) |
|
203 | + if (stristr($source, 'tweetdeck')) |
|
204 | 204 | return 'tweetdeck'; |
205 | - if(stristr($source, 'windows phone')) |
|
205 | + if (stristr($source, 'windows phone')) |
|
206 | 206 | return 'phone'; |
207 | 207 | else |
208 | 208 | return ''; |
@@ -211,9 +211,9 @@ discard block |
||
211 | 211 | private function get_formatted($text, $entities, $type = 'short') |
212 | 212 | { |
213 | 213 | $holder = array(); |
214 | - foreach($entities as $entity_type => $entity_collection) |
|
214 | + foreach ($entities as $entity_type => $entity_collection) |
|
215 | 215 | { |
216 | - foreach($entity_collection as $entity) |
|
216 | + foreach ($entity_collection as $entity) |
|
217 | 217 | { |
218 | 218 | $start = $entity->indices[0]; |
219 | 219 | $end = $entity->indices[1]; |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | |
229 | 229 | krsort($holder); |
230 | 230 | |
231 | - foreach($holder as $entity) |
|
231 | + foreach ($holder as $entity) |
|
232 | 232 | { |
233 | 233 | $text = mb_substr($text, 0, $entity->start, 'UTF-8') . $entity->replace . mb_substr($text, $entity->end, 5000, 'UTF-8'); |
234 | 234 | } |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | |
242 | 242 | private function get_replace_text($entity_type, $entity, $type) |
243 | 243 | { |
244 | - switch($entity_type) |
|
244 | + switch ($entity_type) |
|
245 | 245 | { |
246 | 246 | case 'hashtags' : |
247 | 247 | $replace = sprintf(self::$HASHTAG_LINK, $entity->text); |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | $replace = sprintf(self::$USER_MENTION_LINK, $entity->screen_name, $entity->name); |
254 | 254 | break; |
255 | 255 | case 'media' : |
256 | - if($type == 'full') |
|
256 | + if ($type == 'full') |
|
257 | 257 | $replace = sprintf(self::$MEDIA_LINK, $entity->url, $entity->display_url, $entity->media_url, 'large', 'Photo from Twitter', $entity->sizes->large->h, $entity->sizes->large->w); |
258 | 258 | else |
259 | 259 | $replace = sprintf(self::$URL_LINK, $entity->url, $entity->expanded_url, $entity->display_url); |