Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@
<directory name="vendor" />
</ignoreFiles>
</projectFiles>
<issueHandlers>
<UndefinedAttributeClass errorLevel="suppress" />
</issueHandlers>
</psalm>
4 changes: 4 additions & 0 deletions src/Control.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ private function __construct(
) {
}

#[\NoDiscard]
public static function of(Server $server): self
{
return new self(
Expand All @@ -28,16 +29,19 @@ public static function of(Server $server): self
);
}

#[\NoDiscard]
public function users(): Users
{
return $this->users;
}

#[\NoDiscard]
public function vhosts(): VHosts
{
return $this->vhosts;
}

#[\NoDiscard]
public function permissions(): Permissions
{
return $this->permissions;
Expand Down
3 changes: 3 additions & 0 deletions src/Control/Permissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ private function __construct(
) {
}

#[\NoDiscard]
public static function of(Server $server): self
{
return new self($server, Command::foreground('rabbitmqadmin'));
Expand All @@ -28,6 +29,7 @@ public static function of(Server $server): self
/**
* @return Attempt<SideEffect>
*/
#[\NoDiscard]
public function declare(
string $vhost,
string $user,
Expand Down Expand Up @@ -58,6 +60,7 @@ public function declare(
/**
* @return Attempt<SideEffect>
*/
#[\NoDiscard]
public function delete(string $vhost, string $user): Attempt
{
return $this
Expand Down
3 changes: 3 additions & 0 deletions src/Control/Users.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ private function __construct(
) {
}

#[\NoDiscard]
public static function of(Server $server): self
{
return new self($server, Command::foreground('rabbitmqadmin'));
Expand All @@ -28,6 +29,7 @@ public static function of(Server $server): self
/**
* @return Attempt<SideEffect>
*/
#[\NoDiscard]
public function declare(string $name, string $password, string ...$tags): Attempt
{
return $this
Expand All @@ -51,6 +53,7 @@ public function declare(string $name, string $password, string ...$tags): Attemp
/**
* @return Attempt<SideEffect>
*/
#[\NoDiscard]
public function delete(string $name): Attempt
{
return $this
Expand Down
3 changes: 3 additions & 0 deletions src/Control/VHosts.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ private function __construct(
) {
}

#[\NoDiscard]
public static function of(Server $server): self
{
return new self($server, Command::foreground('rabbitmqadmin'));
Expand All @@ -28,6 +29,7 @@ public static function of(Server $server): self
/**
* @return Attempt<SideEffect>
*/
#[\NoDiscard]
public function declare(string $name): Attempt
{
return $this
Expand All @@ -49,6 +51,7 @@ public function declare(string $name): Attempt
/**
* @return Attempt<SideEffect>
*/
#[\NoDiscard]
public function delete(string $name): Attempt
{
return $this
Expand Down
12 changes: 12 additions & 0 deletions src/Model/Channel.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ private function __construct(
*
* @param Maybe<PointInTime> $idleSince
*/
#[\NoDiscard]
public static function of(
Name $name,
VHost\Name $vhost,
Expand Down Expand Up @@ -66,51 +67,61 @@ public static function of(
);
}

#[\NoDiscard]
public function name(): Name
{
return $this->name;
}

#[\NoDiscard]
public function vhost(): VHost\Name
{
return $this->vhost;
}

#[\NoDiscard]
public function user(): User\Name
{
return $this->user;
}

#[\NoDiscard]
public function number(): int
{
return $this->number;
}

#[\NoDiscard]
public function node(): Node\Name
{
return $this->node;
}

#[\NoDiscard]
public function state(): State
{
return $this->state;
}

#[\NoDiscard]
public function messages(): Messages
{
return $this->messages;
}

#[\NoDiscard]
public function consumers(): Count
{
return $this->consumers;
}

#[\NoDiscard]
public function confirm(): bool
{
return $this->confirm;
}

#[\NoDiscard]
public function transactional(): bool
{
return $this->transactional;
Expand All @@ -119,6 +130,7 @@ public function transactional(): bool
/**
* @return Maybe<PointInTime>
*/
#[\NoDiscard]
public function idleSince(): Maybe
{
return $this->idleSince;
Expand Down
4 changes: 4 additions & 0 deletions src/Model/Channel/Messages.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ private function __construct(
/**
* @psalm-pure
*/
#[\NoDiscard]
public static function of(
Count $uncommitted,
Count $unconfirmed,
Expand All @@ -28,16 +29,19 @@ public static function of(
return new self($uncommitted, $unconfirmed, $unacknowledged);
}

#[\NoDiscard]
public function uncommitted(): Count
{
return $this->uncommitted;
}

#[\NoDiscard]
public function unconfirmed(): Count
{
return $this->unconfirmed;
}

#[\NoDiscard]
public function unacknowledged(): Count
{
return $this->unacknowledged;
Expand Down
2 changes: 2 additions & 0 deletions src/Model/Channel/Name.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ private function __construct(private string $value)
/**
* @psalm-pure
*/
#[\NoDiscard]
public static function of(string $value): self
{
return new self($value);
}

#[\NoDiscard]
public function toString(): string
{
return $this->value;
Expand Down
15 changes: 15 additions & 0 deletions src/Model/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ private function __construct(
/**
* @psalm-pure
*/
#[\NoDiscard]
public static function of(
Name $name,
PointInTime $connectedAt,
Expand Down Expand Up @@ -77,71 +78,85 @@ public static function of(
);
}

#[\NoDiscard]
public function name(): Name
{
return $this->name;
}

#[\NoDiscard]
public function connectedAt(): PointInTime
{
return $this->connectedAt;
}

#[\NoDiscard]
public function timeout(): Timeout
{
return $this->timeout;
}

#[\NoDiscard]
public function vhost(): VHost\Name
{
return $this->vhost;
}

#[\NoDiscard]
public function user(): User\Name
{
return $this->user;
}

#[\NoDiscard]
public function protocol(): Protocol
{
return $this->protocol;
}

#[\NoDiscard]
public function authenticationMechanism(): AuthenticationMechanism
{
return $this->authenticationMechanism;
}

#[\NoDiscard]
public function ssl(): bool
{
return $this->ssl;
}

#[\NoDiscard]
public function peer(): Peer
{
return $this->peer;
}

#[\NoDiscard]
public function host(): Host
{
return $this->host;
}

#[\NoDiscard]
public function port(): Port
{
return $this->port;
}

#[\NoDiscard]
public function node(): Node\Name
{
return $this->node;
}

#[\NoDiscard]
public function type(): Type
{
return $this->type;
}

#[\NoDiscard]
public function state(): State
{
return $this->state;
Expand Down
2 changes: 2 additions & 0 deletions src/Model/Connection/AuthenticationMechanism.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ enum AuthenticationMechanism
/**
* @psalm-pure
*/
#[\NoDiscard]
public static function of(string $value): self
{
return match ($value) {
Expand All @@ -24,6 +25,7 @@ public static function of(string $value): self
};
}

#[\NoDiscard]
public function toString(): string
{
return match ($this) {
Expand Down
2 changes: 2 additions & 0 deletions src/Model/Connection/Name.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ private function __construct(private string $value)
/**
* @psalm-pure
*/
#[\NoDiscard]
public static function of(string $value): self
{
return new self($value);
}

#[\NoDiscard]
public function toString(): string
{
return $this->value;
Expand Down
3 changes: 3 additions & 0 deletions src/Model/Connection/Peer.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,19 @@ private function __construct(
/**
* @psalm-pure
*/
#[\NoDiscard]
public static function of(Host $host, Port $port): self
{
return new self($host, $port);
}

#[\NoDiscard]
public function host(): Host
{
return $this->host;
}

#[\NoDiscard]
public function port(): Port
{
return $this->port;
Expand Down
1 change: 1 addition & 0 deletions src/Model/Connection/Protocol.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ enum Protocol
/**
* @psalm-pure
*/
#[\NoDiscard]
public static function of(string $value): self
{
return match ($value) {
Expand Down
2 changes: 2 additions & 0 deletions src/Model/Connection/Timeout.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ private function __construct(private int $value)
*
* @param int<0, max> $value
*/
#[\NoDiscard]
public static function of(int $value): self
{
return new self($value);
Expand All @@ -28,6 +29,7 @@ public static function of(int $value): self
/**
* @return int<0, max>
*/
#[\NoDiscard]
public function toInt(): int
{
return $this->value;
Expand Down
Loading
Loading