@@ -58,10 +58,10 @@ discard block |
||
58 | 58 | $dir = $baseDir.DIRECTORY_SEPARATOR.$size; |
59 | 59 | $file = null; |
60 | 60 | |
61 | - if(is_dir($dir)) { |
|
61 | + if (is_dir($dir)) { |
|
62 | 62 | $files = FileHelper::findFiles($dir); |
63 | 63 | |
64 | - if(count($files) > 0) { |
|
64 | + if (count($files) > 0) { |
|
65 | 65 | $file = $files[0]; |
66 | 66 | } |
67 | 67 | } |
@@ -70,14 +70,14 @@ discard block |
||
70 | 70 | // Retrieve original image |
71 | 71 | $originalPath = null; |
72 | 72 | |
73 | - if(is_dir($originalDir)) { |
|
73 | + if (is_dir($originalDir)) { |
|
74 | 74 | $originalFiles = FileHelper::findFiles($originalDir); |
75 | 75 | |
76 | - if(count($originalFiles) > 0) { |
|
76 | + if (count($originalFiles) > 0) { |
|
77 | 77 | $originalPath = $originalFiles[0]; |
78 | 78 | } |
79 | 79 | } |
80 | - if(!$originalPath) { |
|
80 | + if (!$originalPath) { |
|
81 | 81 | $user = Plugin::$plugin->getApi()->getUserById($twitterUserId); |
82 | 82 | |
83 | 83 | $url = str_replace('_normal', '', $user['profile_image_url_https']); |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | { |
41 | 41 | return Twitter::$plugin->getApi()->get($uri, $query, $headers, $options, $enableCache, $cacheExpire); |
42 | 42 | } |
43 | - catch(\Exception $e) |
|
43 | + catch (\Exception $e) |
|
44 | 44 | { |
45 | 45 | Craft::info("Error requesting Twitter’s API: ".$e->getMessage(), __METHOD__); |
46 | 46 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | { |
61 | 61 | return Twitter::$plugin->getApi()->getTweetById($tweetId, $query); |
62 | 62 | } |
63 | - catch(\Exception $e) |
|
63 | + catch (\Exception $e) |
|
64 | 64 | { |
65 | 65 | Craft::info("Couldn’t get tweet by ID: ".$e->getMessage(), __METHOD__); |
66 | 66 | } |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | { |
81 | 81 | return Twitter::$plugin->getApi()->getUserById($twitterUserId, $query); |
82 | 82 | } |
83 | - catch(\Exception $e) |
|
83 | + catch (\Exception $e) |
|
84 | 84 | { |
85 | 85 | Craft::info("Couldn’t get user by ID: ".$e->getMessage(), __METHOD__); |
86 | 86 | } |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | { |
101 | 101 | return TwitterHelper::getUserProfileImageResourceUrl($twitterUserId, $size); |
102 | 102 | } |
103 | - catch(\Exception $e) |
|
103 | + catch (\Exception $e) |
|
104 | 104 | { |
105 | 105 | Craft::info("Couldn’t get user profile image resource URL: ".$e->getMessage(), __METHOD__); |
106 | 106 | } |
@@ -39,8 +39,7 @@ discard block |
||
39 | 39 | try |
40 | 40 | { |
41 | 41 | return Twitter::$plugin->getApi()->get($uri, $query, $headers, $options, $enableCache, $cacheExpire); |
42 | - } |
|
43 | - catch(\Exception $e) |
|
42 | + } catch(\Exception $e) |
|
44 | 43 | { |
45 | 44 | Craft::info("Error requesting Twitter’s API: ".$e->getMessage(), __METHOD__); |
46 | 45 | } |
@@ -59,8 +58,7 @@ discard block |
||
59 | 58 | try |
60 | 59 | { |
61 | 60 | return Twitter::$plugin->getApi()->getTweetById($tweetId, $query); |
62 | - } |
|
63 | - catch(\Exception $e) |
|
61 | + } catch(\Exception $e) |
|
64 | 62 | { |
65 | 63 | Craft::info("Couldn’t get tweet by ID: ".$e->getMessage(), __METHOD__); |
66 | 64 | } |
@@ -79,8 +77,7 @@ discard block |
||
79 | 77 | try |
80 | 78 | { |
81 | 79 | return Twitter::$plugin->getApi()->getUserById($twitterUserId, $query); |
82 | - } |
|
83 | - catch(\Exception $e) |
|
80 | + } catch(\Exception $e) |
|
84 | 81 | { |
85 | 82 | Craft::info("Couldn’t get user by ID: ".$e->getMessage(), __METHOD__); |
86 | 83 | } |
@@ -99,8 +96,7 @@ discard block |
||
99 | 96 | try |
100 | 97 | { |
101 | 98 | return TwitterHelper::getUserProfileImageResourceUrl($twitterUserId, $size); |
102 | - } |
|
103 | - catch(\Exception $e) |
|
99 | + } catch(\Exception $e) |
|
104 | 100 | { |
105 | 101 | Craft::info("Couldn’t get user profile image resource URL: ".$e->getMessage(), __METHOD__); |
106 | 102 | } |
@@ -100,7 +100,7 @@ |
||
100 | 100 | try { |
101 | 101 | $q = $searchQuery; |
102 | 102 | |
103 | - if(Twitter::$plugin->getSettings()->searchWidgetExtraQuery) { |
|
103 | + if (Twitter::$plugin->getSettings()->searchWidgetExtraQuery) { |
|
104 | 104 | $q .= ' '.Twitter::$plugin->getSettings()->searchWidgetExtraQuery; |
105 | 105 | } |
106 | 106 |
@@ -124,9 +124,9 @@ |
||
124 | 124 | } |
125 | 125 | $link = '<a'; |
126 | 126 | foreach ($attributes as $key => $val) { |
127 | - $link .= ' ' . $key . '="' . $this->escapeHTML($val) . '"'; |
|
127 | + $link .= ' '.$key.'="'.$this->escapeHTML($val).'"'; |
|
128 | 128 | } |
129 | - $link .= '>' . $text . '</a>'; |
|
129 | + $link .= '>'.$text.'</a>'; |
|
130 | 130 | return $link; |
131 | 131 | } |
132 | 132 |