nopolabs/yabot

View on GitHub
src/Message/Message.php

Summary

Maintainability
A
35 mins
Test Coverage

Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

        Client $slackClient,
        array $data,
        string $formattedText,
        User $user = null,
        Channel $channel)
Severity: Minor
Found in src/Message/Message.php - About 35 mins to fix

    Return type of getChannel() is undeclared type \Slack\Channel
    Open

        public function getChannel() : Channel
    Severity: Minor
    Found in src/Message/Message.php by phan

    Property \Nopolabs\Yabot\Message\Message->channel has undeclared type \Slack\Channel
    Open

        private $channel;
    Severity: Minor
    Found in src/Message/Message.php by phan

    Assigning ?\Slack\User to property but \Nopolabs\Yabot\Message\Message->user is \Slack\User
    Open

            $this->user = $user;
    Severity: Minor
    Found in src/Message/Message.php by phan

    Parameter $user has undeclared type ?\Slack\User
    Open

        public function __construct(
    Severity: Minor
    Found in src/Message/Message.php by phan

    Reference to instance property data from undeclared class \Slack\User
    Open

                return (bool) $this->user->data['is_bot'];
    Severity: Minor
    Found in src/Message/Message.php by phan

    Parameter $channel has undeclared type \Slack\Channel
    Open

        public function __construct(
    Severity: Minor
    Found in src/Message/Message.php by phan

    Reference to instance property data from undeclared class \Slack\User
    Open

            if (isset($this->user->data['is_bot'])) {
    Severity: Minor
    Found in src/Message/Message.php by phan

    Call to method getUsername from undeclared class \Slack\User
    Open

            return $user ? $user->getUsername() : ($this->isBot() ? 'unknown-bot' : 'unknown-user');
    Severity: Critical
    Found in src/Message/Message.php by phan

    Call to method getName from undeclared class \Slack\Channel
    Open

            return $this->getChannel()->getName();
    Severity: Critical
    Found in src/Message/Message.php by phan

    Property \Nopolabs\Yabot\Message\Message->user has undeclared type \Slack\User
    Open

        private $user;
    Severity: Minor
    Found in src/Message/Message.php by phan

    Required argument follows optional
    Open

        public function __construct(
    Severity: Info
    Found in src/Message/Message.php by phan

    The closing parenthesis of a multi-line function declaration must be on a new line
    Open

            Channel $channel)
    Severity: Minor
    Found in src/Message/Message.php by phpcodesniffer

    The closing parenthesis and the opening brace of a multi-line function declaration must be on the same line
    Open

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

    Expected 1 newline at end of file; 0 found
    Open

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

    There are no issues that match your filters.

    Category
    Status