Skip to content

Commit

Permalink
Codeclimate change
Browse files Browse the repository at this point in the history
  • Loading branch information
XaBerr committed Feb 3, 2016
1 parent 133008a commit 703940f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 58 deletions.
7 changes: 0 additions & 7 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ engines:
enabled: true
config:
languages:
- ruby
- javascript
- python
- php
fixme:
enabled: true
Expand All @@ -16,13 +14,8 @@ engines:
enabled: false
ratings:
paths:
- "**.inc"
- "**.js"
- "**.jsx"
- "**.module"
- "**.php"
- "**.py"
- "**.rb"
exclude_paths:
- git/**/*
- examples/**/*
29 changes: 9 additions & 20 deletions dist/jate/functions/array.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
<?php
function utf8ize($_array) {
if (is_array($_array)) {
foreach ($_array as $k => $v) {
$_array[$k] = utf8ize($v);
}
} else if (is_string ($_array)) {
return utf8_encode($_array);
}
return $_array;
return travelStringArray($_array,"utf8_encode");
}
function unutf8ize($_array) {
return travelStringArray($_array,"utf8_decode");
}
function arraySlash($_array) {
return travelStringArray($_array,"addslashes");
}
function travelStringArray ( $_array, $_function ) {
if (is_array($_array)) {
foreach ($_array as $k => $v) {
$_array[$k] = unutf8ize($v);
$_array[$k] = travelStringArray($v, $_function);
}
} else if (is_string ($_array)) {
return utf8_decode($_array);
return call_user_func($_function,$_array);
}
return $_array;
}
Expand All @@ -31,14 +30,4 @@ function array_depth( $_array ) {
}
return $max_depth;
}
function array_slash($_array) {
if (is_array($_array)) {
foreach ($_array as $k => $v) {
$_array[$k] = array_slash($v);
}
} else if (is_string ($_array)) {
return addslashes($_array);
}
return $_array;
}
?>
49 changes: 18 additions & 31 deletions dist/jate/functions/folder.php
Original file line number Diff line number Diff line change
@@ -1,58 +1,45 @@
<?php
function subFolder( $_dir = "./" ) {
$temp = array();
if (is_dir($_dir)) {
if ($dirOpened = opendir($_dir)) {
while (($file = readdir($dirOpened)) !== false) {
if( ($file !='.')&&($file !='..') ) {
array_push($temp,$file);
}
}
closedir($dirOpened);
}
}
$temp = fetchInSubFolder($_dir, function( $_file ) {
return true;
});
return $temp;
}
function subFolder_file( $_dir = "./" ) {
$temp = array();
if (is_dir($_dir)) {
if ($dirOpened = opendir($_dir)) {
while (($file = readdir($dirOpened)) !== false) {
if( ($file !='.') && ($file !='..') && !is_dir($file) ) {
array_push($temp,$file);
}
}
closedir($dirOpened);
}
}
$temp = fetchInSubFolder($_dir, function( $_file ) {
return !is_dir($_file);
});
return $temp;
}
function subFolder_dir( $_dir = "./" ) {
$temp = fetchInSubFolder($_dir, function( $_file ) {
return !is_file($_file);
});
return $temp;
}
function fetchInSubFolder( $_dir = "./", $_function) {
$temp = array();
if (is_dir($_dir)) {
if ($dirOpened = opendir($_dir)) {
while (($file = readdir($dirOpened)) !== false) {
if( ($file !='.') && ($file !='..') && !is_file($file) ) {
array_push($temp,$file);
}
}
while (($file = readdir($dirOpened)) !== false)
if( ($file !='.')&&($file !='..') )
if($_function($file))
array_push($temp,$file);
closedir($dirOpened);
}
}
return $temp;
}
function require_subfolder( $_dir = "./" ) {
$temp = subFolder_file($_dir);
foreach ($temp as $i) {
foreach ($temp as $i)
require_once($_dir."/".$i);
}
}
function require_js( $_dir = "./" ) {
$tempArray = array();
$temp = subFolder_file($_dir);
foreach ($temp as $i) {
foreach ($temp as $i)
array_push($tempArray, $_dir."/".$i);
}
return $tempArray;
}
?>

0 comments on commit 703940f

Please sign in to comment.