for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Nip\View;
use Nip\View;
/**
* Class XLS
* @package Nip\View
*/
class XLS extends View
{
* Singleton
*
* @return self
public static function instance()
static $instance;
if (!($instance instanceof self)) {
$instance = new self();
}
return $instance;
public function initBasePath()
$this->setBasePath(MODULES_PATH . request()->getModuleName() . '/views/');
request
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
ignore-call
$this->setBasePath(MODULES_PATH . /** @scrutinizer ignore-call */ request()->getModuleName() . '/views/');
Nip\View\MODULES_PATH
* @param $view
* @param $name
public function output($view, $name)
header("Content-type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=\"$name\"");
header("Cache-Control: private, max-age=1, pre-check=1", true);
header("Pragma: none", true);
echo $this->load($view);
exit();
exit
In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.