composer package updates
[openemr.git] / vendor / zendframework / zend-serializer / src / Adapter / PhpSerializeOptions.php
blobc6133b615baff1fddec9026e39d46052f82ea421
1 <?php
2 /**
3 * @see https://github.com/zendframework/zend-serializer for the canonical source repository
4 * @copyright Copyright (c) 2018 Zend Technologies USA Inc. (https://www.zend.com)
5 * @license https://github.com/zendframework/zend-serializer/blob/master/LICENSE.md New BSD License
6 */
8 namespace Zend\Serializer\Adapter;
10 use Zend\Json\Json as ZendJson;
11 use Zend\Serializer\Exception;
13 class PhpSerializeOptions extends AdapterOptions
15 /**
16 * The list of allowed classes for unserialization (PHP 7.0+).
18 * Possible values:
20 * - `array` of class names that are allowed to be unserialized
21 * - `true` if all classes should be allowed (behavior pre-PHP 7.0)
22 * - `false` if no classes should be allowed
24 * @var string[]|bool
26 protected $unserializeClassWhitelist = true;
28 /**
29 * @param string[]|bool $unserializeClassWhitelist
30 * @return void
32 public function setUnserializeClassWhitelist($unserializeClassWhitelist)
34 if ($unserializeClassWhitelist !== true && PHP_MAJOR_VERSION < 7) {
35 throw new Exception\InvalidArgumentException(
36 'Class whitelist for unserialize() is only available on PHP versions 7.0 or higher.'
40 $this->unserializeClassWhitelist = $unserializeClassWhitelist;
43 /**
44 * @return string[]|bool
46 public function getUnserializeClassWhitelist()
48 return $this->unserializeClassWhitelist;