Skip to content

Commit 0964dca

Browse files
committed
Codeclimate changes 2
1 parent 33155f5 commit 0964dca

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

dist/jate/classes/Module.php

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,26 @@ public function __construct(){}
88
// abstract public function init();
99
// abstract public function draw();
1010
public function getCss() {
11-
$temp = [];
12-
foreach ($this->requires as $i)
13-
$temp = array_merge( $temp, $i->getCss() );
14-
foreach ($this->dipendence as $i)
15-
if (!is_array($i) && strpos($i, '.css') !== FALSE)
16-
array_push($temp,$i);
17-
return $temp;
11+
return $this->getRequire("getCss",".css");
1812
}
1913
public function getJs() {
14+
return $this->getRequire("getJs",".js");
15+
}
16+
public function getJsVariables() {
2017
$temp = [];
2118
foreach ($this->requires as $i)
22-
$temp = array_merge( $temp, $i->getJs() );
19+
$temp = array_merge( $temp, $i->getJsVariables() );
2320
foreach ($this->dipendence as $i)
24-
if (!is_array($i) && strpos($i, '.js') !== FALSE)
21+
if (is_array($i))
2522
array_push($temp,$i);
2623
return $temp;
2724
}
28-
public function getJsVariables() {
25+
private function getRequire( $_function, $_extenction) {
2926
$temp = [];
3027
foreach ($this->requires as $i)
31-
$temp = array_merge( $temp, $i->getJsVariables() );
28+
$temp = array_merge( $temp, $i->$_function() );
3229
foreach ($this->dipendence as $i)
33-
if (is_array($i))
30+
if (!is_array($i) && strpos($i, $_extenction) !== FALSE)
3431
array_push($temp,$i);
3532
return $temp;
3633
}

dist/jate/functions/query.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function std_query( $_database, $_query, $_error, &$_result ) {
2222
echo "$_query<br>";
2323
echo "something wrong: ".$_error;
2424
var_dump($query->errorInfo());
25-
var_dump($db->errorInfo());
25+
var_dump($_database->errorInfo());
2626
exit();
2727
}
2828
return $query->fetchAll(PDO::FETCH_ASSOC);

0 commit comments

Comments
 (0)