detain/iptools

View on GitHub
src/Range.php

Summary

Maintainability
B
6 hrs
Test Coverage

The class Range has 11 public methods. Consider refactoring Range to keep number of public methods under 10.
Open

class Range implements \Iterator, \Countable
{
    use PropertyTrait;

    /**
Severity: Minor
Found in src/Range.php by phpmd

TooManyPublicMethods

Since: 0.1

A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

By default it ignores methods starting with 'get' or 'set'.

Example

Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

The class Range has an overall complexity of 53 which is very high. The configured complexity threshold is 50.
Open

class Range implements \Iterator, \Countable
{
    use PropertyTrait;

    /**
Severity: Minor
Found in src/Range.php by phpmd

The method getNetworks() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10.
Open

    public function getNetworks()
    {
        $span = $this->getSpanNetwork();

        $networks = array();
Severity: Minor
Found in src/Range.php by phpmd

CyclomaticComplexity

Since: 0.1

Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

Example

// Cyclomatic Complexity = 11
class Foo {
1   public function example() {
2       if ($a == $b) {
3           if ($a1 == $b1) {
                fiddle();
4           } elseif ($a2 == $b2) {
                fiddle();
            } else {
                fiddle();
            }
5       } elseif ($c == $d) {
6           while ($c == $d) {
                fiddle();
            }
7        } elseif ($e == $f) {
8           for ($n = 0; $n < $h; $n++) {
                fiddle();
            }
        } else {
            switch ($z) {
9               case 1:
                    fiddle();
                    break;
10              case 2:
                    fiddle();
                    break;
11              case 3:
                    fiddle();
                    break;
                default:
                    fiddle();
                    break;
            }
        }
    }
}

Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

Avoid using static access to class 'IPTools\IP' in method 'getSpanNetwork'.
Open

        $ip = IP::parseBin(str_pad(substr($this->getFirstIP()->toBin(), 0, $prefixLength), $xorIP->getMaxPrefixLength(), '0'));
Severity: Minor
Found in src/Range.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class 'IPTools\IP' in method 'getSpanNetwork'.
Open

        $xorIP = IP::parseInAddr($this->getFirstIP()->inAddr() ^ $this->getLastIP()->inAddr());
Severity: Minor
Found in src/Range.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

The method contains uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            throw new RangeException('Invalid type');
        }
Severity: Minor
Found in src/Range.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

Avoid using static access to class 'IPTools\IP' in method 'parse'.
Open

            $firstIP = IP::parse($first);
Severity: Minor
Found in src/Range.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class 'IPTools\IP' in method 'parse'.
Open

            $lastIP  = IP::parse($last);
Severity: Minor
Found in src/Range.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class 'IPTools\Network' in method 'parse'.
Open

            $network = Network::parse($data);
Severity: Minor
Found in src/Range.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

The method parse uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $firstIP = IP::parse($data);
            $lastIP  = clone $firstIP;
        }
Severity: Minor
Found in src/Range.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

Avoid using static access to class 'IPTools\IP' in method 'parse'.
Open

            $firstIP = IP::parse($data);
Severity: Minor
Found in src/Range.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class 'IPTools\Network' in method 'getSpanNetwork'.
Open

        return new Network($ip, Network::prefix2netmask($prefixLength, $ip->getVersion()));
Severity: Minor
Found in src/Range.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class 'IPTools\IP' in method 'parse'.
Open

            $lastIP  = IP::parse(str_replace('*', '255', $data));
Severity: Minor
Found in src/Range.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

The method getNetworks uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            if ($span->getFirstIP()->inAddr() !== $this->firstIP->inAddr()) {
                $excluded = $span->exclude($this->firstIP->prev());
                foreach ($excluded as $network) {
                    if (strcmp($network->getFirstIP()->inAddr(), $this->firstIP->inAddr()) >= 0) {
Severity: Minor
Found in src/Range.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

Avoid using static access to class 'IPTools\IP' in method 'parse'.
Open

            $firstIP = IP::parse(str_replace('*', '0', $data));
Severity: Minor
Found in src/Range.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

The method getNetworks uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

                } else {
                    $excluded = array_pop($networks);
                    $excluded = $excluded->exclude($this->lastIP->next());
                }
Severity: Minor
Found in src/Range.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

Identical blocks of code found in 2 locations. Consider refactoring.
Open

            if ($find instanceof IP) {
                /**
                * @var IP $find
                */
                $within = (strcmp($find->inAddr(), $this->firstIP->inAddr()) >= 0)
Severity: Major
Found in src/Range.php and 1 other location - About 3 hrs to fix
src/Range.php on lines 101..113

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 144.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

            if ($find instanceof IP) {
                /**
                * @var IP $find
                */
                $within = (strcmp($find->inAddr(), $this->firstIP->inAddr()) >= 0)
Severity: Major
Found in src/Range.php and 1 other location - About 3 hrs to fix
src/Range.php on lines 131..143

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 144.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Avoid variables with short names like $ip. Configured minimum length is 3.
Open

        $ip = IP::parseBin(str_pad(substr($this->getFirstIP()->toBin(), 0, $prefixLength), $xorIP->getMaxPrefixLength(), '0'));
Severity: Minor
Found in src/Range.php by phpmd

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

Source https://phpmd.org/rules/naming.html#shortvariable

Avoid variables with short names like $ip. Configured minimum length is 3.
Open

    public function setFirstIP(IP $ip)
Severity: Minor
Found in src/Range.php by phpmd

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

Source https://phpmd.org/rules/naming.html#shortvariable

Avoid variables with short names like $ip. Configured minimum length is 3.
Open

    public function setLastIP(IP $ip)
Severity: Minor
Found in src/Range.php by phpmd

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

Source https://phpmd.org/rules/naming.html#shortvariable

Blank line found at end of control structure
Open


Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $firstIP = IP::parse($first);
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        }
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

             * @var Network|Range $find
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    {
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            } elseif ($find instanceof Range || $find instanceof Network) {
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        return false;
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    private $firstIP;
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        } elseif ($find instanceof Range || $find instanceof Network) {
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

             */
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        }
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function __construct(IP $firstIP, IP $lastIP)
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->setFirstIP($firstIP);
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        if ($find instanceof IP) {
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            * @var IP $find
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                /**
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        if (strpos($data,'/') || strpos($data,' ')) {
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $firstIP = $network->getFirstIP();
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                && (strcmp($find->inAddr(), $this->lastIP->inAddr()) <= 0);
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return bool
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        foreach ($findArray as $find) {
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->setLastIP($lastIP);
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param string $data
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return Range
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        return new self($firstIP, $lastIP);
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @throws RangeException
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    {
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            /**
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $within = (strcmp($find->getFirstIP()->inAddr(), $this->firstIP->inAddr()) >= 0)
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        } else {
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            if ($find instanceof IP) {
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                * @var IP $find
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                    && (strcmp($find->getLastIP()->inAddr(), $this->lastIP->inAddr()) <= 0);
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Same as contains but works on an array of IP|Network|Range and returns true if all of the array items are in the range 
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    {
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $lastIP  = IP::parse($last);
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        } else {
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $lastIP  = clone $firstIP;
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            /**
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                && (strcmp($find->getLastIP()->inAddr(), $this->lastIP->inAddr()) <= 0);
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * 
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        } elseif (strpos($data, '-')) {
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param IP|Network|Range $find
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                 * @var Network|Range $find
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Same as contains but works on an array of IP|Network|Range and returns true if any of the array items are in the range 
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            }
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                 */
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        }
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @var IP
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    {
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return bool
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                */
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            if ($within) {
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                return true;
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @var IP
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    private $lastIP;
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public static function parse($data)
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $firstIP = IP::parse($data);
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function contains($find)
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $lastIP  = IP::parse(str_replace('*', '255', $data));
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $within = (strcmp($find->inAddr(), $this->firstIP->inAddr()) >= 0)
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            list($first, $last) = explode('-', $data, 2);
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            throw new RangeException('Invalid type');
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                /**
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $lastIP  = $network->getLastIP();
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $firstIP = IP::parse(str_replace('*', '0', $data));
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param array $findArray
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                $within = (strcmp($find->inAddr(), $this->firstIP->inAddr()) >= 0)
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                    && (strcmp($find->inAddr(), $this->lastIP->inAddr()) <= 0);
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            }
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * 
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    use PropertyTrait;
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        return $within;
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @throws \Exception
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @var int
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                $within = (strcmp($find->getFirstIP()->inAddr(), $this->firstIP->inAddr()) >= 0)
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    private $position = 0;
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param IP $firstIP
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param IP $lastIP
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @throws RangeException
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $network = Network::parse($data);
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        } elseif (strpos($data, '*') !== false) {
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            */
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function containsAny($findArray)
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            throw new RangeException('First IP is grater than second');
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function setLastIP(IP $ip)
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                }
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                foreach ($excluded as $network) {
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    {
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        return true;
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            && $span->getLastIP()->inAddr() === $this->lastIP->inAddr()
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            }
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            }
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    {
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        return $this->firstIP->next($this->position);
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    #[ReturnTypeWillChange]
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function getFirstIP()
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                    if (strcmp($network->getFirstIP()->inAddr(), $this->firstIP->inAddr()) >= 0) {
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                    }
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $xorIP = IP::parseInAddr($this->getFirstIP()->inAddr() ^ $this->getLastIP()->inAddr());
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    #[ReturnTypeWillChange]
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                $within = (strcmp($find->inAddr(), $this->firstIP->inAddr()) >= 0)
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                /**
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param IP $ip
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        }
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        ) {
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function containsAll($findArray)
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                        break;
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    {
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $ip = IP::parseBin(str_pad(substr($this->getFirstIP()->toBin(), 0, $prefixLength), $xorIP->getMaxPrefixLength(), '0'));
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function current()
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        return $this->lastIP;
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function next()
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        if ($span->getFirstIP()->inAddr() === $this->firstIP->inAddr()
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                $excluded = $span->exclude($this->firstIP->prev());
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                }
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return Network
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $prefixLength = strlen($match[1]);
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function valid()
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        foreach ($findArray as $find) {
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            if (!$within) {
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            }
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @throws RangeException
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    {
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return bool
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                return false;
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function setFirstIP(IP $ip)
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                    $networks[] = $network;
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    #[ReturnTypeWillChange]
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    {
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        }
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        if ($this->lastIP && strcmp($ip->inAddr(), $this->lastIP->inAddr()) > 0) {
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                    if ($network->getLastIP()->inAddr() === $this->lastIP->inAddr()) {
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function getSpanNetwork()
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return IP
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function getNetworks()
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                    $excluded = $excluded->exclude($this->lastIP->next());
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        return $networks;
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    #[ReturnTypeWillChange]
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    {
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        ++$this->position;
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        return strcmp($this->firstIP->next($this->position)->inAddr(), $this->lastIP->inAddr()) <= 0;
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param array $findArray
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                */
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                 * @var Network|Range $find
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                $within = (strcmp($find->getFirstIP()->inAddr(), $this->firstIP->inAddr()) >= 0)
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param IP $ip
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $networks = array();
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $networks = array($span);
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                foreach ($excluded as $network) {
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                    $excluded = $span->exclude($this->lastIP->next());
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        preg_match('/^(0*)/', $xorIP->toBin(), $match);
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    {
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->position = 0;
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return int
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    #[ReturnTypeWillChange]
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                /**
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                * @var IP $find
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @throws RangeException
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->lastIP = $ip;
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    {
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    #[ReturnTypeWillChange]
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    {
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return IP
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return int
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        return $this->position;
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function rewind()
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return bool
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            if ($find instanceof IP) {
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                    && (strcmp($find->inAddr(), $this->lastIP->inAddr()) <= 0);
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                    && (strcmp($find->getLastIP()->inAddr(), $this->lastIP->inAddr()) <= 0);
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        if ($this->firstIP && strcmp($ip->inAddr(), $this->firstIP->inAddr()) < 0) {
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return IP
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return Network[]
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        } else {
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                        $networks[] = $network;
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        }
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function key()
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            }
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->firstIP = $ip;
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            throw new RangeException('Last IP is less than first');
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $span = $this->getSpanNetwork();
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                } else {
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        return new Network($ip, Network::prefix2netmask($prefixLength, $ip->getVersion()));
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @throws \Exception
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                 */
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    {
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        return $this->firstIP;
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function getLastIP()
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    {
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                    }
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                    $excluded = array_pop($networks);
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                }
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            } elseif ($find instanceof Range || $find instanceof Network) {
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        }
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            if ($span->getFirstIP()->inAddr() !== $this->firstIP->inAddr()) {
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            if ($span->getLastIP()->inAddr() !== $this->lastIP->inAddr()) {
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                if (!$networks) {
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    {
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    {
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function count()
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in src/Range.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        return (integer)bcadd(bcsub($this->lastIP->toLong(), $this->firstIP->toLong()), 1);
Severity: Minor
Found in src/Range.php by phpcodesniffer

Whitespace found at end of line
Open

     * Same as contains but works on an array of IP|Network|Range and returns true if any of the array items are in the range 
Severity: Minor
Found in src/Range.php by phpcodesniffer

Whitespace found at end of line
Open

     * Same as contains but works on an array of IP|Network|Range and returns true if all of the array items are in the range 
Severity: Minor
Found in src/Range.php by phpcodesniffer

Whitespace found at end of line
Open

     * 
Severity: Minor
Found in src/Range.php by phpcodesniffer

No space found after comma in function call
Open

        if (strpos($data,'/') || strpos($data,' ')) {
Severity: Minor
Found in src/Range.php by phpcodesniffer

No space found after comma in function call
Open

        if (strpos($data,'/') || strpos($data,' ')) {
Severity: Minor
Found in src/Range.php by phpcodesniffer

Whitespace found at end of line
Open

     * 
Severity: Minor
Found in src/Range.php by phpcodesniffer

There are no issues that match your filters.

Category
Status