Skip to content

Commit

Permalink
Fix phpcs
Browse files Browse the repository at this point in the history
  • Loading branch information
josegonzalez committed Jan 9, 2014
1 parent e095726 commit e089434
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions src/josegonzalez/Dotenv/Loader.php
Expand Up @@ -84,20 +84,23 @@ public static function load($options = null)
public function parse()
{
if (!file_exists($this->filepath)) {
return $this->raise('InvalidArgumentException',
return $this->raise(
'InvalidArgumentException',
sprintf("Environment file '%s' is not found.", $this->filepath)
);
}

if (!is_readable($this->filepath)) {
return $this->raise('InvalidArgumentException',
return $this->raise(
'InvalidArgumentException',
sprintf("Environment file '%s' is not readable.", $this->filepath)
);
}

$fc = file_get_contents($this->filepath);
if ($fc === false) {
return $this->raise('InvalidArgumentException',
return $this->raise(
'InvalidArgumentException',
sprintf("Environment file '%s' is not readable.", $this->filepath)
);
}
Expand Down Expand Up @@ -151,7 +154,8 @@ public function expect()
}

if (!empty($missingEnvs)) {
return $this->raise('RuntimeException',
return $this->raise(
'RuntimeException',
sprintf("Required ENV vars missing: ['%s']", implode("', '", $missingEnvs))
);
}
Expand All @@ -168,7 +172,8 @@ public function define()
continue;
}

return $this->raise('LogicException',
return $this->raise(
'LogicException',
sprintf('Key "%s" has already been defined', $key)
);
}
Expand All @@ -188,7 +193,8 @@ public function toEnv($overwrite = false)
continue;
}

return $this->raise('LogicException',
return $this->raise(
'LogicException',
sprintf('Key "%s" has already been defined in $_ENV', $key)
);
}
Expand All @@ -208,7 +214,8 @@ public function toServer($overwrite = false)
continue;
}

return $this->raise('LogicException',
return $this->raise(
'LogicException',
sprintf('Key "%s" has already been defined in $_SERVER', $key)
);
}
Expand Down Expand Up @@ -262,9 +269,10 @@ public function __toString()
protected function requireParse($method)
{
if (!is_array($this->environment)) {
return $this->raise('LogicException', sprintf(
'Environment must be parsed before calling %s()', $method
));
return $this->raise(
'LogicException',
sprintf('Environment must be parsed before calling %s()', $method)
);
}
}

Expand Down

0 comments on commit e089434

Please sign in to comment.