Page MenuHomeIn-Portal Phabricator

QAToolsUrlBuilder.php
No OneTemporary

File Metadata

Created
Wed, Oct 8, 10:38 AM

QAToolsUrlBuilder.php

<?php
/**
* @version $Id: QAToolsUrlBuilder.php 16761 2023-11-15 11:29:03Z alex $
* @package In-Portal
* @copyright Copyright (C) 1997 - 2023 Intechnic. All rights reserved.
* @license GNU/GPL
* In-Portal is Open Source software.
* This means that this software may have been modified pursuant
* the GNU General Public License, and as distributed it includes
* or is derivative of works licensed under the GNU General Public License
* or other free or open source software licenses.
* See http://www.in-portal.org/license for copyright notices and details.
*/
use QATools\QATools\PageObject\Exception\UrlException;
use QATools\QATools\PageObject\Url\IBuilder;
final class QAToolsUrlBuilder extends kBase implements IBuilder
{
/**
* Template.
*
* @var string
*/
protected $template = '';
/**
* Params.
*
* @var array
*/
protected $params = array();
/**
* Constructor for the url builder.
*
* @param array $components The url components.
*
* @throws UrlException When the path is missing.
*/
public function __construct(array $components)
{
parent::__construct();
if ( empty($components['path']) ) {
throw new UrlException('No base url specified', UrlException::TYPE_INVALID_URL);
}
$this->template = $components['path'];
if ( !empty($components['query']) ) {
parse_str($components['query'], $this->params);
}
}
/**
* @inheritDoc
*/
public function build(array $params = array())
{
return $this->Application->HREF($this->template, '', array_merge($this->params, $params));
}
}

Event Timeline