Skip to content

Commit

Permalink
PHP 8.2 compatibility (#7147)
Browse files Browse the repository at this point in the history
Co-authored-by: Ante Laca <[email protected]>
  • Loading branch information
alaca authored Dec 23, 2023
1 parent 4455965 commit 179d6c4
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 5 deletions.
12 changes: 12 additions & 0 deletions give.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,18 @@ final class Give
*/
public $stripe;

/**
* @var Give_DB_Customers
* @deprecated use give()->donors instead
*/
public $customers;

/**
* @var Give_DB_Customer_Meta
* @deprecated use give()->donor_meta instead
*/
public $customer_meta;

/**
* @since 2.8.0
*
Expand Down
1 change: 1 addition & 0 deletions includes/admin/abstract-admin-settings-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
*
* @sine 1.8
*/
#[\AllowDynamicProperties]
class Give_Settings_Page {

/**
Expand Down
1 change: 1 addition & 0 deletions includes/class-give-donate-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
* @property $earnings
* @property $post_type
*/
#[\AllowDynamicProperties]
class Give_Donate_Form {

/**
Expand Down
1 change: 1 addition & 0 deletions includes/class-give-donor.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
*
* @since 1.0
*/
#[\AllowDynamicProperties]
class Give_Donor {

/**
Expand Down
1 change: 1 addition & 0 deletions src/Donors/Repositories/DonorRepositoryProxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*
* @throws InvalidArgumentException
*/
#[\AllowDynamicProperties]
class DonorRepositoryProxy
{
const SHARED_METHODS = ['insert', 'update', 'delete'];
Expand Down
1 change: 1 addition & 0 deletions src/Framework/FieldsAPI/Option.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public function getValue()
/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
return [
Expand Down
9 changes: 6 additions & 3 deletions src/Framework/QueryBuilder/Clauses/From.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@ class From
public $alias;

/**
* @param string|RawSQL $table
* @param string|null $alias
* @param string|RawSQL $table
* @param string|null $alias
*/
public function __construct($table, $alias = null)
{
$this->table = QueryBuilder::prefixTable($table);
$this->alias = trim($alias);

if ( ! is_null($alias)) {
$this->alias = trim($alias);
}
}
}
5 changes: 4 additions & 1 deletion src/Framework/QueryBuilder/Clauses/Join.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ public function __construct($joinType, $table, $alias = null)
{
$this->table = QueryBuilder::prefixTable($table);
$this->joinType = $this->getJoinType($joinType);
$this->alias = trim($alias);

if ( ! is_null($alias)) {
$this->alias = trim($alias);
}
}

/**
Expand Down
5 changes: 4 additions & 1 deletion src/Framework/QueryBuilder/Clauses/Select.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ class Select
public function __construct($column, $alias = null)
{
$this->column = trim($column);
$this->alias = trim($alias);

if ( ! is_null($alias)) {
$this->alias = trim($alias);
}
}
}

0 comments on commit 179d6c4

Please sign in to comment.