Skip to content
This repository has been archived by the owner on Sep 20, 2021. It is now read-only.

Commit

Permalink
chore(php) Update to PHP 7.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hywan committed Nov 10, 2017
1 parent 875be6b commit 4191464
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 54 deletions.
18 changes: 9 additions & 9 deletions Source/Link/Read.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public function eof(): bool
* @return string
* @throws \Hoa\File\Exception
*/
public function read(int $length): string
public function read(int $length)
{
if (0 > $length) {
throw new File\Exception(
Expand All @@ -145,7 +145,7 @@ public function read(int $length): string
* @param int $length Length.
* @return string
*/
public function readString(int $length): string
public function readString(int $length)
{
return $this->read($length);
}
Expand All @@ -155,7 +155,7 @@ public function readString(int $length): string
*
* @return string
*/
public function readCharacter(): string
public function readCharacter()
{
return fgetc($this->getStream());
}
Expand All @@ -165,7 +165,7 @@ public function readCharacter(): string
*
* @return bool
*/
public function readBoolean(): bool
public function readBoolean()
{
return (bool) $this->read(1);
}
Expand All @@ -176,7 +176,7 @@ public function readBoolean(): bool
* @param int $length Length.
* @return int
*/
public function readInteger(int $length = 1): int
public function readInteger(int $length = 1)
{
return (int) $this->read($length);
}
Expand All @@ -187,7 +187,7 @@ public function readInteger(int $length = 1): int
* @param int $length Length.
* @return float
*/
public function readFloat(int $length = 1): float
public function readFloat(int $length = 1)
{
return (float) $this->read($length);
}
Expand All @@ -199,7 +199,7 @@ public function readFloat(int $length = 1): float
* @param string $format Format (see printf's formats).
* @return array
*/
public function readArray(string $format = null): array
public function readArray(string $format = null)
{
return $this->scanf($format);
}
Expand All @@ -209,7 +209,7 @@ public function readArray(string $format = null): array
*
* @return string
*/
public function readLine(): string
public function readLine()
{
return fgets($this->getStream());
}
Expand All @@ -220,7 +220,7 @@ public function readLine(): string
* @param int $offset Offset.
* @return string
*/
public function readAll(int $offset = 0): string
public function readAll(int $offset = 0)
{
return stream_get_contents($this->getStream(), -1, $offset);
}
Expand Down
18 changes: 9 additions & 9 deletions Source/Link/ReadWrite.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function eof(): bool
/**
* Read n characters.
*/
public function read(int $length): string
public function read(int $length)
{
if (0 > $length) {
throw new File\Exception(
Expand All @@ -126,39 +126,39 @@ public function read(int $length): string
/**
* Alias of $this->read().
*/
public function readString(int $length): string
public function readString(int $length)
{
return $this->read($length);
}

/**
* Read a character.
*/
public function readCharacter(): string
public function readCharacter()
{
return fgetc($this->getStream());
}

/**
* Read a boolean.
*/
public function readBoolean(): bool
public function readBoolean()
{
return (bool) $this->read(1);
}

/**
* Read an integer.
*/
public function readInteger(int $length = 1): int
public function readInteger(int $length = 1)
{
return (int) $this->read($length);
}

/**
* Read a float.
*/
public function readFloat(int $length = 1): float
public function readFloat(int $length = 1)
{
return (float) $this->read($length);
}
Expand All @@ -167,23 +167,23 @@ public function readFloat(int $length = 1): float
* Read an array.
* Alias of the $this->scanf() method.
*/
public function readArray(string $format = null): array
public function readArray(string $format = null)
{
return $this->scanf($format);
}

/**
* Read a line.
*/
public function readLine(): string
public function readLine()
{
return fgets($this->getStream());
}

/**
* Read all, i.e. read as much as possible.
*/
public function readAll(int $offset = 0): string
public function readAll(int $offset = 0)
{
return stream_get_contents($this->getStream(), -1, $offset);
}
Expand Down
18 changes: 9 additions & 9 deletions Source/Read.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public function eof(): bool
/**
* Read n characters.
*/
public function read(int $length): string
public function read(int $length)
{
if (0 > $length) {
throw new Exception(
Expand All @@ -121,39 +121,39 @@ public function read(int $length): string
/**
* Alias of $this->read().
*/
public function readString(int $length): string
public function readString(int $length)
{
return $this->read($length);
}

/**
* Read a character.
*/
public function readCharacter(): string
public function readCharacter()
{
return fgetc($this->getStream());
}

/**
* Read a boolean.
*/
public function readBoolean(): bool
public function readBoolean()
{
return (bool) $this->read(1);
}

/**
* Read an integer.
*/
public function readInteger(int $length = 1): int
public function readInteger(int $length = 1)
{
return (int) $this->read($length);
}

/**
* Read a float.
*/
public function readFloat(int $length = 1): float
public function readFloat(int $length = 1)
{
return (float) $this->read($length);
}
Expand All @@ -162,23 +162,23 @@ public function readFloat(int $length = 1): float
* Read an array.
* Alias of the $this->scanf() method.
*/
public function readArray(string $format = null): array
public function readArray(string $format = null)
{
return $this->scanf($format);
}

/**
* Read a line.
*/
public function readLine(): string
public function readLine()
{
return fgets($this->getStream());
}

/**
* Read all, i.e. read as much as possible.
*/
public function readAll(int $offset = 0): string
public function readAll(int $offset = 0)
{
return stream_get_contents($this->getStream(), -1, $offset);
}
Expand Down
18 changes: 9 additions & 9 deletions Source/ReadWrite.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public function eof(): bool
/**
* Read n characters.
*/
public function read(int $length): string
public function read(int $length)
{
if (0 > $length) {
throw new Exception(
Expand All @@ -125,39 +125,39 @@ public function read(int $length): string
/**
* Alias of $this->read().
*/
public function readString(int $length): string
public function readString(int $length)
{
return $this->read($length);
}

/**
* Read a character.
*/
public function readCharacter(): string
public function readCharacter()
{
return fgetc($this->getStream());
}

/**
* Read a boolean.
*/
public function readBoolean(): bool
public function readBoolean()
{
return (bool) $this->read(1);
}

/**
* Read an integer.
*/
public function readInteger(int $length = 1): int
public function readInteger(int $length = 1)
{
return (int) $this->read($length);
}

/**
* Read a float.
*/
public function readFloat(int $length = 1): float
public function readFloat(int $length = 1)
{
return (float) $this->read($length);
}
Expand All @@ -166,23 +166,23 @@ public function readFloat(int $length = 1): float
* Read an array.
* Alias of the $this->scanf() method.
*/
public function readArray(string $format = null): array
public function readArray(string $format = null)
{
return $this->scanf($format);
}

/**
* Read a line.
*/
public function readLine(): string
public function readLine()
{
return fgets($this->getStream());
}

/**
* Read all, i.e. read as much as possible.
*/
public function readAll(int $offset = 0): string
public function readAll(int $offset = 0)
{
return stream_get_contents($this->getStream(), -1, $offset);
}
Expand Down
Loading

0 comments on commit 4191464

Please sign in to comment.