@@ -137,7 +137,7 @@ class Codebird
137
137
*/
138
138
public static function getInstance ()
139
139
{
140
- if (self ::$ _instance == null ) {
140
+ if (self ::$ _instance === null ) {
141
141
self ::$ _instance = new self ;
142
142
}
143
143
return self ::$ _instance ;
<
8000
div class="diff-text-inner color-fg-muted">@@ -512,7 +512,7 @@ public function __call($fn, $params)
512
512
*/
513
513
public function oauth_authenticate ($ force_login = NULL , $ screen_name = NULL )
514
514
{
515
- if ($ this ->_oauth_token == null ) {
515
+ if ($ this ->_oauth_token === null ) {
516
516
throw new \Exception ('To get the authenticate URL, the OAuth token must be set. ' );
517
517
}
518
518
$ 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)
532
532
*/
533
533
public function oauth_authorize ($ force_login = NULL , $ screen_name = NULL )
534
534
{
535
- if ($ this ->_oauth_token == null ) {
535
+ if ($ this ->_oauth_token === null ) {
536
536
throw new \Exception ('To get the authorize URL, the OAuth token must be set. ' );
537
537
}
538
538
$ url = self ::$ _endpoint_oauth . 'oauth/authorize?oauth_token= ' . $ this ->_url ($ this ->_oauth_token );
@@ -556,7 +556,7 @@ public function oauth2_token()
556
556
if (! function_exists ('curl_init ' )) {
557
557
throw new \Exception ('To make API requests, the PHP curl extension must be available. ' );
558
558
}
559
- if (self ::$ _oauth_consumer_key == null ) {
559
+ if (self ::$ _oauth_consumer_key === null ) {
560
560
throw new \Exception ('To obtain a bearer token, the consumer key must be set. ' );
561
561
}
562
562
$ ch = false ;
@@ -601,19 +601,19 @@ public function oauth2_token()
601
601
switch ($ this ->_return_format ) {
602
602
case CODEBIRD_RETURNFORMAT_ARRAY :
603
603
$ reply ['httpstatus ' ] = $ httpstatus ;
604
- if ($ httpstatus == 200 ) {
604
+ if ($ httpstatus === 200 ) {
605
605
self ::setBearerToken ($ reply ['access_token ' ]);
606
606
}
607
607
break ;
608
608
case CODEBIRD_RETURNFORMAT_JSON :
609
- if ($ httpstatus == 200 ) {
609
+ if ($ httpstatus === 200 ) {
610
610
$ parsed = json_decode ($ reply );
611
611
self ::setBearerToken ($ parsed ->access_token );
612
612
}
613
613
break ;
614
614
case CODEBIRD_RETURNFORMAT_OBJECT :
615
615
$ reply ->httpstatus = $ httpstatus ;
616
- if ($ httpstatus == 200 ) {
616
+ if ($ httpstatus === 200 ) {
617
617
self ::setBearerToken ($ reply ->access_token );
618
618
}
619
619
break ;
@@ -669,7 +669,7 @@ private function _url($data)
669
669
*/
670
670
private function _sha1 ($ data )
671
671
{
672
- if (self ::$ _oauth_consumer_secret == null ) {
672
+ if (self ::$ _oauth_consumer_secret === null ) {
673
673
throw new \Exception ('To generate a hash, the consumer secret must be set. ' );
674
674
}
675
675
if (!function_exists ('hash_hmac ' )) {
@@ -705,7 +705,7 @@ protected function _nonce($length = 8)
705
705
*/
706
706
protected function _sign ($ httpmethod , $ method , $ params = array ())
707
707
{
708
- if (self ::$ _oauth_consumer_key == null ) {
708
+ if (self ::$ _oauth_consumer_key === null ) {
709
709
throw new \Exception ('To generate a signature, the consumer key must be set. ' );
710
710
}
711
711
$ sign_params = array (
0 commit comments