Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure you want to rename?
SAFE MODE
/
application
/
vendor
/
braintree
/
braintree_php
/
lib
/
Braintree
:
MultipleValueNode.php
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?php namespace Braintree; use InvalidArgumentException; class MultipleValueNode { public function __construct($name, $allowedValues = []) { $this->name = $name; $this->items = []; $this->allowedValues = $allowedValues; } 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; } public function is($value) { return $this->in([$value]); } public function toParam() { return $this->items; } }