Completed
Pull Request — develop (#89)
by Patrick
11:08 queued 08:06
created

Http/class.LoginRequiredPage.php (4 issues)

Labels
Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
namespace Http;
3
/**
4
 * A WebPage class that requires login to view
5
 *
6
 * This file describes an abstraction for creating a webpage with JQuery, Bootstrap,
7
 * and other framework specific abilities that requires a login
8
 *
9
 * PHP version 5 and 7
10
 *
11
 * @author Patrick Boyd / [email protected]
12
 * @copyright Copyright (c) 2017, Austin Artistic Reconstruction
13
 * @license http://www.apache.org/licenses/ Apache 2.0 License
14
 */
15
16
/**
17
 * A webpage abstraction for login required pages
18
 *
19
 * This class adds a login requirement to FlipPage
20
 */
21
class LoginRequiredPage extends WebPage
22
{
23
    protected function getContent()
24
    {
25
        if($this->user === false || $this->user === null)
0 ignored issues
show
The property user does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
26
        {
27
          $this->content['body'] = '
0 ignored issues
show
The property content does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
28
            <div id="content">
29
              <div class="row">
30
                <div class="col-lg-12">
31
                  <h1 class="page-header">You must <a href="'.$this->loginUrl.'?return='.$this->currentUrl().'">log in <span class="fa fa-sign-in"></span></a> to access the '.$this->content['pageTitle'].' system!</h1>
0 ignored issues
show
The property loginUrl does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
32
                </div>
33
              </div>
34
            </div>
35
          ';
36
        }
37
        else if(!isset($this->content['body']))
38
        {
39
          $this->content['body'] = $this->body;
40
        }
41
        return $this->twig->render($this->templateName, $this->content);
0 ignored issues
show
The property twig does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
42
    }
43
}
44
/* vim: set tabstop=4 shiftwidth=4 expandtab: */
45