Lines 100.00% 2 / 2
Functions and Methods 100.00% 2 / 2
Classes and Traits 100.00% 1 / 1
Name Lines Functions and Methods CRAP Classes and Traits
MqttClientException 100.00% 2 / 2 100.00% 2 / 2 2 100.00% 1 / 1
 packetMalformed 100.00% 1 / 1 100.00% 1 / 1 1
 packetUnexpected 100.00% 1 / 1 100.00% 1 / 1 1
1<?php
2
3declare(strict_types=1);
4
5namespace Stewart\Mqtt\Exception;
6
7use Stewart\Contracts\Exception\StewartException;
8
9/** @extends StewartException<MqttClientError> */
10final class MqttClientException extends StewartException
11{
12    public static function packetMalformed(string $packetType): self
13    {
14        return self::createForReason(MqttClientError::PacketMalformed, packetType: $packetType);
15    }
16
17    public static function packetUnexpected(string $packetType): self
18    {
19        return self::createForReason(MqttClientError::PacketUnexpected, packetType: $packetType);
20    }
21}