Permalink
Browse files

Eliminate duplicate code.

  • Loading branch information...
1 parent 3329b90 commit 6f2b9a9795766f382bc7a9a7f100322649575d5b @sebastianbergmann committed Jul 17, 2010
Showing with 2 additions and 18 deletions.
  1. +2 −18 PHPUnit/Util/Configuration.php
@@ -450,31 +450,15 @@ public function getPHPConfiguration()
$name = (string)$const->getAttribute('name');
$value = (string)$const->getAttribute('value');
- if (strtolower($value) == 'false') {
- $value = FALSE;
- }
-
- else if (strtolower($value) == 'true') {
- $value = TRUE;
- }
-
- $result['const'][$name] = $value;
+ $result['const'][$name] = $this->getBoolean($value, $value);
}
foreach (array('var', 'env', 'post', 'get', 'cookie', 'server', 'files', 'request') as $array) {
foreach ($this->xpath->query('php/' . $array) as $var) {
$name = (string)$var->getAttribute('name');
$value = (string)$var->getAttribute('value');
- if (strtolower($value) == 'false') {
- $value = FALSE;
- }
-
- else if (strtolower($value) == 'true') {
- $value = TRUE;
- }
-
- $result[$array][$name] = $value;
+ $result[$array][$name] = $this->getBoolean($value, $value);
}
}

0 comments on commit 6f2b9a9

Please sign in to comment.