Test Failed
Push — master ( 0ec979...014002 )
by Federico
01:54
created
dist/jate/modules/Parsedown/Parsedown.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -6,13 +6,13 @@
 block discarded – undo
6 6
     public function __construct() {
7 7
       parent::__construct();
8 8
     }
9
-    public function drawFile( $_template ) {
9
+    public function drawFile($_template) {
10 10
       return $this->draw($_template);
11 11
     }
12
-    public function drawText( $_template ) {
12
+    public function drawText($_template) {
13 13
       return $this->draw(trim($_template));
14 14
     }
15
-    public function draw( $_template ) {
15
+    public function draw($_template) {
16 16
       $Parsedown = new Parsedown\Parsedown();
17 17
       $page = $Parsedown->text($_template);
18 18
       return $page;
Please login to merge, or discard this patch.
dist/jate/modules/Statistic/Statistic.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,17 +1,17 @@
 block discarded – undo
1 1
 <?php
2 2
   jRequire("../Module/Module.php");
3 3
   class Statistic extends Module {
4
-    public function __construct( $_webApp ) {
4
+    public function __construct($_webApp) {
5 5
       parent::__construct();
6 6
       $pages = [];
7 7
       $stats = [];
8 8
       $pages = $_webApp->pages;
9
-      foreach ( $pages as $k => $v ) {
9
+      foreach ($pages as $k => $v) {
10 10
         $temp = new $v[0]($v[1]);
11 11
         $temp->addDipendences();
12 12
         $stats[$k] = [];
13 13
         $stats[$k]["page"]  = $v[0];
14
-        $stats[$k]["css"]    = $temp->data["css"];
14
+        $stats[$k]["css"] = $temp->data["css"];
15 15
         $stats[$k]["js"]    = $temp->data["js"];
16 16
       }
17 17
       $this->data = $stats;
Please login to merge, or discard this patch.
dist/jate/modules/WebApp/WebApp.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -8,49 +8,49 @@  discard block
 block discarded – undo
8 8
     public function __construct() {
9 9
       parent::__construct();
10 10
       $this->pages = [];
11
-      $this->defaultPage = ["Page404",[]];
11
+      $this->defaultPage = ["Page404", []];
12 12
       $this->currentPage = null;
13 13
       $this->jConfig     = null;
14 14
     }
15
-    public function addPage( $_page ) {
15
+    public function addPage($_page) {
16 16
       $param = [];
17 17
       $path  = $_page;
18 18
       $class = $_page;
19
-      if(is_array($_page)) {
19
+      if (is_array($_page)) {
20 20
         $path  = $_page[0];
21 21
         $class = $_page[1];
22
-        if(isset($_page[2]))
22
+        if (isset($_page[2]))
23 23
           $param = $_page[2];
24 24
       }
25 25
       $this->pages[$path] = [$class, $param];
26 26
       return $this->pages[$path];
27 27
     }
28
-    public function addPages( $_pages ) {
28
+    public function addPages($_pages) {
29 29
       foreach ($_pages as $i)
30 30
         $this->addPage($i);
31 31
     }
32 32
     public function fetchPage() {
33 33
       $router = new Router();
34
-      $router->parameters = [ "app" => &$this->jConfig, "page" => null];
34
+      $router->parameters = ["app" => &$this->jConfig, "page" => null];
35 35
       $stack = $router->getPage();
36 36
       $parameters = [];
37 37
       $temp = $this->defaultPage;
38 38
       foreach ($this->pages as $key => $value) {
39 39
         $variables = $this->pathSeeker(explode("/", $key), $stack);
40
-        if(is_array($variables)) {
40
+        if (is_array($variables)) {
41 41
           $temp = $value;
42 42
           $parameters = $variables;
43 43
           break;
44 44
         }
45 45
       }
46
-      if( isset($temp[1]) && is_array($temp[1]) )
46
+      if (isset($temp[1]) && is_array($temp[1]))
47 47
         $temp[1] = array_merge($temp[1], $parameters);
48 48
       else
49 49
         $temp[1] = $parameters;
50 50
       $this->currentPage = new $temp[0](["app" => $this->jConfig, "page" => $temp[1]]);
51 51
       return $this->currentPage;
52 52
     }
53
-    public function setDefaultPage( $_page ) {
53
+    public function setDefaultPage($_page) {
54 54
       $this->defaultPage = $this->addPage($_page);
55 55
     }
56 56
     public function draw() {
@@ -59,30 +59,30 @@  discard block
 block discarded – undo
59 59
       $gui->init($this->currentPage);
60 60
       $gui->draw($this->currentPage->data["template"]);
61 61
     }
62
-    public function pathSeeker( $_path, $_url ) {
62
+    public function pathSeeker($_path, $_url) {
63 63
       $urlLength = count($_url);
64 64
       $cont = 0;
65 65
       $variables = [];
66 66
       $pathLength = count($_path);
67
-      if($urlLength == $pathLength) {
68
-        while($cont < $urlLength) {
69
-          if(
67
+      if ($urlLength == $pathLength) {
68
+        while ($cont < $urlLength) {
69
+          if (
70 70
             ($this->jConfig->urlCaseSensitive && $_path[$cont] == $_url[$cont]) ||
71 71
             (!$this->jConfig->urlCaseSensitive && strtolower($_path[$cont]) == strtolower($_url[$cont])) )
72 72
             $cont++;
73
-          else if( strpos($_path[$cont], "\$") !== false ) {
73
+          else if (strpos($_path[$cont], "\$") !== false) {
74 74
             $variables[str_replace('$', "", $_path[$cont])] = $_url[$cont];
75 75
             $cont++;
76 76
           } else break;
77 77
         }
78
-        if($cont == $urlLength)
78
+        if ($cont == $urlLength)
79 79
           return $variables;
80 80
       }
81 81
       return null;
82 82
     }
83
-    public function newConfig( $_path = "config/") {
83
+    public function newConfig($_path = "config/") {
84 84
       $this->jConfig = new JConfig();
85
-      $this->jConfig->import("${_path}connection.json","connection");
85
+      $this->jConfig->import("${_path}connection.json", "connection");
86 86
       $this->jConfig->import("${_path}misc.json");
87 87
       $this->jConfig->import("${_path}router.json");
88 88
     }
Please login to merge, or discard this patch.
dist/jate/modules/Module/Module.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -22,56 +22,56 @@  discard block
 block discarded – undo
22 22
     // abstract public function init();
23 23
     // abstract public function draw();
24 24
     public function getCss() {
25
-      return $this->getRequire("getCss",".css");
25
+      return $this->getRequire("getCss", ".css");
26 26
     }
27 27
     public function getJs() {
28
-      return $this->getRequire("getJs",".js");
28
+      return $this->getRequire("getJs", ".js");
29 29
     }
30 30
     public function getJsVariables() {
31 31
       $temp = [];
32 32
       foreach ($this->required as $i)
33 33
         if (is_array($i))
34
-          array_push($temp,$i);
34
+          array_push($temp, $i);
35 35
       foreach ($this->modules as $i)
36
-        $temp = array_merge( $temp, $i->getJsVariables() );
36
+        $temp = array_merge($temp, $i->getJsVariables());
37 37
       foreach ($this->files as $i)
38 38
         if (is_array($i))
39
-          array_push($temp,$i);
39
+          array_push($temp, $i);
40 40
       return $temp;
41 41
     }
42
-    public function addModules( $_mods ) {
43
-      if(!is_array($_mods))
42
+    public function addModules($_mods) {
43
+      if (!is_array($_mods))
44 44
         throw new InvalidArgumentException("Parameter must be an array.");
45 45
       foreach ($_mods as $value)
46 46
         $this->addModule($value);
47 47
     }
48
-    public function addModule( $_mod ) {
49
-      if(!is_object($_mod))
48
+    public function addModule($_mod) {
49
+      if (!is_object($_mod))
50 50
         throw new InvalidArgumentException("Parameter must be a class.");
51
-      if(! is_subclass_of ($_mod, "Module"))
51
+      if (!is_subclass_of($_mod, "Module"))
52 52
         throw new InvalidArgumentException("Parameter must be a class.");
53 53
       $this->modules[$_mod->name] = $_mod;
54 54
       $this->modules[$_mod->name]->parameters = &$this->parameters;
55 55
     }
56
-    public function addFiles( $_files ) {
57
-      if(!is_array($_files))
56
+    public function addFiles($_files) {
57
+      if (!is_array($_files))
58 58
         throw new InvalidArgumentException("Parameter must be an array.");
59 59
       foreach ($_files as $value)
60 60
         $this->addFile($value);
61 61
     }
62
-    public function addFile( $_file ) {
63
-      if(!(is_string($_file) || is_array($_file)))
62
+    public function addFile($_file) {
63
+      if (!(is_string($_file) || is_array($_file)))
64 64
         throw new InvalidArgumentException("Parameter must be a string or an array.");
65 65
       array_push($this->files, $_file);
66 66
     }
67
-    public function addFilesRequired( $_files ) {
68
-      if(!is_array($_files))
67
+    public function addFilesRequired($_files) {
68
+      if (!is_array($_files))
69 69
         throw new InvalidArgumentException("Parameter must be an array.");
70 70
       foreach ($_files as $value)
71 71
         $this->addFileRequired($value);
72 72
     }
73
-    public function addFileRequired( $_file ) {
74
-      if(!is_string($_file))
73
+    public function addFileRequired($_file) {
74
+      if (!is_string($_file))
75 75
         throw new InvalidArgumentException("Parameter must be a string.");
76 76
       array_push($this->required, $_file);
77 77
     }
@@ -80,16 +80,16 @@  discard block
 block discarded – undo
80 80
       $this->tags["js"] = $this->getJs();
81 81
       $this->tags["jsVariables"] = $this->getJsVariables();
82 82
     }
83
-    protected function getRequire( $_function, $_extenction) {
83
+    protected function getRequire($_function, $_extenction) {
84 84
       $temp = [];
85 85
       foreach ($this->required as $i)
86 86
         if (!is_array($i) && strpos($i, $_extenction) !== FALSE)
87
-          array_push($temp,$i);
87
+          array_push($temp, $i);
88 88
       foreach ($this->modules as $i)
89
-        $temp = array_merge( $temp, $i->$_function() );
89
+        $temp = array_merge($temp, $i->$_function());
90 90
       foreach ($this->files as $i)
91 91
         if (!is_array($i) && strpos($i, $_extenction) !== FALSE)
92
-          array_push($temp,$i);
92
+          array_push($temp, $i);
93 93
       return $temp;
94 94
     }
95 95
   }
Please login to merge, or discard this patch.
dist/jate/modules/GUI/GUI.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -6,24 +6,24 @@
 block discarded – undo
6 6
     public function __construct() {
7 7
       parent::__construct();
8 8
     }
9
-    public function init( $_page ) {
9
+    public function init($_page) {
10 10
       $this->tags = $_page->tags;
11 11
     }
12
-    public function draw( $_template ) {
12
+    public function draw($_template) {
13 13
       $page = "";
14
-      $extension = explode(".",$_template);
15
-      $extension = $extension[count($extension)-1];
14
+      $extension = explode(".", $_template);
15
+      $extension = $extension[count($extension) - 1];
16 16
       $page = $this->parsingFile($_template, $extension);
17 17
       $render = $this->overlayTag($page);
18 18
       echo minifyOutput($render);
19 19
     }
20
-    protected function overlayTag( $_page ) {
21
-      foreach($this->tags as $key => $value)
22
-        if(!is_array($value))
20
+    protected function overlayTag($_page) {
21
+      foreach ($this->tags as $key => $value)
22
+        if (!is_array($value))
23 23
           $_page = str_replace("<_${key}_>", "$value", $_page);
24 24
       return $_page;
25 25
     }
26
-    protected function parsingFile( $_file, $_type = "html" ) {
26
+    protected function parsingFile($_file, $_type = "html") {
27 27
       switch ($_type) {
28 28
         case 'pug':
29 29
         case 'jade':
Please login to merge, or discard this patch.
dist/jate/modules/Twig/Twig.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,16 +5,16 @@
 block discarded – undo
5 5
     public function __construct() {
6 6
       parent::__construct();
7 7
     }
8
-    public function drawFile( $_file, $_parameters = [] ) {
8
+    public function drawFile($_file, $_parameters = []) {
9 9
       $loader  = new Twig_Loader_Filesystem('bundles/views');
10
-      $twig    = new Twig_Environment( $loader, [
10
+      $twig    = new Twig_Environment($loader, [
11 11
         'cache' => 'bundles/views',
12 12
       ]);
13 13
       $template = $twig->loadTemplate($_text);
14 14
       $page = $template->render($_parameters);
15 15
       return $page;
16 16
     }
17
-    public function drawText( $_text, $_parameters = [] ) {
17
+    public function drawText($_text, $_parameters = []) {
18 18
       $loader = new Twig_Loader_Array([
19 19
         'index' => $_text
20 20
       ]);
Please login to merge, or discard this patch.
dist/jate/modules/Connection/Adapters/ConnectionInterface.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
   interface ConnectionAdapterInterface {
3
-    public function __construct( $_srv, $_db, $_usr, $_pass);
4
-    public function query( $_query );
5
-    public function queryFetch( $_query );
6
-    public function queryArray( $_query );
7
-    public function queryInsert( $_query );
3
+    public function __construct($_srv, $_db, $_usr, $_pass);
4
+    public function query($_query);
5
+    public function queryFetch($_query);
6
+    public function queryArray($_query);
7
+    public function queryInsert($_query);
8 8
   }
9 9
 ?>
Please login to merge, or discard this patch.
dist/jate/modules/Connection/Connection.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -8,20 +8,20 @@  discard block
 block discarded – undo
8 8
       parent::__construct();
9 9
       $args = func_get_args();
10 10
       $count = func_num_args();
11
-      if (method_exists($this,$func='__construct'.$count))
12
-        call_user_func_array(array($this,$func),$args);
11
+      if (method_exists($this, $func = '__construct'.$count))
12
+        call_user_func_array(array($this, $func), $args);
13 13
     }
14 14
     public function __construct0() {
15 15
       $this->database = null;
16 16
     }
17
-    public function __construct4 ( $_srv, $_db, $_usr, $_pass ) {
17
+    public function __construct4($_srv, $_db, $_usr, $_pass) {
18 18
       $this->setConnection($_srv, $_db, $_usr, $_pass, "pdo");
19 19
     }
20
-    public function __construct5 ( $_srv, $_db, $_usr, $_pass, $_type ) {
20
+    public function __construct5($_srv, $_db, $_usr, $_pass, $_type) {
21 21
       $type = $this->getConnectionType($_type);
22 22
       $this->setConnection($_srv, $_db, $_usr, $_pass, $type);
23 23
     }
24
-    protected function setConnection ( $_srv, $_db, $_usr, $_pass, $_type ) {
24
+    protected function setConnection($_srv, $_db, $_usr, $_pass, $_type) {
25 25
       switch ($_type) {
26 26
         case "mysqli":
27 27
           $this->database = new ConnectionMysqliAdapter($_srv, $_db, $_usr, $_pass);
@@ -30,15 +30,15 @@  discard block
 block discarded – undo
30 30
           $this->database = new ConnectionPdoAdapter($_srv, $_db, $_usr, $_pass);
31 31
         break;
32 32
       }
33
-      $this->setConnectionParameters( $_srv, $_db, $_usr, $_pass);
33
+      $this->setConnectionParameters($_srv, $_db, $_usr, $_pass);
34 34
     }
35
-    protected function getConnectionType( $_type ) {
35
+    protected function getConnectionType($_type) {
36 36
       foreach ($_type as $key => $value)
37
-        if($value)
37
+        if ($value)
38 38
           return $key;
39 39
       return "pdo";
40 40
     }
41
-    protected function setConnectionParameters( $_srv, $_db, $_usr, $_pass) {
41
+    protected function setConnectionParameters($_srv, $_db, $_usr, $_pass) {
42 42
       $this->info = [];
43 43
       $this->info["server"]    = $_srv;
44 44
       $this->info["database"]  = $_db;
Please login to merge, or discard this patch.
dist/jate/modules/Router/Router.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
     }
7 7
     public function getPage() {
8 8
       $request  = $this->parameters["app"]->server["REQUEST_URI"];
9
-      $base      = $this->parameters["app"]->server["RELATIVE"];
9
+      $base = $this->parameters["app"]->server["RELATIVE"];
10 10
       $url      = str_replace($base, "", $request);
11 11
       $url      = explode("/", $url);
12 12
       return $url;
Please login to merge, or discard this patch.