Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

Commit

Permalink
change to class constants
Browse files Browse the repository at this point in the history
  • Loading branch information
0aveRyan committed Aug 2, 2022
1 parent f490c2f commit 7147336
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions includes/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,35 +15,35 @@ class Customer {
*
* @var string
*/
private static $transient = 'bh_cdata';
private const TRANSIENT = 'bh_cdata';

/**
* Provided option.
*
* @var string
*/
private static $provided_guapi = 'bh_cdata_guapi';
private const PROVIDED_GUAPI = 'bh_cdata_guapi';

/**
* Provided option.
*
* @var string
*/
private static $provided_mole = 'bh_cdata_mole';
private const PROVIDED_MOLE = 'bh_cdata_mole';

/**
* Prepare customer data
*
* @return array of customer data
*/
public static function collect() {
$bh_cdata = Transient::get( self::$transient );
$bh_cdata = Transient::get( self::TRANSIENT );

if ( ! $bh_cdata ) {
$guapi = self::get_account_info();
$mole = array( 'meta' => self::get_onboarding_info() );
$bh_cdata = array_merge( $guapi, $mole );
Transient::set( self::$transient, $bh_cdata, WEEK_IN_SECONDS );
Transient::set( self::TRANSIENT, $bh_cdata, WEEK_IN_SECONDS );
}

return $bh_cdata;
Expand Down Expand Up @@ -85,9 +85,9 @@ public static function provided( $path ) {
private static function get_cdata_key_by_path( $path ) {
switch( $path ) {
case '/hosting-account-info':
return self::$provided_guapi;
return self::PROVIDED_GUAPI;
case '/onboarding-info':
return self::$provided_mole;
return self::PROVIDED_MOLE;
}
}

Expand Down

0 comments on commit 7147336

Please sign in to comment.