mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2025-12-24 08:39:34 -05:00
- This helps the IDE to find class methods and resolves the `call to an undefined method` issue
28 lines
542 B
PHP
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();
|
|
}
|
|
}
|