Skip to content

Commit

Permalink
Formatted method argument spacing
Browse files Browse the repository at this point in the history
Signed-off-by: Tom Wright <[email protected]>
  • Loading branch information
betterthanclay committed Nov 3, 2023
1 parent 33f7a6c commit 4a13058
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 14 deletions.
5 changes: 3 additions & 2 deletions src/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ public static function parse(
*
* @param Ip|Block|string $block
*/
public function __construct(mixed $block)
{
public function __construct(
mixed $block
) {
$prefixLength = 0;

// Reparse block
Expand Down
15 changes: 9 additions & 6 deletions src/Ip.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,9 @@ public function __construct(
/**
* Convert string representation to BigInteger
*/
protected function parseString(string $ip): BigInteger
{
protected function parseString(
string $ip
): BigInteger {
// Number
if (ctype_digit($ip)) {
return BigInteger::of($ip);
Expand Down Expand Up @@ -233,8 +234,9 @@ protected function parseString(string $ip): BigInteger
/**
* Check address is within valid bounds
*/
protected function testBounds(BigInteger $ip): void
{
protected function testBounds(
BigInteger $ip
): void {
if ($ip->isLessThan(0)) {
throw Exceptional::InvalidArgument(
'IP integer value cannot be less than zero: ' . $ip
Expand All @@ -259,8 +261,9 @@ public function getVersion(): int
/**
* Set version
*/
public function setVersion(int $version): static
{
public function setVersion(
int $version
): static {
if ($version === 4) {
return $this->toV4();
} elseif ($version === 6) {
Expand Down
15 changes: 9 additions & 6 deletions src/Range.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ public static function parse(
*
* @param Ip|Scope|string|int|BigInteger $range
*/
public function __construct(mixed $range)
{
public function __construct(
mixed $range
) {
// Single IP
if (
is_int($range) ||
Expand Down Expand Up @@ -142,8 +143,9 @@ protected function setRange(
/**
* Parse hyphenated range
*/
protected function parseRange(string $range): void
{
protected function parseRange(
string $range
): void {
$parts = explode('-', $range, 2);

$this->setRange(
Expand All @@ -156,8 +158,9 @@ protected function parseRange(string $range): void
/**
* Parse + range
*/
protected function parsePlus(string $range): void
{
protected function parsePlus(
string $range
): void {
$parts = explode('+', $range, 2);

$this->setRange(
Expand Down

0 comments on commit 4a13058

Please sign in to comment.