Skip to content
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

Fix session app ID and app secret nullability #602

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/FacebookAds/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ public function __construct(
}

/**
* @param string $app_id
* @param string $app_secret
* @param string|null $app_id
* @param string|null $app_secret
* @param string $access_token
* @return static
*/
Expand Down
6 changes: 5 additions & 1 deletion src/FacebookAds/CrashReporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@ public static function enable() {
if ($api == null) {
self::log('Could not initialize API' . PHP_EOL);
}
static::$instance = new static($api->getSession()->getAppId());
$appId = $api->getSession()->getAppId();
if ($appId == null) {
self::log('Missing session app ID' . PHP_EOL);
}
static::$instance = new static($appId);
static::$instance->registerExceptionHandler();
self::log('Enabled' . PHP_EOL);
}
Expand Down
12 changes: 6 additions & 6 deletions src/FacebookAds/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
class Session implements SessionInterface {

/**
* @var string
* @var string|null
*/
protected $appId;

/**
* @var string
* @var string|null
*/
protected $appSecret;

Expand All @@ -32,8 +32,8 @@ class Session implements SessionInterface {
protected $appSecretProof;

/**
* @param string $app_id
* @param string $app_secret
* @param string|null $app_id
* @param string|null $app_secret
* @param string $access_token
*/
public function __construct($app_id, $app_secret, $access_token) {
Expand All @@ -43,14 +43,14 @@ public function __construct($app_id, $app_secret, $access_token) {
}

/**
* @return string
* @return string|null
*/
public function getAppId() {
return $this->appId;
}

/**
* @return string
* @return string|null
*/
public function getAppSecret() {
return $this->appSecret;
Expand Down
Loading