DragonBe/vies

View on GitHub
src/Vies/HeartBeat.php

Summary

Maintainability
A
1 hr
Test Coverage

Method getSecuredResponse has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function getSecuredResponse(): array
    {
        $streamOptions = [
            'ssl' => [
                'verify_peer' => true,
Severity: Minor
Found in src/Vies/HeartBeat.php - About 1 hr to fix

    Missing class import via use statement (line '232', column '23').
    Open

                throw new \RuntimeException('Can not create socket stream: ' . $error);
    Severity: Minor
    Found in src/Vies/HeartBeat.php by phpmd

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    Missing class import via use statement (line '177', column '23').
    Open

                throw new \InvalidArgumentException('Expecting a resource to be provided');
    Severity: Minor
    Found in src/Vies/HeartBeat.php by phpmd

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    Reference to constant VIES_PROTO from undeclared class \DragonBe\Vies\Vies
    Open

            $uri = sprintf('%s://%s/', Vies::VIES_PROTO, $this->host);
    Severity: Critical
    Found in src/Vies/HeartBeat.php by phan

    Reference to constant VIES_PORT from undeclared class \DragonBe\Vies\Vies
    Open

        public function __construct(?string $host = null, int $port = Vies::VIES_PORT, int $timeout = self::DEFAULT_TIMEOUT)
    Severity: Critical
    Found in src/Vies/HeartBeat.php by phan

    There are no issues that match your filters.

    Category
    Status