Code Duplication    Length = 16-17 lines in 2 locations

PHPDaemon/Clients/AMQP/Driver/Exception/AMQPConnectionException.php 2 locations

@@ 75-90 (lines=16) @@
72
     * @param \Exception|null $previous The exception that caused this exception, if any.
73
     * @return AMQPConnectionException
74
     */
75
    public static function authenticationFailed(
76
        ConnectionOptions $options,
77
        \Exception $previous = null
78
    )
79
    {
80
        return new self(
81
            sprintf(
82
                'Unable to authenticate as "%s" on AMQP broker [%s:%d], check authentication credentials.',
83
                $options->getUsername(),
84
                $options->getHost(),
85
                $options->getPort()
86
            ),
87
            0,
88
            $previous
89
        );
90
    }
91
92
    /**
93
     * Create an exception that indicates a the AMQP handshake failed.
@@ 126-142 (lines=17) @@
123
     * @param \Exception|null $previous The exception that caused this exception, if any.
124
     * @return AMQPConnectionException
125
     */
126
    public static function authorizationFailed(
127
        ConnectionOptions $options,
128
        \Exception $previous = null
129
    )
130
    {
131
        return new self(
132
            sprintf(
133
                'Unable to access vhost "%s" as "%s" on AMQP broker [%s:%d], check permissions.',
134
                $options->getVhost(),
135
                $options->getUsername(),
136
                $options->getHost(),
137
                $options->getPort()
138
            ),
139
            0,
140
            $previous
141
        );
142
    }
143
144
    /**
145
     * Create an exception that indicates that the broker has failed to send