Test Failed
Push — master ( c57064...01ffe9 )
by Federico
02:07
created
dist/jate/functions/array.php 2 patches
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -11,6 +11,10 @@
 block discarded – undo
11 11
   function arrayHtmlParser($_array) {
12 12
     return travelStringArray($_array,"htmlParser");
13 13
   }
14
+
15
+  /**
16
+   * @param string $_function
17
+   */
14 18
   function travelStringArray ( $_array, $_function ) {
15 19
     if (is_array($_array)) {
16 20
       foreach ($_array as $k => $v) {
Please login to merge, or discard this patch.
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -1,45 +1,45 @@
 block discarded – undo
1 1
 <?php
2 2
   function utf8ize($_array) {
3
-    return travelStringArray($_array,"utf8_encode");
3
+	return travelStringArray($_array,"utf8_encode");
4 4
   }
5 5
   function unutf8ize($_array) {
6
-    return travelStringArray($_array,"utf8_decode");
6
+	return travelStringArray($_array,"utf8_decode");
7 7
   }
8 8
   function arraySlash($_array) {
9
-    return travelStringArray($_array,"addslashes");
9
+	return travelStringArray($_array,"addslashes");
10 10
   }
11 11
   function arrayHtmlParser($_array) {
12
-    return travelStringArray($_array,"htmlParser");
12
+	return travelStringArray($_array,"htmlParser");
13 13
   }
14 14
   function travelStringArray ( $_array, $_function ) {
15
-    if (is_array($_array)) {
16
-      foreach ($_array as $k => $v) {
17
-        $_array[$k] = travelStringArray($v, $_function);
18
-      }
19
-    } else if (is_string ($_array)) {
20
-      return call_user_func($_function,$_array);
21
-    }
22
-    return $_array;
15
+	if (is_array($_array)) {
16
+	  foreach ($_array as $k => $v) {
17
+		$_array[$k] = travelStringArray($v, $_function);
18
+	  }
19
+	} else if (is_string ($_array)) {
20
+	  return call_user_func($_function,$_array);
21
+	}
22
+	return $_array;
23 23
   }
24 24
   function arrayDepth( $_array ) {
25
-    $maxDepth = 1;
26
-    foreach ($_array as $value) {
27
-      if (is_array($value)) {
28
-        $depth = arrayDepth($value) + 1;
29
-        if ($depth > $maxDepth) {
30
-          $maxDepth = $depth;
31
-        }
32
-      }
33
-    }
34
-    return $maxDepth;
25
+	$maxDepth = 1;
26
+	foreach ($_array as $value) {
27
+	  if (is_array($value)) {
28
+		$depth = arrayDepth($value) + 1;
29
+		if ($depth > $maxDepth) {
30
+		  $maxDepth = $depth;
31
+		}
32
+	  }
33
+	}
34
+	return $maxDepth;
35 35
   }
36 36
   function arrayDump( $_array, $_name = "Array", $_tab = "&nbsp;&nbsp;" ) {
37
-      $position = preg_replace('/&nbsp;&nbsp;/', '', $_tab, 1);
38
-      echo "$position<span style=\"color:rgb(230,0,0)\">$_name:</span><br>";
39
-      foreach ($_array as $k => $i)
40
-        if(is_array($i))
41
-          arrayDump( $i, $k, "&nbsp;&nbsp;$_tab" );
42
-        else
43
-          echo "$_tab<b>$k:</b> $i<br>";
44
-    }
37
+	  $position = preg_replace('/&nbsp;&nbsp;/', '', $_tab, 1);
38
+	  echo "$position<span style=\"color:rgb(230,0,0)\">$_name:</span><br>";
39
+	  foreach ($_array as $k => $i)
40
+		if(is_array($i))
41
+		  arrayDump( $i, $k, "&nbsp;&nbsp;$_tab" );
42
+		else
43
+		  echo "$_tab<b>$k:</b> $i<br>";
44
+	}
45 45
 ?>
Please login to merge, or discard this patch.
dist/jate/functions/block.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -16,6 +16,9 @@
 block discarded – undo
16 16
     return jBlockFileMan($_path, $extension, $_parameters);
17 17
   }
18 18
 
19
+  /**
20
+   * @param string $_type
21
+   */
19 22
   function jBlockFileMan( $_path, $_type, $_parameters = [] ) {
20 23
     $temp = file_get_contents($_path);
21 24
     return jBlockParsing($_type, $temp, $_parameters);
Please login to merge, or discard this patch.
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -2,57 +2,57 @@
 block discarded – undo
2 2
   jRequire("../modules/Pug/Pug.php");
3 3
   jRequire("../modules/Parsedown/Parsedown.php");
4 4
   function jBlock() {
5
-    return ob_start();
5
+	return ob_start();
6 6
   }
7 7
 
8 8
   function jBlockClose( $_type = "html", $_parameters = [] ) {
9
-    return jBlockEnd($_type, $_parameters);
9
+	return jBlockEnd($_type, $_parameters);
10 10
   }
11 11
 
12 12
   function jBlockFile( $_path, $_parameters = [] ) {
13
-    $extension = explode(".", $_path);
14
-    $extension = $extension[count($extension)-1];
15
-    $extension = strtolower($extension);
16
-    return jBlockFileMan($_path, $extension, $_parameters);
13
+	$extension = explode(".", $_path);
14
+	$extension = $extension[count($extension)-1];
15
+	$extension = strtolower($extension);
16
+	return jBlockFileMan($_path, $extension, $_parameters);
17 17
   }
18 18
 
19 19
   function jBlockFileMan( $_path, $_type, $_parameters = [] ) {
20
-    $temp = file_get_contents($_path);
21
-    return jBlockParsing($_type, $temp, $_parameters);
20
+	$temp = file_get_contents($_path);
21
+	return jBlockParsing($_type, $temp, $_parameters);
22 22
   }
23 23
 
24 24
   function jBlockEnd( $_type = "html", $_parameters = [] ) {
25
-    $text = ob_get_clean();
26
-    return jBlockParsing($_type, $text, $_parameters);
25
+	$text = ob_get_clean();
26
+	return jBlockParsing($_type, $text, $_parameters);
27 27
   }
28 28
 
29 29
   function jBlockParsing( $_type = "html", $_string = "", $_parameters = [] ) {
30
-    switch ($_type) {
31
-      case "pug":
32
-      case "jade":
33
-        $Pug = new Pug();
34
-        $_string = $Pug->drawText($_string, $_parameters);
35
-      break;
36
-      case "md":
37
-      case "markdown":
38
-      case "parsedown":
39
-        $Parsedown = new Parsedown();
40
-        $_string = $Parsedown->drawText($_string);
41
-      break;
42
-      case "twig":
43
-        $Twig = new Twig();
44
-        $_string = $Twig->drawText($_string, $_parameters);
45
-      break;
46
-      default: break;
47
-    }
48
-    return $_string;
30
+	switch ($_type) {
31
+	  case "pug":
32
+	  case "jade":
33
+		$Pug = new Pug();
34
+		$_string = $Pug->drawText($_string, $_parameters);
35
+	  break;
36
+	  case "md":
37
+	  case "markdown":
38
+	  case "parsedown":
39
+		$Parsedown = new Parsedown();
40
+		$_string = $Parsedown->drawText($_string);
41
+	  break;
42
+	  case "twig":
43
+		$Twig = new Twig();
44
+		$_string = $Twig->drawText($_string, $_parameters);
45
+	  break;
46
+	  default: break;
47
+	}
48
+	return $_string;
49 49
   }
50 50
 
51 51
   function minifyOutput($_buffer) {
52
-    $search = array ( '/\>[^\S ]+/s', '/[^\S ]+\</s', '/(\s)+/s' );
53
-    $replace = array ( '>', '<', '\\1' );
54
-    if (preg_match("/\<html/i",$_buffer) == 1 && preg_match("/\<\/html\>/i",$_buffer) == 1)
55
-      $_buffer = preg_replace($search, $replace, utf8_decode($_buffer));
56
-    return utf8_encode($_buffer);
52
+	$search = array ( '/\>[^\S ]+/s', '/[^\S ]+\</s', '/(\s)+/s' );
53
+	$replace = array ( '>', '<', '\\1' );
54
+	if (preg_match("/\<html/i",$_buffer) == 1 && preg_match("/\<\/html\>/i",$_buffer) == 1)
55
+	  $_buffer = preg_replace($search, $replace, utf8_decode($_buffer));
56
+	return utf8_encode($_buffer);
57 57
   }
58 58
 ?>
Please login to merge, or discard this patch.
dist/jate/functions/folder.php 2 patches
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -17,6 +17,10 @@
 block discarded – undo
17 17
     });
18 18
     return $temp;
19 19
   }
20
+
21
+  /**
22
+   * @param Closure $_function
23
+   */
20 24
   function fetchInSubFolder( $_dir = "./", $_function) {
21 25
     $temp = [];
22 26
     if (is_dir($_dir)) {
Please login to merge, or discard this patch.
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -1,45 +1,45 @@
 block discarded – undo
1 1
 <?php
2 2
   function subFolder( $_dir = "./" ) {
3
-    $temp = fetchInSubFolder($_dir, function() {
4
-      return true;
5
-    });
6
-    return $temp;
3
+	$temp = fetchInSubFolder($_dir, function() {
4
+	  return true;
5
+	});
6
+	return $temp;
7 7
   }
8 8
   function subFolderFile( $_dir = "./" ) {
9
-    $temp = fetchInSubFolder($_dir, function( $_file ) {
10
-      return !is_dir($_file);
11
-    });
12
-    return $temp;
9
+	$temp = fetchInSubFolder($_dir, function( $_file ) {
10
+	  return !is_dir($_file);
11
+	});
12
+	return $temp;
13 13
   }
14 14
   function subFolderDir( $_dir = "./" ) {
15
-    $temp = fetchInSubFolder($_dir, function( $_file ) {
16
-      return !is_file($_file);
17
-    });
18
-    return $temp;
15
+	$temp = fetchInSubFolder($_dir, function( $_file ) {
16
+	  return !is_file($_file);
17
+	});
18
+	return $temp;
19 19
   }
20 20
   function fetchInSubFolder( $_dir = "./", $_function) {
21
-    $temp = [];
22
-    if (is_dir($_dir)) {
23
-        if ($dirOpened = opendir($_dir)) {
24
-            while (($file = readdir($dirOpened)) !== false)
25
-                if( ($file !='.')&&($file !='..') )
26
-                  if($_function($file))
27
-                    array_push($temp,$file);
28
-            closedir($dirOpened);
29
-        }
30
-    }
31
-    return $temp;
21
+	$temp = [];
22
+	if (is_dir($_dir)) {
23
+		if ($dirOpened = opendir($_dir)) {
24
+			while (($file = readdir($dirOpened)) !== false)
25
+				if( ($file !='.')&&($file !='..') )
26
+				  if($_function($file))
27
+					array_push($temp,$file);
28
+			closedir($dirOpened);
29
+		}
30
+	}
31
+	return $temp;
32 32
   }
33 33
   function requireSubfolder( $_dir = "./" ) {
34
-    $temp = subFolderFile($_dir);
35
-    foreach ($temp as $i)
36
-      jRequire($_dir."/".$i);
34
+	$temp = subFolderFile($_dir);
35
+	foreach ($temp as $i)
36
+	  jRequire($_dir."/".$i);
37 37
   }
38 38
   function require_js( $_dir = "./" ) {
39
-    $tempArray = [];
40
-    $temp = subFolderFile($_dir);
41
-    foreach ($temp as $i)
42
-      array_push($tempArray, $_dir."/".$i);
43
-    return $tempArray;
39
+	$tempArray = [];
40
+	$temp = subFolderFile($_dir);
41
+	foreach ($temp as $i)
42
+	  array_push($tempArray, $_dir."/".$i);
43
+	return $tempArray;
44 44
   }
45 45
 ?>
Please login to merge, or discard this patch.
dist/jate/functions/requirer.php 2 patches
Doc Comments   +11 added lines patch added patch discarded remove patch
@@ -1,4 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
+  /**
3
+   * @param string $_path
4
+   */
2 5
   function requireComponent( $_path, $_local = true ) {
3 6
     $path = getJFolder($_path, $_local, debug_backtrace());
4 7
     if(file_exists($path) && isPhp($path))
@@ -6,6 +9,10 @@  discard block
 block discarded – undo
6 9
     else
7 10
       requireError($_path);
8 11
   }
12
+
13
+  /**
14
+   * @param string $_path
15
+   */
9 16
   function requireComponents( $_path, $_local = true ) {
10 17
     $path = getJFolder($_path, $_local, debug_backtrace());
11 18
     if(file_exists($path)) {
@@ -38,6 +45,10 @@  discard block
 block discarded – undo
38 45
     $path = getJFolder($_path, $_local, debug_backtrace());
39 46
     require_once( $path );
40 47
   }
48
+
49
+  /**
50
+   * @param boolean $_local
51
+   */
41 52
   function getJFolder( $_path, $_local, $_stack ) {
42 53
     if($_local) {
43 54
       $stackInfo = $_stack;
Please login to merge, or discard this patch.
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -1,50 +1,50 @@
 block discarded – undo
1 1
 <?php
2 2
   function requireComponent( $_path, $_local = true ) {
3
-    $path = getJFolder($_path, $_local, debug_backtrace());
4
-    if(file_exists($path) && isPhp($path))
5
-      jRequire($path, false, 0);
6
-    else
7
-      requireError($_path);
3
+	$path = getJFolder($_path, $_local, debug_backtrace());
4
+	if(file_exists($path) && isPhp($path))
5
+	  jRequire($path, false, 0);
6
+	else
7
+	  requireError($_path);
8 8
   }
9 9
   function requireComponents( $_path, $_local = true ) {
10
-    $path = getJFolder($_path, $_local, debug_backtrace());
11
-    if(file_exists($path)) {
12
-      $files = subFolderFile($path);
13
-      foreach ($files as $i) {
14
-        if(isPhp($path."/".$i))
15
-          requireComponent($path."/".$i, false, 0);
16
-      }
17
-    } else
18
-      requireError($_path);
10
+	$path = getJFolder($_path, $_local, debug_backtrace());
11
+	if(file_exists($path)) {
12
+	  $files = subFolderFile($path);
13
+	  foreach ($files as $i) {
14
+		if(isPhp($path."/".$i))
15
+		  requireComponent($path."/".$i, false, 0);
16
+	  }
17
+	} else
18
+	  requireError($_path);
19 19
   }
20 20
   function requireError( $_path ) {
21
-    global $DEBUG;
22
-    if( $DEBUG == 1 )
23
-      echo "Error load ($_path)<br>";
21
+	global $DEBUG;
22
+	if( $DEBUG == 1 )
23
+	  echo "Error load ($_path)<br>";
24 24
   }
25 25
   function isPhp ( $_file ) {
26
-    if(!is_file($_file)) return false;
27
-    $info = pathinfo($_file);
28
-    return ($info["extension"] == "php") || ($info["extension"] == "PHP");
26
+	if(!is_file($_file)) return false;
27
+	$info = pathinfo($_file);
28
+	return ($info["extension"] == "php") || ($info["extension"] == "PHP");
29 29
   }
30 30
   function requireModules( $_path, $_local = true ) {
31
-    $path = getJFolder($_path, $_local, debug_backtrace());
32
-    $subFolders = subFolderDir($path);
33
-    foreach ($subFolders as $i) {
34
-      requireComponents($path."/".$i, false, 0);
35
-    }
31
+	$path = getJFolder($_path, $_local, debug_backtrace());
32
+	$subFolders = subFolderDir($path);
33
+	foreach ($subFolders as $i) {
34
+	  requireComponents($path."/".$i, false, 0);
35
+	}
36 36
   }
37 37
   function jRequire( $_path, $_local = true ) {
38
-    $path = getJFolder($_path, $_local, debug_backtrace());
39
-    require_once( $path );
38
+	$path = getJFolder($_path, $_local, debug_backtrace());
39
+	require_once( $path );
40 40
   }
41 41
   function getJFolder( $_path, $_local, $_stack ) {
42
-    if($_local) {
43
-      $stackInfo = $_stack;
44
-      $folder = dirname($stackInfo[0]["file"]);
45
-      $file = "$folder/$_path";
46
-    } else
47
-      $file = $_path;
48
-    return $file;
42
+	if($_local) {
43
+	  $stackInfo = $_stack;
44
+	  $folder = dirname($stackInfo[0]["file"]);
45
+	  $file = "$folder/$_path";
46
+	} else
47
+	  $file = $_path;
48
+	return $file;
49 49
   }
50 50
 ?>
Please login to merge, or discard this patch.
dist/jate/modules/Connection/Adapters/ConnectionInterface.php 2 patches
Doc Comments   +8 added lines patch added patch discarded remove patch
@@ -1,6 +1,14 @@
 block discarded – undo
1 1
 <?php
2 2
   interface ConnectionAdapterInterface {
3
+
4
+    /**
5
+     * @return void
6
+     */
3 7
     public function __construct( $_srv, $_db, $_usr, $_pass);
8
+
9
+    /**
10
+     * @return boolean
11
+     */
4 12
     public function query( $_query );
5 13
     public function queryFetch( $_query );
6 14
     public function queryArray( $_query );
Please login to merge, or discard this patch.
Indentation   +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/Module/Module.php 2 patches
Doc Comments   +13 added lines patch added patch discarded remove patch
@@ -39,6 +39,10 @@  discard block
 block discarded – undo
39 39
           array_push($temp,$i);
40 40
       return $temp;
41 41
     }
42
+
43
+    /**
44
+     * @param string $_mods
45
+     */
42 46
     public function addModules( $_mods ) {
43 47
       if(!is_array($_mods))
44 48
         throw new InvalidArgumentException("Parameter must be an array.");
@@ -64,6 +68,10 @@  discard block
 block discarded – undo
64 68
         throw new InvalidArgumentException("Parameter must be a string or an array.");
65 69
       array_push($this->files, $_file);
66 70
     }
71
+
72
+    /**
73
+     * @param string $_files
74
+     */
67 75
     public function addFilesRequired( $_files ) {
68 76
       if(!is_array($_files))
69 77
         throw new InvalidArgumentException("Parameter must be an array.");
@@ -80,6 +88,11 @@  discard block
 block discarded – undo
80 88
       $this->tags["js"] = $this->getJs();
81 89
       $this->tags["jsVariables"] = $this->getJsVariables();
82 90
     }
91
+
92
+    /**
93
+     * @param string $_function
94
+     * @param string $_extenction
95
+     */
83 96
     protected function getRequire( $_function, $_extenction) {
84 97
       $temp = [];
85 98
       foreach ($this->required as $i)
Please login to merge, or discard this patch.
Indentation   +92 added lines, -92 removed lines patch added patch discarded remove patch
@@ -1,96 +1,96 @@
 block discarded – undo
1 1
 <?php
2 2
   class Module {
3
-    public $name;
4
-    public $modules;
5
-    public $files;
6
-    public $required;
7
-    public $data;
8
-    public $tags;
9
-    public $connection;
10
-    public $parameters;
11
-    public function __construct() {
12
-      $this->name        = get_class($this);
13
-      $this->modules    = [];
14
-      $this->files      = [];
15
-      $this->required    = [];
16
-      $this->data        = [];
17
-      $this->tags        = [];
18
-      $this->connection  = null;
19
-      $this->parameters = null;
20
-    }
21
-    // abstract public function config();
22
-    // abstract public function init();
23
-    // abstract public function draw();
24
-    public function getCss() {
25
-      return $this->getRequire("getCss",".css");
26
-    }
27
-    public function getJs() {
28
-      return $this->getRequire("getJs",".js");
29
-    }
30
-    public function getJsVariables() {
31
-      $temp = [];
32
-      foreach ($this->required as $i)
33
-        if (is_array($i))
34
-          array_push($temp,$i);
35
-      foreach ($this->modules as $i)
36
-        $temp = array_merge( $temp, $i->getJsVariables() );
37
-      foreach ($this->files as $i)
38
-        if (is_array($i))
39
-          array_push($temp,$i);
40
-      return $temp;
41
-    }
42
-    public function addModules( $_mods ) {
43
-      if(!is_array($_mods))
44
-        throw new InvalidArgumentException("Parameter must be an array.");
45
-      foreach ($_mods as $value)
46
-        $this->addModule($value);
47
-    }
48
-    public function addModule( $_mod ) {
49
-      if(!is_object($_mod))
50
-        throw new InvalidArgumentException("Parameter must be a class.");
51
-      if(! is_subclass_of ($_mod, "Module"))
52
-        throw new InvalidArgumentException("Parameter must be a class.");
53
-      $this->modules[$_mod->name] = $_mod;
54
-      $this->modules[$_mod->name]->parameters = &$this->parameters;
55
-    }
56
-    public function addFiles( $_files ) {
57
-      if(!is_array($_files))
58
-        throw new InvalidArgumentException("Parameter must be an array.");
59
-      foreach ($_files as $value)
60
-        $this->addFile($value);
61
-    }
62
-    public function addFile( $_file ) {
63
-      if(!(is_string($_file) || is_array($_file)))
64
-        throw new InvalidArgumentException("Parameter must be a string or an array.");
65
-      array_push($this->files, $_file);
66
-    }
67
-    public function addFilesRequired( $_files ) {
68
-      if(!is_array($_files))
69
-        throw new InvalidArgumentException("Parameter must be an array.");
70
-      foreach ($_files as $value)
71
-        $this->addFileRequired($value);
72
-    }
73
-    public function addFileRequired( $_file ) {
74
-      if(!is_string($_file))
75
-        throw new InvalidArgumentException("Parameter must be a string.");
76
-      array_push($this->required, $_file);
77
-    }
78
-    protected function addDipendences() {
79
-      $this->tags["css"] = $this->getCss();
80
-      $this->tags["js"] = $this->getJs();
81
-      $this->tags["jsVariables"] = $this->getJsVariables();
82
-    }
83
-    protected function getRequire( $_function, $_extenction) {
84
-      $temp = [];
85
-      foreach ($this->required as $i)
86
-        if (!is_array($i) && strpos($i, $_extenction) !== FALSE)
87
-          array_push($temp,$i);
88
-      foreach ($this->modules as $i)
89
-        $temp = array_merge( $temp, $i->$_function() );
90
-      foreach ($this->files as $i)
91
-        if (!is_array($i) && strpos($i, $_extenction) !== FALSE)
92
-          array_push($temp,$i);
93
-      return $temp;
94
-    }
3
+	public $name;
4
+	public $modules;
5
+	public $files;
6
+	public $required;
7
+	public $data;
8
+	public $tags;
9
+	public $connection;
10
+	public $parameters;
11
+	public function __construct() {
12
+	  $this->name        = get_class($this);
13
+	  $this->modules    = [];
14
+	  $this->files      = [];
15
+	  $this->required    = [];
16
+	  $this->data        = [];
17
+	  $this->tags        = [];
18
+	  $this->connection  = null;
19
+	  $this->parameters = null;
20
+	}
21
+	// abstract public function config();
22
+	// abstract public function init();
23
+	// abstract public function draw();
24
+	public function getCss() {
25
+	  return $this->getRequire("getCss",".css");
26
+	}
27
+	public function getJs() {
28
+	  return $this->getRequire("getJs",".js");
29
+	}
30
+	public function getJsVariables() {
31
+	  $temp = [];
32
+	  foreach ($this->required as $i)
33
+		if (is_array($i))
34
+		  array_push($temp,$i);
35
+	  foreach ($this->modules as $i)
36
+		$temp = array_merge( $temp, $i->getJsVariables() );
37
+	  foreach ($this->files as $i)
38
+		if (is_array($i))
39
+		  array_push($temp,$i);
40
+	  return $temp;
41
+	}
42
+	public function addModules( $_mods ) {
43
+	  if(!is_array($_mods))
44
+		throw new InvalidArgumentException("Parameter must be an array.");
45
+	  foreach ($_mods as $value)
46
+		$this->addModule($value);
47
+	}
48
+	public function addModule( $_mod ) {
49
+	  if(!is_object($_mod))
50
+		throw new InvalidArgumentException("Parameter must be a class.");
51
+	  if(! is_subclass_of ($_mod, "Module"))
52
+		throw new InvalidArgumentException("Parameter must be a class.");
53
+	  $this->modules[$_mod->name] = $_mod;
54
+	  $this->modules[$_mod->name]->parameters = &$this->parameters;
55
+	}
56
+	public function addFiles( $_files ) {
57
+	  if(!is_array($_files))
58
+		throw new InvalidArgumentException("Parameter must be an array.");
59
+	  foreach ($_files as $value)
60
+		$this->addFile($value);
61
+	}
62
+	public function addFile( $_file ) {
63
+	  if(!(is_string($_file) || is_array($_file)))
64
+		throw new InvalidArgumentException("Parameter must be a string or an array.");
65
+	  array_push($this->files, $_file);
66
+	}
67
+	public function addFilesRequired( $_files ) {
68
+	  if(!is_array($_files))
69
+		throw new InvalidArgumentException("Parameter must be an array.");
70
+	  foreach ($_files as $value)
71
+		$this->addFileRequired($value);
72
+	}
73
+	public function addFileRequired( $_file ) {
74
+	  if(!is_string($_file))
75
+		throw new InvalidArgumentException("Parameter must be a string.");
76
+	  array_push($this->required, $_file);
77
+	}
78
+	protected function addDipendences() {
79
+	  $this->tags["css"] = $this->getCss();
80
+	  $this->tags["js"] = $this->getJs();
81
+	  $this->tags["jsVariables"] = $this->getJsVariables();
82
+	}
83
+	protected function getRequire( $_function, $_extenction) {
84
+	  $temp = [];
85
+	  foreach ($this->required as $i)
86
+		if (!is_array($i) && strpos($i, $_extenction) !== FALSE)
87
+		  array_push($temp,$i);
88
+	  foreach ($this->modules as $i)
89
+		$temp = array_merge( $temp, $i->$_function() );
90
+	  foreach ($this->files as $i)
91
+		if (!is_array($i) && strpos($i, $_extenction) !== FALSE)
92
+		  array_push($temp,$i);
93
+	  return $temp;
94
+	}
95 95
   }
96 96
 ?>
Please login to merge, or discard this patch.
dist/jate/modules/Parsedown/Parsedown.php 2 patches
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -9,6 +9,10 @@
 block discarded – undo
9 9
     public function drawFile( $_template ) {
10 10
       return $this->draw($_template);
11 11
     }
12
+
13
+    /**
14
+     * @param string $_template
15
+     */
12 16
     public function drawText( $_template ) {
13 17
       return $this->draw(trim($_template));
14 18
     }
Please login to merge, or discard this patch.
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -3,19 +3,19 @@
 block discarded – undo
3 3
   jRequire("Parsedown/Parsedown.php");
4 4
   use Parsedown as Parsedown;
5 5
   class Parsedown extends Module {
6
-    public function __construct() {
7
-      parent::__construct();
8
-    }
9
-    public function drawFile( $_template ) {
10
-      return $this->draw($_template);
11
-    }
12
-    public function drawText( $_template ) {
13
-      return $this->draw(trim($_template));
14
-    }
15
-    public function draw( $_template ) {
16
-      $Parsedown = new Parsedown\Parsedown();
17
-      $page = $Parsedown->text($_template);
18
-      return $page;
19
-    }
6
+	public function __construct() {
7
+	  parent::__construct();
8
+	}
9
+	public function drawFile( $_template ) {
10
+	  return $this->draw($_template);
11
+	}
12
+	public function drawText( $_template ) {
13
+	  return $this->draw(trim($_template));
14
+	}
15
+	public function draw( $_template ) {
16
+	  $Parsedown = new Parsedown\Parsedown();
17
+	  $page = $Parsedown->text($_template);
18
+	  return $page;
19
+	}
20 20
   }
21 21
 ?>
Please login to merge, or discard this patch.
dist/jate/modules/Pug/Pug.php 2 patches
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -8,6 +8,10 @@
 block discarded – undo
8 8
     public function drawFile( $_file, $_parameters = [] ) {
9 9
       return $this->draw($_file, $_parameters);
10 10
     }
11
+
12
+    /**
13
+     * @param string $_text
14
+     */
11 15
     public function drawText( $_text, $_parameters = [] ) {
12 16
       return $this->draw(trim($_text), $_parameters);
13 17
     }
Please login to merge, or discard this patch.
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -2,19 +2,19 @@
 block discarded – undo
2 2
   use Pug as Pug;
3 3
   jRequire("../Module/Module.php");
4 4
   class Pug extends Module {
5
-    public function __construct() {
6
-      parent::__construct();
7
-    }
8
-    public function drawFile( $_file, $_parameters = [] ) {
9
-      return $this->draw($_file, $_parameters);
10
-    }
11
-    public function drawText( $_text, $_parameters = [] ) {
12
-      return $this->draw(trim($_text), $_parameters);
13
-    }
14
-    public function draw( $_text, $_parameters = [] ) {
15
-      $pug = new Pug\Pug();
16
-      $page = $pug->render($_text, $_parameters);
17
-      return $page;
18
-    }
5
+	public function __construct() {
6
+	  parent::__construct();
7
+	}
8
+	public function drawFile( $_file, $_parameters = [] ) {
9
+	  return $this->draw($_file, $_parameters);
10
+	}
11
+	public function drawText( $_text, $_parameters = [] ) {
12
+	  return $this->draw(trim($_text), $_parameters);
13
+	}
14
+	public function draw( $_text, $_parameters = [] ) {
15
+	  $pug = new Pug\Pug();
16
+	  $page = $pug->render($_text, $_parameters);
17
+	  return $page;
18
+	}
19 19
   }
20 20
 ?>
Please login to merge, or discard this patch.
dist/jate/modules/Twig/Twig.php 2 patches
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -14,6 +14,10 @@
 block discarded – undo
14 14
       $page = $template->render($_parameters);
15 15
       return $page;
16 16
     }
17
+
18
+    /**
19
+     * @param string $_text
20
+     */
17 21
     public function drawText( $_text, $_parameters = [] ) {
18 22
       $loader = new Twig_Loader_Array([
19 23
         'index' => $_text
Please login to merge, or discard this patch.
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -2,25 +2,25 @@
 block discarded – undo
2 2
   // use Twig as Twig;
3 3
   jRequire("../Module/Module.php");
4 4
   class Twig extends Module {
5
-    public function __construct() {
6
-      parent::__construct();
7
-    }
8
-    public function drawFile( $_file, $_parameters = [] ) {
9
-      $loader  = new Twig_Loader_Filesystem('bundles/views');
10
-      $twig    = new Twig_Environment( $loader, [
11
-        'cache' => 'bundles/views',
12
-      ]);
13
-      $template = $twig->loadTemplate($_text);
14
-      $page = $template->render($_parameters);
15
-      return $page;
16
-    }
17
-    public function drawText( $_text, $_parameters = [] ) {
18
-      $loader = new Twig_Loader_Array([
19
-        'index' => $_text
20
-      ]);
21
-      $twig = new Twig_Environment($loader);
22
-      $page = $twig->render('index', $_parameters);
23
-      return $page;
24
-    }
5
+	public function __construct() {
6
+	  parent::__construct();
7
+	}
8
+	public function drawFile( $_file, $_parameters = [] ) {
9
+	  $loader  = new Twig_Loader_Filesystem('bundles/views');
10
+	  $twig    = new Twig_Environment( $loader, [
11
+		'cache' => 'bundles/views',
12
+	  ]);
13
+	  $template = $twig->loadTemplate($_text);
14
+	  $page = $template->render($_parameters);
15
+	  return $page;
16
+	}
17
+	public function drawText( $_text, $_parameters = [] ) {
18
+	  $loader = new Twig_Loader_Array([
19
+		'index' => $_text
20
+	  ]);
21
+	  $twig = new Twig_Environment($loader);
22
+	  $page = $twig->render('index', $_parameters);
23
+	  return $page;
24
+	}
25 25
   }
26 26
 ?>
Please login to merge, or discard this patch.