-
Notifications
You must be signed in to change notification settings - Fork 199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow to update the app id/secret #92
Changes from 4 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
<?php namespace SammyK\LaravelFacebookSdk; | ||
|
||
use Facebook\Facebook; | ||
use Illuminate\Config\Repository as Config; | ||
use Illuminate\Routing\UrlGenerator as Url; | ||
use Facebook\Facebook; | ||
|
||
class LaravelFacebookSdk extends Facebook | ||
{ | ||
|
@@ -24,11 +24,22 @@ class LaravelFacebookSdk extends Facebook | |
public function __construct(Config $config_handler, Url $url, array $config) | ||
{ | ||
$this->config_handler = $config_handler; | ||
$this->url = $url; | ||
$this->url = $url; | ||
$this->default_config = $config; | ||
|
||
parent::__construct($config); | ||
} | ||
|
||
/** | ||
* @param array $config | ||
*/ | ||
public function newInstance(array $config) | ||
{ | ||
$new_config = array_merge($this->default_config, $config); | ||
|
||
return new static($this->config_handler, $this->url, $config); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should be passing in |
||
} | ||
|
||
/** | ||
* Generate an OAuth 2.0 authorization URL for authentication. | ||
* | ||
|
@@ -39,7 +50,7 @@ public function __construct(Config $config_handler, Url $url, array $config) | |
*/ | ||
public function getLoginUrl(array $scope = [], $callback_url = '') | ||
{ | ||
$scope = $this->getScope($scope); | ||
$scope = $this->getScope($scope); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No extra spaces here. |
||
$callback_url = $this->getCallbackUrl($callback_url); | ||
|
||
return $this->getRedirectLoginHelper()->getLoginUrl($callback_url, $scope); | ||
|
@@ -55,7 +66,7 @@ public function getLoginUrl(array $scope = [], $callback_url = '') | |
*/ | ||
public function getReRequestUrl(array $scope, $callback_url = '') | ||
{ | ||
$scope = $this->getScope($scope); | ||
$scope = $this->getScope($scope); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here |
||
$callback_url = $this->getCallbackUrl($callback_url); | ||
|
||
return $this->getRedirectLoginHelper()->getReRequestUrl($callback_url, $scope); | ||
|
@@ -71,7 +82,7 @@ public function getReRequestUrl(array $scope, $callback_url = '') | |
*/ | ||
public function getReAuthenticationUrl(array $scope = [], $callback_url = '') | ||
{ | ||
$scope = $this->getScope($scope); | ||
$scope = $this->getScope($scope); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And here. :) |
||
$callback_url = $this->getCallbackUrl($callback_url); | ||
|
||
return $this->getRedirectLoginHelper()->getReAuthenticationUrl($callback_url, $scope); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No extra spaces between the variable and the
=
here to align it. It makes diffs harder to read.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops