8000 Use === for comparisons · FlavioFalcao/codebird-php@8874864 · GitHub
[go: up one dir, main page]

Skip to content 8000

Commit 8874864

Browse files
committed
Use === for comparisons
1 parent da00460 commit 8874864

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/codebird.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ class Codebird
137137
*/
138138
public static function getInstance()
139139
{
140-
if (self::$_instance == null) {
140+
if (self::$_instance === null) {
141141
self::$_instance = new self;
142142
}
143143
return self::$_instance;
< 8000 div class="diff-text-inner color-fg-muted">@@ -512,7 +512,7 @@ public function __call($fn, $params)
512512
*/
513513
public function oauth_authenticate($force_login = NULL, $screen_name = NULL)
514514
{
515-
if ($this->_oauth_token == null) {
515+
if ($this->_oauth_token === null) {
516516
throw new \Exception('To get the authenticate URL, the OAuth token must be set.');
517517
}
518518
$url = self::$_endpoint_oauth . 'oauth/authenticate?oauth_token=' . $this->_url($this->_oauth_token);
@@ -532,7 +532,7 @@ public function oauth_authenticate($force_login = NULL, $screen_name = NULL)
532532
*/
533533
public function oauth_authorize($force_login = NULL, $screen_name = NULL)
534534
{
535-
if ($this->_oauth_token == null) {
535+
if ($this->_oauth_token === null) {
536536
throw new \Exception('To get the authorize URL, the OAuth token must be set.');
537537
}
538538
$url = self::$_endpoint_oauth . 'oauth/authorize?oauth_token=' . $this->_url($this->_oauth_token);
@@ -556,7 +556,7 @@ public function oauth2_token()
556556
if (! function_exists('curl_init')) {
557557
throw new \Exception('To make API requests, the PHP curl extension must be available.');
558558
}
559-
if (self::$_oauth_consumer_key == null) {
559+
if (self::$_oauth_consumer_key === null) {
560560
throw new \Exception('To obtain a bearer token, the consumer key must be set.');
561561
}
562562
$ch = false;
@@ -601,19 +601,19 @@ public function oauth2_token()
601601
switch ($this->_return_format) {
602602
case CODEBIRD_RETURNFORMAT_ARRAY:
603603
$reply['httpstatus'] = $httpstatus;
604-
if ($httpstatus == 200) {
604+
if ($httpstatus === 200) {
605605
self::setBearerToken($reply['access_token']);
606606
}
607607
break;
608608
case CODEBIRD_RETURNFORMAT_JSON:
609-
if ($httpstatus == 200) {
609+
if ($httpstatus === 200) {
610610
$parsed = json_decode($reply);
611611
self::setBearerToken($parsed->access_token);
612612
}
613613
break;
614614
case CODEBIRD_RETURNFORMAT_OBJECT:
615615
$reply->httpstatus = $httpstatus;
616-
if ($httpstatus == 200) {
616+
if ($httpstatus === 200) {
617617
self::setBearerToken($reply->access_token);
618618
}
619619
break;
@@ -669,7 +669,7 @@ private function _url($data)
669669
*/
670670
private function _sha1($data)
671671
{
672-
if (self::$_oauth_consumer_secret == null) {
672+
if (self::$_oauth_consumer_secret === null) {
673673
throw new \Exception('To generate a hash, the consumer secret must be set.');
674674
}
675675
if (!function_exists('hash_hmac')) {
@@ -705,7 +705,7 @@ protected function _nonce($length = 8)
705705
*/
706706
protected function _sign($httpmethod, $method, $params = array())
707707
{
708-
if (self::$_oauth_consumer_key == null) {
708+
if (self::$_oauth_consumer_key === null) {
709709
throw new \Exception('To generate a signature, the consumer key must be set.');
710710
}
711711
$sign_params = array(

0 commit comments

Comments
 (0)
0