PayPal\Core\PayPalHttpConfig::getHttpConstantsFromConfigs PHP Method

getHttpConstantsFromConfigs() public method

Retrieves an array of constant key, and value based on Prefix
public getHttpConstantsFromConfigs ( array $configs = [], $prefix ) : array
$configs array
$prefix
return array
    public function getHttpConstantsFromConfigs($configs = array(), $prefix)
    {
        $arr = array();
        if ($prefix != null && is_array($configs)) {
            foreach ($configs as $k => $v) {
                // Check if it startsWith
                if (substr($k, 0, strlen($prefix)) === $prefix) {
                    $newKey = ltrim($k, $prefix);
                    if (defined($newKey)) {
                        $arr[constant($newKey)] = $v;
                    }
                }
            }
        }
        return $arr;
    }