![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/cartforge.co/vendor/braintree/braintree_php/lib/Braintree/ |
<?php namespace Braintree; use InvalidArgumentException; /** * Braintree MultipleValueNode * MultipleValueNode is an object for elements with possible values returned from the Braintree API */ class MultipleValueNode { public $name; public $items; public $allowedValues; // phpcs:ignore PEAR.Commenting.FunctionComment.Missing public function __construct($name, $allowedValues = []) { $this->name = $name; $this->items = []; $this->allowedValues = $allowedValues; } /** * Sets the value of the object's items key to $values * * @param array $values to be set * * @throws InvalidArgumentException * * @return object */ public function in($values) { $bad_values = array_diff($values, $this->allowedValues); if (count($this->allowedValues) > 0 && count($bad_values) > 0) { $message = 'Invalid argument(s) for ' . $this->name . ':'; foreach ($bad_values as $bad_value) { $message .= ' ' . $bad_value; } throw new InvalidArgumentException($message); } $this->items = $values; return $this; } /** * Sets the value of the object's items key to [$value] * * @param object $value to be set * * @return object */ public function is($value) { return $this->in([$value]); } /** * Retrieves items(params) from the object * * @return object */ public function toParam() { return $this->items; } }