Skip to content

Commit

Permalink
Remove PHPDoc that does not add value
Browse files Browse the repository at this point in the history
  • Loading branch information
binsoul committed Apr 27, 2020
1 parent 323c347 commit c82fb29
Show file tree
Hide file tree
Showing 35 changed files with 18 additions and 443 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
"scripts": {
"test": "phpunit",
"fix-style": [
"php-cs-fixer fix src --rules=@Symfony,-yoda_style,-no_superfluous_phpdoc_tags",
"php-cs-fixer fix tests --rules=@Symfony,-yoda_style,-no_superfluous_phpdoc_tags"
"php-cs-fixer fix src --rules=@Symfony,-yoda_style",
"php-cs-fixer fix tests --rules=@Symfony,-yoda_style"
],
"analyze": "phpstan analyse -l 7 src"
},
Expand Down
2 changes: 0 additions & 2 deletions src/ClientIdentifierGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ interface ClientIdentifierGenerator
{
/**
* Generates a client identifier of up to 23 bytes.
*
* @return string
*/
public function generateClientIdentifier(): string;
}
32 changes: 0 additions & 32 deletions src/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,83 +9,51 @@
*/
interface Connection
{
/**
* @return int
*/
public function getProtocol(): int;

/**
* @return string
*/
public function getClientID(): string;

/**
* @return bool
*/
public function isCleanSession(): bool;

/**
* @return string
*/
public function getUsername(): string;

/**
* @return string
*/
public function getPassword(): string;

/**
* @return Message|null
*/
public function getWill(): ?Message;

/**
* @return int
*/
public function getKeepAlive(): int;

/**
* Returns a new connection with the given protocol.
*
* @param int $protocol
*
* @return self
*/
public function withProtocol(int $protocol): Connection;

/**
* Returns a new connection with the given client id.
*
* @param string $clientID
*
* @return self
*/
public function withClientID(string $clientID): Connection;

/**
* Returns a new connection with the given credentials.
*
* @param string $username
* @param string $password
*
* @return self
*/
public function withCredentials(string $username, string $password): Connection;

/**
* Returns a new connection with the given will.
*
* @param Message $will
*
* @return self
*/
public function withWill(Message $will): Connection;

/**
* Returns a new connection with the given keep alive timeout.
*
* @param int $timeout
*
* @return self
*/
public function withKeepAlive(int $timeout): Connection;
Expand Down
20 changes: 6 additions & 14 deletions src/DefaultConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,15 @@ class DefaultConnection implements Connection

/**
* Constructs an instance of this class.
*
* @param string $username
* @param string $password
* @param Message|null $will
* @param string $clientID
* @param int $keepAlive
* @param int $protocol
* @param bool $clean
*/
public function __construct(
$username = '',
$password = '',
string $username = '',
string $password = '',
Message $will = null,
$clientID = '',
$keepAlive = 60,
$protocol = 4,
$clean = true
string $clientID = '',
int $keepAlive = 60,
int $protocol = 4,
bool $clean = true
) {
$this->username = $username;
$this->password = $password;
Expand Down
4 changes: 0 additions & 4 deletions src/DefaultFlowFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ class DefaultFlowFactory implements FlowFactory

/**
* Constructs an instance of this class.
*
* @param ClientIdentifierGenerator $clientIdentifierGenerator
* @param PacketIdentifierGenerator $packetIdentifierGenerator
* @param PacketFactory $packetFactory
*/
public function __construct(
ClientIdentifierGenerator $clientIdentifierGenerator,
Expand Down
10 changes: 0 additions & 10 deletions src/DefaultMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@ class DefaultMessage implements Message

/**
* Constructs an instance of this class.
*
* @param string $topic
* @param string $payload
* @param int $qosLevel
* @param bool $retain
* @param bool $isDuplicate
*/
public function __construct(string $topic, string $payload = '', int $qosLevel = 0, bool $retain = false, bool $isDuplicate = false)
{
Expand Down Expand Up @@ -126,10 +120,6 @@ public function original(): Message
/**
* Asserts that the given quality of service level is valid.
*
* @param int $level
*
* @return void
*
* @throws InvalidArgumentException
*/
private function assertValidQosLevel(int $level): void
Expand Down
7 changes: 0 additions & 7 deletions src/DefaultSubscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ class DefaultSubscription implements Subscription

/**
* Constructs an instance of this class.
*
* @param string $filter
* @param int $qosLevel
*/
public function __construct(string $filter, int $qosLevel = 0)
{
Expand Down Expand Up @@ -59,10 +56,6 @@ public function withQosLevel(int $level): Subscription
/**
* Asserts that the given quality of service level is valid.
*
* @param int $level
*
* @return void
*
* @throws InvalidArgumentException
*/
private function assertValidQosLevel(int $level): void
Expand Down
10 changes: 0 additions & 10 deletions src/Flow.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ interface Flow
{
/**
* Returns the unique code.
*
* @return string
*/
public function getCode(): string;

Expand All @@ -31,8 +29,6 @@ public function start(): ?Packet;
* Indicates if the flow can handle the given packet.
*
* @param Packet $packet Packet to accept
*
* @return bool
*/
public function accept(Packet $packet): bool;

Expand All @@ -47,15 +43,11 @@ public function next(Packet $packet): ?Packet;

/**
* Indicates if the flow is finished.
*
* @return bool
*/
public function isFinished(): bool;

/**
* Indicates if the flow finished successfully.
*
* @return bool
*/
public function isSuccess(): bool;

Expand All @@ -68,8 +60,6 @@ public function getResult();

/**
* Returns an error message if the flow didn't finish successfully.
*
* @return string
*/
public function getErrorMessage(): string;
}
12 changes: 0 additions & 12 deletions src/Flow/AbstractFlow.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ abstract class AbstractFlow implements Flow

/**
* Constructs an instance of this class.
*
* @param PacketFactory $packetFactory
*/
public function __construct(PacketFactory $packetFactory)
{
Expand Down Expand Up @@ -69,8 +67,6 @@ public function getErrorMessage(): string
* Marks the flow as successful and sets the result.
*
* @param mixed|null $result
*
* @return void
*/
protected function succeed($result = null): void
{
Expand All @@ -81,10 +77,6 @@ protected function succeed($result = null): void

/**
* Marks the flow as failed and sets the error message.
*
* @param string $error
*
* @return void
*/
protected function fail(string $error = ''): void
{
Expand All @@ -94,10 +86,6 @@ protected function fail(string $error = ''): void
}

/**
* @param int $type
*
* @return Packet
*
* @throws UnknownPacketTypeException
*/
protected function generatePacket(int $type): Packet
Expand Down
6 changes: 1 addition & 5 deletions src/Flow/IncomingPublishFlow.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,8 @@ class IncomingPublishFlow extends AbstractFlow

/**
* Constructs an instance of this class.
*
* @param PacketFactory $packetFactory
* @param Message $message
* @param int|null $identifier
*/
public function __construct(PacketFactory $packetFactory, Message $message, $identifier = null)
public function __construct(PacketFactory $packetFactory, Message $message, ?int $identifier = null)
{
parent::__construct($packetFactory);

Expand Down
4 changes: 0 additions & 4 deletions src/Flow/OutgoingConnectFlow.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ class OutgoingConnectFlow extends AbstractFlow

/**
* Constructs an instance of this class.
*
* @param PacketFactory $packetFactory
* @param Connection $connection
* @param ClientIdentifierGenerator $generator
*/
public function __construct(PacketFactory $packetFactory, Connection $connection, ClientIdentifierGenerator $generator)
{
Expand Down
3 changes: 0 additions & 3 deletions src/Flow/OutgoingDisconnectFlow.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ class OutgoingDisconnectFlow extends AbstractFlow

/**
* Constructs an instance of this class.
*
* @param PacketFactory $packetFactory
* @param Connection $connection
*/
public function __construct(PacketFactory $packetFactory, Connection $connection)
{
Expand Down
4 changes: 0 additions & 4 deletions src/Flow/OutgoingPublishFlow.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ class OutgoingPublishFlow extends AbstractFlow

/**
* Constructs an instance of this class.
*
* @param PacketFactory $packetFactory
* @param Message $message
* @param PacketIdentifierGenerator $generator
*/
public function __construct(PacketFactory $packetFactory, Message $message, PacketIdentifierGenerator $generator)
{
Expand Down
4 changes: 1 addition & 3 deletions src/Flow/OutgoingSubscribeFlow.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ class OutgoingSubscribeFlow extends AbstractFlow
/**
* Constructs an instance of this class.
*
* @param PacketFactory $packetFactory
* @param Subscription[] $subscriptions
* @param PacketIdentifierGenerator $generator
* @param Subscription[] $subscriptions
*/
public function __construct(PacketFactory $packetFactory, array $subscriptions, PacketIdentifierGenerator $generator)
{
Expand Down
4 changes: 1 addition & 3 deletions src/Flow/OutgoingUnsubscribeFlow.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ class OutgoingUnsubscribeFlow extends AbstractFlow
/**
* Constructs an instance of this class.
*
* @param PacketFactory $packetFactory
* @param Subscription[] $subscriptions
* @param PacketIdentifierGenerator $generator
* @param Subscription[] $subscriptions
*/
public function __construct(PacketFactory $packetFactory, array $subscriptions, PacketIdentifierGenerator $generator)
{
Expand Down
Loading

0 comments on commit c82fb29

Please sign in to comment.