Skip to content

Commit

Permalink
Apply fixes from StyleCI (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-gribanov authored Mar 14, 2019
1 parent 2b03163 commit f493b3e
Show file tree
Hide file tree
Showing 15 changed files with 92 additions and 86 deletions.
16 changes: 8 additions & 8 deletions src/Date/DateInterval.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public static function fromString($string)
*
* @return bool
*/
public function equal(DateInterval $interval)
public function equal(self $interval)
{
return $this->comparator->equal($interval);
}
Expand All @@ -183,7 +183,7 @@ public function contains(\DateTime $point)
*
* @return bool
*/
public function intersects(DateInterval $interval)
public function intersects(self $interval)
{
return $this->comparator->intersects($interval);
}
Expand All @@ -195,7 +195,7 @@ public function intersects(DateInterval $interval)
*
* @return self|null
*/
public function intersection(DateInterval $interval)
public function intersection(self $interval)
{
return $this->comparator->intersection($interval);
}
Expand All @@ -207,7 +207,7 @@ public function intersection(DateInterval $interval)
*
* @return self
*/
public function cover(DateInterval $interval)
public function cover(self $interval)
{
return $this->comparator->cover($interval);
}
Expand All @@ -219,7 +219,7 @@ public function cover(DateInterval $interval)
*
* @return self|null
*/
public function gap(DateInterval $interval)
public function gap(self $interval)
{
return $this->comparator->gap($interval);
}
Expand All @@ -231,7 +231,7 @@ public function gap(DateInterval $interval)
*
* @return bool
*/
public function abuts(DateInterval $interval)
public function abuts(self $interval)
{
return $this->comparator->abuts($interval);
}
Expand All @@ -243,7 +243,7 @@ public function abuts(DateInterval $interval)
*
* @return self|null
*/
public function join(DateInterval $interval)
public function join(self $interval)
{
return $this->comparator->join($interval);
}
Expand All @@ -255,7 +255,7 @@ public function join(DateInterval $interval)
*
* @return self|null
*/
public function union(DateInterval $interval)
public function union(self $interval)
{
return $this->comparator->union($interval);
}
Expand Down
16 changes: 8 additions & 8 deletions src/DateTime/DateTimeInterval.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public static function fromString($string)
*
* @return bool
*/
public function equal(DateTimeInterval $interval)
public function equal(self $interval)
{
return $this->comparator->equal($interval);
}
Expand All @@ -183,7 +183,7 @@ public function contains(\DateTime $point)
*
* @return bool
*/
public function intersects(DateTimeInterval $interval)
public function intersects(self $interval)
{
return $this->comparator->intersects($interval);
}
Expand All @@ -195,7 +195,7 @@ public function intersects(DateTimeInterval $interval)
*
* @return self|null
*/
public function intersection(DateTimeInterval $interval)
public function intersection(self $interval)
{
return $this->comparator->intersection($interval);
}
Expand All @@ -207,7 +207,7 @@ public function intersection(DateTimeInterval $interval)
*
* @return self
*/
public function cover(DateTimeInterval $interval)
public function cover(self $interval)
{
return $this->comparator->cover($interval);
}
Expand All @@ -219,7 +219,7 @@ public function cover(DateTimeInterval $interval)
*
* @return self|null
*/
public function gap(DateTimeInterval $interval)
public function gap(self $interval)
{
return $this->comparator->gap($interval);
}
Expand All @@ -231,7 +231,7 @@ public function gap(DateTimeInterval $interval)
*
* @return bool
*/
public function abuts(DateTimeInterval $interval)
public function abuts(self $interval)
{
return $this->comparator->abuts($interval);
}
Expand All @@ -243,7 +243,7 @@ public function abuts(DateTimeInterval $interval)
*
* @return self|null
*/
public function join(DateTimeInterval $interval)
public function join(self $interval)
{
return $this->comparator->join($interval);
}
Expand All @@ -255,7 +255,7 @@ public function join(DateTimeInterval $interval)
*
* @return self|null
*/
public function union(DateTimeInterval $interval)
public function union(self $interval)
{
return $this->comparator->union($interval);
}
Expand Down
16 changes: 8 additions & 8 deletions src/IPv4/IPv4Interval.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public static function fromString($string)
*
* @return bool
*/
public function equal(IPv4Interval $interval)
public function equal(self $interval)
{
return $this->comparator->equal($interval);
}
Expand All @@ -180,7 +180,7 @@ public function contains($point)
*
* @return bool
*/
public function intersects(IPv4Interval $interval)
public function intersects(self $interval)
{
return $this->comparator->intersects($interval);
}
Expand All @@ -192,7 +192,7 @@ public function intersects(IPv4Interval $interval)
*
* @return self|null
*/
public function intersection(IPv4Interval $interval)
public function intersection(self $interval)
{
return $this->comparator->intersection($interval);
}
Expand All @@ -204,7 +204,7 @@ public function intersection(IPv4Interval $interval)
*
* @return self
*/
public function cover(IPv4Interval $interval)
public function cover(self $interval)
{
return $this->comparator->cover($interval);
}
Expand All @@ -216,7 +216,7 @@ public function cover(IPv4Interval $interval)
*
* @return self|null
*/
public function gap(IPv4Interval $interval)
public function gap(self $interval)
{
return $this->comparator->gap($interval);
}
Expand All @@ -228,7 +228,7 @@ public function gap(IPv4Interval $interval)
*
* @return bool
*/
public function abuts(IPv4Interval $interval)
public function abuts(self $interval)
{
return $this->comparator->abuts($interval);
}
Expand All @@ -240,7 +240,7 @@ public function abuts(IPv4Interval $interval)
*
* @return self|null
*/
public function join(IPv4Interval $interval)
public function join(self $interval)
{
return $this->comparator->join($interval);
}
Expand All @@ -252,7 +252,7 @@ public function join(IPv4Interval $interval)
*
* @return self|null
*/
public function union(IPv4Interval $interval)
public function union(self $interval)
{
return $this->comparator->union($interval);
}
Expand Down
6 changes: 3 additions & 3 deletions src/IPv4Network/IPv4Network.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public static function fromString($string)
*
* @return bool
*/
public function equal(IPv4Network $network)
public function equal(self $network)
{
return $this->comparator->equal($network);
}
Expand All @@ -144,7 +144,7 @@ public function contains($point)
*
* @return bool
*/
public function intersects(IPv4Network $network)
public function intersects(self $network)
{
return $this->comparator->intersects($network);
}
Expand All @@ -156,7 +156,7 @@ public function intersects(IPv4Network $network)
*
* @return bool
*/
public function abuts(IPv4Network $network)
public function abuts(self $network)
{
return $this->comparator->abuts($network);
}
Expand Down
2 changes: 1 addition & 1 deletion src/IPv4Network/IPv4NetworkMask.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public function cidr()
*
* @return bool
*/
public function equal(IPv4NetworkMask $mask)
public function equal(self $mask)
{
return $this->long == $mask->ip();
}
Expand Down
17 changes: 9 additions & 8 deletions src/IPv6/IPv6Interval.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ public static function fromString($string)
{
if (!preg_match(self::REGEXP, $string, $match)) {
$ipv6 = implode(':', array_fill(0, 8, 'ffff'));

throw InvalidIntervalFormatException::create(sprintf('[%s, %s]', $ipv6, $ipv6), $string);
}

Expand All @@ -157,7 +158,7 @@ public static function fromString($string)
*
* @return bool
*/
public function equal(IPv6Interval $interval)
public function equal(self $interval)
{
return $this->comparator->equal($interval);
}
Expand All @@ -181,7 +182,7 @@ public function contains($point)
*
* @return bool
*/
public function intersects(IPv6Interval $interval)
public function intersects(self $interval)
{
return $this->comparator->intersects($interval);
}
Expand All @@ -193,7 +194,7 @@ public function intersects(IPv6Interval $interval)
*
* @return self|null
*/
public function intersection(IPv6Interval $interval)
public function intersection(self $interval)
{
return $this->comparator->intersection($interval);
}
Expand All @@ -205,7 +206,7 @@ public function intersection(IPv6Interval $interval)
*
* @return self
*/
public function cover(IPv6Interval $interval)
public function cover(self $interval)
{
return $this->comparator->cover($interval);
}
Expand All @@ -217,7 +218,7 @@ public function cover(IPv6Interval $interval)
*
* @return self|null
*/
public function gap(IPv6Interval $interval)
public function gap(self $interval)
{
return $this->comparator->gap($interval);
}
Expand All @@ -229,7 +230,7 @@ public function gap(IPv6Interval $interval)
*
* @return bool
*/
public function abuts(IPv6Interval $interval)
public function abuts(self $interval)
{
return $this->comparator->abuts($interval);
}
Expand All @@ -241,7 +242,7 @@ public function abuts(IPv6Interval $interval)
*
* @return self|null
*/
public function join(IPv6Interval $interval)
public function join(self $interval)
{
return $this->comparator->join($interval);
}
Expand All @@ -253,7 +254,7 @@ public function join(IPv6Interval $interval)
*
* @return self|null
*/
public function union(IPv6Interval $interval)
public function union(self $interval)
{
return $this->comparator->union($interval);
}
Expand Down
7 changes: 4 additions & 3 deletions src/IPv6Network/IPv6Network.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ public static function fromString($string)
{
if (!preg_match(self::REGEXP, $string, $match)) {
$ipv6 = implode(':', array_fill(0, 8, 'ffff'));

throw InvalidIntervalFormatException::create($ipv6.'/128', $string);
}

Expand All @@ -130,7 +131,7 @@ public static function fromString($string)
*
* @return bool
*/
public function equal(IPv6Network $network)
public function equal(self $network)
{
return $this->comparator->equal($network);
}
Expand All @@ -154,7 +155,7 @@ public function contains($point)
*
* @return bool
*/
public function intersects(IPv6Network $network)
public function intersects(self $network)
{
return $this->comparator->intersects($network);
}
Expand All @@ -166,7 +167,7 @@ public function intersects(IPv6Network $network)
*
* @return bool
*/
public function abuts(IPv6Network $network)
public function abuts(self $network)
{
return $this->comparator->abuts($network);
}
Expand Down
Loading

0 comments on commit f493b3e

Please sign in to comment.