Access to an undefined property Flux_StripeNotifyRequest::$webhookSecret
99 $this->txnTable = Flux::config('FluxTables.StripeTransactions');
100 $this->txnLogTable = Flux::config('FluxTables.StripeTransactionLogTable');
101 $this->myCurrencyCode = strtoupper(Flux::config('DonationCurrency'));
102 $this->webhookSecret = Flux::config('StripeWebhookSecret');103 $this->sigHeader = $_SERVER['HTTP_STRIPE_SIGNATURE'];
104 $this->payload = @file_get_contents("php://input");
105 }
Access to an undefined property Flux_StripeNotifyRequest::$logStripe
94 public function __construct(Flux_Athena $server)
95 {
96 $this->server = $server;
97 $this->logStripe = new Flux_LogFile(FLUX_DATA_DIR.'/logs/stripe.log'); 98 $this->creditsTable = Flux::config('FluxTables.CreditsTable');
99 $this->txnTable = Flux::config('FluxTables.StripeTransactions');
100 $this->txnLogTable = Flux::config('FluxTables.StripeTransactionLogTable');
Description
This issue is raised when an attempt is made to access an undefined property. This may not have been intended, and it is advisable to give the code another look to make sure the property is defined in the scope it is used in.
Bad practice
class User
{
private string $firstName = 'John';
public function getFirstName(): void
{
return $this->firstName;
}
public function getLastName(): void
{
return $this->lastName; // invalid: property "lastName" is not defined
}
}
Recommended
class User
{
private string $firstName = 'John';
private string $lastName = 'Doe';
public function getFirstName(): void
{
return $this->firstName;
}
public function getLastName(): void
{
return $this->lastName;
}
}