/** * Creates the property. * * The 'type' argument must be one of the type constants defined in this class. * * 'href' is only required for the HREF type. * * @param int $type * @param string|null $href */ function __construct($type, $href = null) { $this->type = $type; if ($type === self::HREF && is_null($href)) { throw new DAV\Exception('The href argument must be specified for the HREF principal type.'); } if ($href) { $href = rtrim($href, '/') . '/'; parent::__construct($href); } }
/** * Constructor * * You must either pass a string for a single href, or an array of hrefs. * * If auto-prefix is set to false, the hrefs will be treated as absolute * and not relative to the servers base uri. * * @param string|string[] $href */ function __construct($hrefs) { parent::__construct(array_map(function ($href) { return \Sabre\HTTP\encodePath($href); }, (array) $hrefs)); }