Skip to content

Commit c205d08

Browse files
committed
Improve IDE intellisense
1 parent 8a1af62 commit c205d08

4 files changed

Lines changed: 23 additions & 2 deletions

File tree

src/Collections/MessageCollection.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@
22

33
namespace DirectoryTree\ImapEngine\Collections;
44

5-
use DirectoryTree\ImapEngine\Message;
65
use DirectoryTree\ImapEngine\MessageInterface;
76

87
/**
9-
* @template-extends PaginatedCollection<array-key, MessageInterface>
8+
* @template-extends PaginatedCollection<array-key, \DirectoryTree\ImapEngine\MessageInterface|\DirectoryTree\ImapEngine\Message>
109
*/
1110
class MessageCollection extends PaginatedCollection
1211
{
1312
/**
1413
* Find a message by its UID.
14+
*
15+
* @return \DirectoryTree\ImapEngine\Message|null
1516
*/
1617
public function find(int $uid): ?MessageInterface
1718
{
@@ -22,6 +23,8 @@ public function find(int $uid): ?MessageInterface
2223

2324
/**
2425
* Find a message by its UID or throw an exception.
26+
*
27+
* @return \DirectoryTree\ImapEngine\Message
2528
*/
2629
public function findOrFail(int $uid): MessageInterface
2730
{

src/Message.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,8 @@ public function copy(string $folder): ?int
313313

314314
/**
315315
* Move the message to the given folder.
316+
*
317+
* @throws ImapCapabilityException
316318
*/
317319
public function move(string $folder, bool $expunge = false): ?int
318320
{

src/MessageQuery.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ public function count(): int
4444

4545
/**
4646
* Get the first message in the resulting collection.
47+
*
48+
* @return Message|null
4749
*/
4850
public function first(): ?MessageInterface
4951
{
@@ -56,6 +58,8 @@ public function first(): ?MessageInterface
5658

5759
/**
5860
* Get the first message in the resulting collection or throw an exception.
61+
*
62+
* @return Message
5963
*/
6064
public function firstOrFail(): MessageInterface
6165
{
@@ -158,6 +162,8 @@ public function paginate(int $perPage = 5, $page = null, string $pageName = 'pag
158162

159163
/**
160164
* Find a message by the given identifier type or throw an exception.
165+
*
166+
* @return Message
161167
*/
162168
public function findOrFail(int $id, ImapFetchIdentifier $identifier = ImapFetchIdentifier::Uid): MessageInterface
163169
{
@@ -173,6 +179,8 @@ public function findOrFail(int $id, ImapFetchIdentifier $identifier = ImapFetchI
173179

174180
/**
175181
* Find a message by the given identifier type.
182+
*
183+
* @return Message|null
176184
*/
177185
public function find(int $id, ImapFetchIdentifier $identifier = ImapFetchIdentifier::Uid): ?MessageInterface
178186
{

src/MessageQueryInterface.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,15 @@ public function count(): int;
118118

119119
/**
120120
* Get the first message in the resulting collection.
121+
*
122+
* @return \DirectoryTree\ImapEngine\Message|null
121123
*/
122124
public function first(): ?MessageInterface;
123125

124126
/**
125127
* Get the first message in the resulting collection or throw an exception.
128+
*
129+
* @return \DirectoryTree\ImapEngine\Message
126130
*/
127131
public function firstOrFail(): MessageInterface;
128132

@@ -153,11 +157,15 @@ public function paginate(int $perPage = 5, $page = null, string $pageName = 'pag
153157

154158
/**
155159
* Find a message by the given identifier type or throw an exception.
160+
*
161+
* @return \DirectoryTree\ImapEngine\Message
156162
*/
157163
public function findOrFail(int $id, ImapFetchIdentifier $identifier = ImapFetchIdentifier::Uid): MessageInterface;
158164

159165
/**
160166
* Find a message by the given identifier type.
167+
*
168+
* @return \DirectoryTree\ImapEngine\Message|null
161169
*/
162170
public function find(int $id, ImapFetchIdentifier $identifier = ImapFetchIdentifier::Uid): ?MessageInterface;
163171

0 commit comments

Comments
 (0)