TimberRoutes::init()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
class TimberRoutes {
4
5
	/**
6
	 * @deprecated since 0.21.1 use Upstatement/routes instead
7
	 */
8
	public static function init( $timber ) {
9
		// Install ourselves in Timber
10
		$timber->routes = new TimberRoutes();
11
	}
12
13
	/**
14
	 * @param string $route
15
	 * @param callable $callback
16
	 * @deprecated since 0.21.1 use Upstatement/routes instead
17
	 */
18
	public static function add_route($route, $callback, $args = array()) {
19
		Routes::map($route, $callback, $args);
20
	}
21
22
	/**
23
	 * @param array $template
24
	 * @param mixed $query
25
	 * @param int $status_code
26
	 * @param bool $tparams
27
	 * @return bool
0 ignored issues
show
Documentation introduced by
Should the return type not be boolean|null?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
28
	 * @deprecated since 0.21.1 use Upstatement/routes instead
29
	 */
30
	public static function load_view($template, $query = false, $status_code = 200, $tparams = false) {
31
		Routes::load($template, $tparams, $query, $status_code);
32
	}
33
}
34