Passed
Push — main ( d2a286...efe307 )
by Nelson
02:44
created

update()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 5
rs 10
1
<?php
2
3
4
function page_initializer()
5
{
6
	if (Session::get("is_logged_in") !== true) {
7
		//ir a la pagina inicial
8
		Session::set("flash", "Debe iniciar sesión para acceder al recurso *<i>page</i>*");
9
		return redirect_to("");
0 ignored issues
show
Bug introduced by
Are you sure the usage of redirect_to('') is correct as it seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
10
	}
11
}
12
13
function show($slug = '')
14
{
15
	$template = new Template();
16
	$template->slug = $slug;
0 ignored issues
show
Bug Best Practice introduced by
The property slug does not exist on Template. Since you implemented __set, consider adding a @property annotation.
Loading history...
17
	$template->render("page/show");
18
}
19
20
function edit()
21
{
22
	$template = new Template();
23
	$template->render("page/edit");	
24
}
25
26
function update()
27
{
28
	$template = new Template();
29
	Session::set("flash", "Página actualizada correctamente");
30
	$template->render("page/edit");	
31
}
32
33
34
35