icingaweb2-module-businessp.../library/Businessprocess/Web/Url.php
Sukhwinder Dhillon 6306b5306c Define variable type when method returns a class object
- This helps the IDE to find class methods and resolves the `call to an undefined method` issue
2023-08-24 13:04:29 +02:00

28 lines
542 B
PHP

<?php
namespace Icinga\Module\Businessprocess\Web;
use Icinga\Application\Icinga;
use Icinga\Application\Web;
use Icinga\Web\Url as WebUrl;
/**
* Class Url
*
* The main purpose of this class is to get unit tests running on CLI
*
* @package Icinga\Module\Businessprocess\Web
*/
class Url extends WebUrl
{
protected static function getRequest()
{
$app = Icinga::app();
if ($app->isCli()) {
return new FakeRequest();
}
/** @var Web $app */
return $app->getRequest();
}
}