Issues (4)

controllers/Controller.php (2 issues)

1
<?php
2
use Windwalker\Renderer\BladeRenderer;
3
4
class Controller
5
{
6
	private $renderer;
7
8
	/**
9
	 * Loading the default blade
10
	 * rendered
11
	 * @author Akshay Khale
12
	 * @param Array $paths       Array of default Directories
13
	 * @param Array $cache_path  Array of Cache Path
14
	 */
15
	function __construct($paths, $cache_path)
16
	{
17
		$this->renderer = new BladeRenderer($paths, $cache_path);
0 ignored issues
show
$paths of type array is incompatible with the type SplPriorityQueue expected by parameter $paths of Windwalker\Renderer\BladeRenderer::__construct(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

17
		$this->renderer = new BladeRenderer(/** @scrutinizer ignore-type */ $paths, $cache_path);
Loading history...
18
	}
19
20
	/**
21
	 * Index method which gets loaded
22
	 * on default URL
23
	 * @return String 	HTML Content of the Page
24
	 */
25
	public function index()
26
	{
27
		return $this->renderer->render(sayHello(), []);
28
	}
29
30
	/**
31
	 * This function returns default
32
	 * 404 Error Page
33
	 * @return View Renders view on Browser window
34
	 */
35
	public function notFound()
36
	{
37
		return $this->renderer->render('errors.404', []);
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->renderer->...('errors.404', array()) returns the type string which is incompatible with the documented return type View.
Loading history...
38
	}
39
40
	/**
41
	 * About page which gets loaded
42
	 * on <host_name>/about URL
43
	 * @return String 	HTML Content of the Page
44
	 */
45
	public function about()
46
	{
47
		return $this->renderer->render('about', []);
48
	}
49
}
50