Controller::beforeRender()   A
last analyzed

Complexity

Conditions 2
Paths 1

Size

Total Lines 22
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 22
rs 9.2
c 0
b 0
f 0
cc 2
eloc 16
nc 1
nop 1
1
<?php
2
class Controller extends CController
3
{
4
    public $layout='//layouts/column1';
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 6 spaces but found 0 spaces

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
5
    public $menu=array();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 8 spaces but found 0 spaces

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
6
    public $breadcrumbs=array();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 1 space but found 0 spaces

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
7
    public $contentClass;
8
9
    public function beforeRender($view)
10
    {
11
        $cs = Yii::app()->getClientScript();
12
        $cs->registerCoreScript('jquery');
13
        $cs->registerScriptFile(Yii::app()->request->baseUrl . '/js/jquery.countdown.min.js', CClientScript::POS_HEAD);
14
        $cs->registerScriptFile(Yii::app()->request->baseUrl . '/js/fish.js', CClientScript::POS_HEAD);
15
        $cs->registerScriptFile(Yii::app()->request->baseUrl . '/js/jquery.mobile-1.3.2.min.js', CClientScript::POS_HEAD);
16
        $cs->registerScript(
17
            'vars',
18
            'var justAdvanced = ' . (Yii::app()->player->model->justAdvanced?'true':'false') . ';
19
            var refillTime = ' . Yii::app()->player->model->remainingTimeToRefill . ';
20
            var rpi = ' .  Yii::app()->player->model->refillPerInterval . '; ',
21
            CClientScript::POS_HEAD
22
        );
23
24
        //CSS
25
        $cs->registerCssFile(Yii::app()->request->baseUrl . '/css/themes/brown.css');
26
        $cs->registerCssFile(Yii::app()->request->baseUrl . '/css/jquery.mobile.structure-1.3.2.min.css');
27
        $cs->registerCssFile(Yii::app()->request->baseUrl . '/css/game.css?4');
28
29
        return true;
30
    }
31
}
0 ignored issues
show
Coding Style introduced by
As per coding style, files should not end with a newline character.

This check marks files that end in a newline character, i.e. an empy line.

Loading history...
32