diff --git a/coverage/Alo.php.html b/coverage/Alo.php.html
index 075a6b5..70fd42b 100644
--- a/coverage/Alo.php.html
+++ b/coverage/Alo.php.html
@@ -87,7 +87,7 @@
100.00% |
15 / 15 |
- 33 |
+ 34 |
100.00% covered (success)
@@ -141,7 +141,7 @@
- getUniqid |
+ getUniqid |
100.00% covered (success)
@@ -150,7 +150,7 @@
|
100.00% |
1 / 1 |
- 2 |
+ 3 |
100.00% covered (success)
@@ -162,7 +162,7 @@
|
- isIncludable |
+ isIncludable |
100.00% covered (success)
@@ -183,7 +183,7 @@
|
- includeOnceIfExists |
+ includeOnceIfExists |
100.00% covered (success)
@@ -204,7 +204,7 @@
|
- isCliRequest |
+ isCliRequest |
100.00% covered (success)
@@ -225,7 +225,7 @@
|
- isRegularRequest |
+ isRegularRequest |
100.00% covered (success)
@@ -246,7 +246,7 @@
|
- get |
+ get |
100.00% covered (success)
@@ -267,7 +267,7 @@
|
- nullget |
+ nullget |
100.00% covered (success)
@@ -288,7 +288,7 @@
|
- ifnull |
+ ifnull |
100.00% covered (success)
@@ -309,7 +309,7 @@
|
- ifundefined |
+ ifundefined |
100.00% covered (success)
@@ -330,7 +330,7 @@
|
- isAjaxRequest |
+ isAjaxRequest |
100.00% covered (success)
@@ -351,7 +351,7 @@
|
- getFingerprint |
+ getFingerprint |
100.00% covered (success)
@@ -372,7 +372,7 @@
|
- isTraversable |
+ isTraversable |
100.00% covered (success)
@@ -393,7 +393,7 @@
|
- unXss |
+ unXss |
100.00% covered (success)
@@ -623,198 +623,209 @@
| |
| |
| |
- | |
- | |
- | |
- | static function getUniqid($hash = 'sha256', $prefix = '', $entropy = 250, $rawOutput = false) { |
- | $str = mt_rand(PHP_INT_MIN, PHP_INT_MAX) . json_encode([$_COOKIE, |
- | $_REQUEST, |
- | $_FILES, |
- | $_ENV, |
- | $_GET, |
- | $_POST, |
- | $_SERVER]) . uniqid($prefix, true) . |
- | self::asciiRand($entropy, self::ASCII_ALL); |
- | |
- | if (function_exists('\openssl_random_pseudo_bytes')) { |
- | $str .= \openssl_random_pseudo_bytes($entropy); |
- | } else { |
- | trigger_error('The openssl extension is not enabled, therefore the unique ID is not ' . |
- | 'cryptographically secure.', |
- | E_USER_WARNING); |
- | } |
- | |
- | return hash($hash, $str, $rawOutput); |
- | } |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | private static function isIncludable($path) { |
- | return file_exists($path) && is_file($path); |
- | } |
- | |
- | |
- | |
- | |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | static function getUniqid($hash = 'sha256', $prefix = '', $entropy = 10000, $rawOutput = false) { |
+ | $str = mt_rand(~PHP_INT_MAX, PHP_INT_MAX) . json_encode([$_COOKIE, |
+ | $_REQUEST, |
+ | $_FILES, |
+ | $_ENV, |
+ | $_GET, |
+ | $_POST, |
+ | $_SERVER]) . uniqid($prefix, true) . |
+ | self::asciiRand($entropy, self::ASCII_ALL); |
+ | |
+ | if (function_exists('\openssl_random_pseudo_bytes')) { |
+ | $algoStrong = null; |
+ | $str .= \openssl_random_pseudo_bytes($entropy, $algoStrong); |
+ | |
+ | if ($algoStrong !== true) { |
+ | trigger_error('Please update your openssl & PHP libraries. openssl_random_pseudo_bytes was unable' . |
+ | ' to locate a cryptographically strong algorithm.', |
+ | E_USER_WARNING); |
+ | } |
+ | } else { |
+ | trigger_error('The openssl extension is not enabled, therefore the unique ID is not ' . |
+ | 'cryptographically secure.', |
+ | E_USER_WARNING); |
+ | } |
+ | |
+ | return hash($hash, $str, $rawOutput); |
+ | } |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | |
| |
- | |
- | |
- | |
- | |
- | static function includeOnceIfExists($path) { |
- | if (self::isIncludable($path)) { |
- | include_once $path; |
- | |
- | return true; |
- | } |
- | |
- | return false; |
- | } |
- | |
- | |
- | |
- | |
- | |
- | |
- | static function isCliRequest() { |
- | return PHP_SAPI == 'cli' || defined('STDIN'); |
- | } |
- | |
- | |
- | |
- | |
- | |
- | |
+ | |
+ | |
+ | private static function isIncludable($path) { |
+ | return file_exists($path) && is_file($path); |
+ | } |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | static function includeOnceIfExists($path) { |
+ | if (self::isIncludable($path)) { |
+ | include_once $path; |
+ | |
+ | return true; |
+ | } |
+ | |
+ | return false; |
+ | } |
+ | |
+ | |
+ | |
+ | |
+ | |
| |
- | static function isRegularRequest() { |
- | return !self::isAjaxRequest() && !self::isCliRequest(); |
+ | static function isCliRequest() { |
+ | return PHP_SAPI == 'cli' || defined('STDIN'); |
| } |
| |
| |
- | |
- | |
- | |
- | |
- | |
- | |
- | static function get(&$var) { |
- | return isset($var) ? $var : null; |
- | } |
- | |
- | |
- | |
- | |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | static function isRegularRequest() { |
+ | return !self::isAjaxRequest() && !self::isCliRequest(); |
+ | } |
+ | |
+ | |
+ | |
+ | |
+ | |
| |
- | |
- | |
- | |
- | |
- | static function nullget(&$var) { |
- | return self::get($var) ? $var : null; |
- | } |
- | |
- | |
- | |
- | |
+ | |
+ | |
+ | static function get(&$var) { |
+ | return isset($var) ? $var : null; |
+ | } |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | |
| |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | static function ifnull(&$var, $planB, $useNullget = false) { |
- | $v = $useNullget ? self::nullget($var) : self::get($var); |
- | |
- | return $v !== null ? $v : $planB; |
- | } |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | static function ifundefined($const, $planB) { |
- | return defined($const) ? constant($const) : $planB; |
- | } |
- | |
- | |
- | |
- | |
- | |
- | |
- | static function isAjaxRequest() { |
- | return self::get($_SERVER['HTTP_X_REQUESTED_WITH']) == 'XMLHttpRequest'; |
- | } |
- | |
- | |
- | |
- | |
+ | |
+ | |
+ | static function nullget(&$var) { |
+ | return self::get($var) ? $var : null; |
+ | } |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | static function ifnull(&$var, $planB, $useNullget = false) { |
+ | $v = $useNullget ? self::nullget($var) : self::get($var); |
+ | |
+ | return $v !== null ? $v : $planB; |
+ | } |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | static function ifundefined($const, $planB) { |
+ | return defined($const) ? constant($const) : $planB; |
+ | } |
+ | |
+ | |
+ | |
| |
- | |
- | |
- | |
- | |
- | |
- | |
- | static function getFingerprint($hashAlgo = 'sha256') { |
- | return hash($hashAlgo, |
- | '#QramRAN7*s%6n%@x*53jVVPsnrz@5MY$49o^mhJ8HqY%3a09yJnSWg9lBl$O4CKUb&&S%EgYBjhUZEbhquw$keCjR6I%zMcA!Qr' . |
- | self::get($_SERVER['HTTP_USER_AGENT']) . |
- | 'OE2%fWaZh4jfZPiNXKmHfUw6ok6Z0s#PInaFa8&o#xh#nVyaFaXHPUcv^2y579PnYr5AOs6Zqb!QTAZCgRR968*%QxKc^XNuYYM8' . |
- | self::get($_SERVER['HTTP_DNT']) . |
- | '%CwyJJ^GAooDl&o0mc%7zbWlD^6tWoNSN&m3cKxWLP8kiBqO!j2PM5wACzyOoa^t7AEJ#FlDT!BMtD$luy%2iZejMVzktaiftpg*' . |
- | self::get($_SERVER['HTTP_ACCEPT_LANGUAGE']) . |
- | 'tep!uTwVXk1CedJq0osEI7p&XCxnC3ipGDWEpTXULEg8J!K1NJSxe4GPor$R3OOb**ZjzPN$$SOHe4ZDcQWQULdtT&XxP2!YYxZy'); |
- | } |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | static function isTraversable($input) { |
- | return is_array($input) || $input instanceof Traversable; |
- | } |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | static function unXss($input) { |
- | if (self::isTraversable($input)) { |
- | foreach ($input as &$i) { |
- | $i = self::unXss($i); |
- | } |
- | } elseif (is_scalar($input)) { |
- | $input = htmlspecialchars($input, ENT_QUOTES | ENT_HTML5); |
- | } |
- | |
- | return $input; |
- | } |
- | } |
+ | |
+ | |
+ | static function isAjaxRequest() { |
+ | return self::get($_SERVER['HTTP_X_REQUESTED_WITH']) == 'XMLHttpRequest'; |
+ | } |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | static function getFingerprint($hashAlgo = 'sha256') { |
+ | return hash($hashAlgo, |
+ | '#QramRAN7*s%6n%@x*53jVVPsnrz@5MY$49o^mhJ8HqY%3a09yJnSWg9lBl$O4CKUb&&S%EgYBjhUZEbhquw$keCjR6I%zMcA!Qr' . |
+ | self::get($_SERVER['HTTP_USER_AGENT']) . |
+ | 'OE2%fWaZh4jfZPiNXKmHfUw6ok6Z0s#PInaFa8&o#xh#nVyaFaXHPUcv^2y579PnYr5AOs6Zqb!QTAZCgRR968*%QxKc^XNuYYM8' . |
+ | self::get($_SERVER['HTTP_DNT']) . |
+ | '%CwyJJ^GAooDl&o0mc%7zbWlD^6tWoNSN&m3cKxWLP8kiBqO!j2PM5wACzyOoa^t7AEJ#FlDT!BMtD$luy%2iZejMVzktaiftpg*' . |
+ | self::get($_SERVER['HTTP_ACCEPT_LANGUAGE']) . |
+ | 'tep!uTwVXk1CedJq0osEI7p&XCxnC3ipGDWEpTXULEg8J!K1NJSxe4GPor$R3OOb**ZjzPN$$SOHe4ZDcQWQULdtT&XxP2!YYxZy'); |
+ | } |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | static function isTraversable($input) { |
+ | return is_array($input) || $input instanceof Traversable; |
+ | } |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | static function unXss($input) { |
+ | if (self::isTraversable($input)) { |
+ | foreach ($input as &$i) { |
+ | $i = self::unXss($i); |
+ | } |
+ | } elseif (is_scalar($input)) { |
+ | $input = htmlspecialchars($input, ENT_QUOTES | ENT_HTML5 | ENT_SUBSTITUTE); |
+ | } |
+ | |
+ | return $input; |
+ | } |
+ | } |
@@ -827,7 +838,7 @@ Legend
Dead Code
- Generated by PHP_CodeCoverage 3.0.1 using PHP 5.6.14 and PHPUnit 5.0.8 at Tue Oct 27 16:36:56 GMT 2015.
+ Generated by PHP_CodeCoverage 3.0.2 using PHP 5.6.15 and PHPUnit 5.0.9 at Wed Nov 18 21:06:08 GMT 2015.
diff --git a/coverage/dashboard.html b/coverage/dashboard.html
index 2ef620a..2a2b6ad 100644
--- a/coverage/dashboard.html
+++ b/coverage/dashboard.html
@@ -136,7 +136,7 @@ Project Risks
@@ -225,7 +225,7 @@ Project Risks
chart.yAxis.axisLabel('Cyclomatic Complexity');
d3.select('#classComplexity svg')
- .datum(getComplexityData([[100,33," Alo<\/a>"]], 'Class Complexity'))
+ .datum(getComplexityData([[100,34,"Alo<\/a>"]], 'Class Complexity'))
.transition()
.duration(500)
.call(chart);
@@ -249,7 +249,7 @@ Project Risks
chart.yAxis.axisLabel('Method Complexity');
d3.select('#methodComplexity svg')
- .datum(getComplexityData([[100,2,"Alo::includeIfExists<\/a>"],[100,4,"Alo::asciiRand<\/a>"],[100,2,"Alo::getUniqid<\/a>"],[100,2,"Alo::isIncludable<\/a>"],[100,2,"Alo::includeOnceIfExists<\/a>"],[100,2,"Alo::isCliRequest<\/a>"],[100,2,"Alo::isRegularRequest<\/a>"],[100,2,"Alo::get<\/a>"],[100,2,"Alo::nullget<\/a>"],[100,3,"Alo::ifnull<\/a>"],[100,2,"Alo::ifundefined<\/a>"],[100,1,"Alo::isAjaxRequest<\/a>"],[100,1,"Alo::getFingerprint<\/a>"],[100,2,"Alo::isTraversable<\/a>"],[100,4,"Alo::unXss<\/a>"]], 'Method Complexity'))
+ .datum(getComplexityData([[100,2,"Alo::includeIfExists<\/a>"],[100,4,"Alo::asciiRand<\/a>"],[100,3,"Alo::getUniqid<\/a>"],[100,2,"Alo::isIncludable<\/a>"],[100,2,"Alo::includeOnceIfExists<\/a>"],[100,2,"Alo::isCliRequest<\/a>"],[100,2,"Alo::isRegularRequest<\/a>"],[100,2,"Alo::get<\/a>"],[100,2,"Alo::nullget<\/a>"],[100,3,"Alo::ifnull<\/a>"],[100,2,"Alo::ifundefined<\/a>"],[100,1,"Alo::isAjaxRequest<\/a>"],[100,1,"Alo::getFingerprint<\/a>"],[100,2,"Alo::isTraversable<\/a>"],[100,4,"Alo::unXss<\/a>"]], 'Method Complexity'))
.transition()
.duration(500)
.call(chart);
diff --git a/coverage/index.html b/coverage/index.html
index 1ac9995..5954d4c 100644
--- a/coverage/index.html
+++ b/coverage/index.html
@@ -108,7 +108,7 @@ Legend
High: 90% to 100%
- Generated by PHP_CodeCoverage 3.0.1 using PHP 5.6.14 and PHPUnit 5.0.8 at Tue Oct 27 16:36:56 GMT 2015.
+ Generated by PHP_CodeCoverage 3.0.2 using PHP 5.6.15 and PHPUnit 5.0.9 at Wed Nov 18 21:06:08 GMT 2015.
| |