Skip to content

Commit

Permalink
Resolved functions parameters' types issue
Browse files Browse the repository at this point in the history
  • Loading branch information
prinx committed Jun 12, 2020
1 parent f9e5376 commit 8f4bd77
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/Dotenv.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Dotenv
protected $path = '';
protected $section_separator = '.';

public function __construct(string $path = '')
public function __construct($path = '')
{
$path = $path ?: realpath(__DIR__ . '/../../../../.env');
$this->setPath($path);
Expand Down Expand Up @@ -69,7 +69,7 @@ public function replaceReferences()
* @param mixed $line_value
* @return void
*/
public function properValueOfRef(mixed $ref_value, mixed $line_value)
public function properValueOfRef($ref_value, $line_value)
{
if ($this->valueSameAsReference($ref_value, $line_value)) {
settype($line_value, gettype($ref_value));
Expand All @@ -85,7 +85,7 @@ public function properValueOfRef(mixed $ref_value, mixed $line_value)
* @param mixed $line_value
* @return void
*/
public function valueSameAsReference(mixed $ref_value, mixed $line_value)
public function valueSameAsReference($ref_value, $line_value)
{
$ref_value_string = '';
$ref_value_type = gettype($ref_value);
Expand All @@ -104,7 +104,7 @@ public function valueSameAsReference(mixed $ref_value, mixed $line_value)
* @return bool
*/
// Thanks to https://stackoverflow.com/a/5496674
public function isStringifiable(mixed $var)
public function isStringifiable($var)
{
return (
!is_array($var) &&
Expand All @@ -130,7 +130,7 @@ public function all()
* @param mixed $default
* @return void
*/
public function get(string $name = '', mixed $default = null)
public function get($name = '', $default = null)
{
if (\func_num_args() === 0) {
return $this->all();
Expand Down Expand Up @@ -173,7 +173,7 @@ public function get(string $name = '', mixed $default = null)
* @param mixed $value
* @return void
*/
public function add(string $name, mixed $value)
public function add($name, $value)
{
$name_exploded = explode($this->section_separator, $name);

Expand Down Expand Up @@ -201,10 +201,10 @@ public function add(string $name, mixed $value)
* @return mixed
*/
public function nextArrayValue(
mixed $value_to_insert,
array $name_indexes,
int $current_index,
int $last_index
$value_to_insert,
$name_indexes,
$current_index,
$last_index
) {
return $current_index === $last_index ?
$value_to_insert :
Expand All @@ -228,10 +228,10 @@ public function nextArrayValue(
* @return void
*/
public function persist(
string $name,
mixed $value,
bool $overwrite = true,
bool $quote_string = true
$name,
$value,
$overwrite = true,
$quote_string = true
) {
$pattern = '/' . $name . '[ ]*=.*/';
$content = \file_get_contents($this->path);
Expand Down Expand Up @@ -270,7 +270,7 @@ public function envVariableExists($name)
* @param string $str
* @return int
*/
public function getLineWithString(string $fileName, string $str)
public function getLineWithString($fileName, $str)
{
$lines = file($fileName);
foreach ($lines as $lineNumber => $line) {
Expand All @@ -290,7 +290,7 @@ public function getLineWithString(string $fileName, string $str)
* @param string $section
* @return void
*/
public function addIfNotExists(string $name, mixed $value, string $section = '')
public function addIfNotExists($name, $value, $section = '')
{
if (!isset($this->env[$name])) {
$this->add($name, $value, $section);
Expand All @@ -303,7 +303,7 @@ public function addIfNotExists(string $name, mixed $value, string $section = '')
* @param string $path
* @return void
*/
public function setPath(string $path)
public function setPath($path)
{
if (!\file_exists($path)) {
throw new \Exception('Trying to set the env file path but the file ' . $path . ' seems not to exist.');
Expand Down

0 comments on commit 8f4bd77

Please sign in to comment.