/** * @param resource $value * @param int $flag A flag used by the `ValueType::getType()` method (not used here) * @throws \ReflectionException if the parameter is not a resource */ public function __construct($value, $flag = ValueType::MODE_STRICT) { if (!ValueType::isResource($value)) { throw new \ReflectionException(sprintf(__METHOD__ . ' expects parameter one to be resource, %s given', gettype($value))); } $this->setReadOnlyProperties($this::$_read_only); $this->type = ValueType::TYPE_RESOURCE; $this->value = $value; $this->resource_type = get_resource_type($value); }