| Server IP : 93.86.61.54 / Your IP : 216.73.216.60 Web Server : Apache/2.4.62 (Ubuntu) System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64 User : www-data ( 33) PHP Version : 8.4.22 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/html/projects/nextcloud/3rdparty/punic/punic/code/Exception/ |
Upload File : |
<?php
namespace Punic\Exception;
/**
* An exception raised when a function meets an argument of an unsupported type.
*/
class ValueNotInList extends \Punic\Exception
{
protected $value;
protected $allowedValues;
/**
* Initializes the instance.
*
* @param string|numeric $value The invalid value
* @param array<string|numeric> $allowedValues The list of valid values
* @param \Exception $previous The previous exception used for the exception chaining
*/
public function __construct($value, $allowedValues, $previous = null)
{
$this->value = $value;
$this->allowedValues = $allowedValues;
$message = "'$value' is not valid. Acceptable values are: '".implode("', '", $allowedValues)."'";
parent::__construct($message, \Punic\Exception::VALUE_NOT_IN_LIST, $previous);
}
/**
* Retrieves the invalid value.
*
* @return mixed
*/
public function getValue()
{
return $this->value;
}
/**
* Retrieves the list of valid values.
*
* @return array<string|numeric>
*/
public function getAllowedValues()
{
return $this->allowedValues;
}
}