Skip to content

Commit b2ca6ae

Browse files
committed
Fix and simplify dockblocks by removing unnecessary fully qualified class names.
1 parent e4fcfa7 commit b2ca6ae

26 files changed

+155
-138
lines changed

src/Commands/AdminCommands/ChatsCommand.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
use Longman\TelegramBot\Commands\AdminCommand;
1414
use Longman\TelegramBot\DB;
1515
use Longman\TelegramBot\Entities\Chat;
16+
use Longman\TelegramBot\Entities\ServerResponse;
17+
use Longman\TelegramBot\Exception\TelegramException;
1618
use Longman\TelegramBot\Request;
1719

1820
class ChatsCommand extends AdminCommand
@@ -45,8 +47,8 @@ class ChatsCommand extends AdminCommand
4547
/**
4648
* Command execute method
4749
*
48-
* @return \Longman\TelegramBot\Entities\ServerResponse
49-
* @throws \Longman\TelegramBot\Exception\TelegramException
50+
* @return ServerResponse
51+
* @throws TelegramException
5052
*/
5153
public function execute()
5254
{

src/Commands/AdminCommands/CleanupCommand.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
use Longman\TelegramBot\Commands\AdminCommand;
1414
use Longman\TelegramBot\DB;
15+
use Longman\TelegramBot\Entities\ServerResponse;
1516
use Longman\TelegramBot\Exception\TelegramException;
1617
use Longman\TelegramBot\Request;
1718
use Longman\TelegramBot\TelegramLog;
@@ -338,7 +339,7 @@ private function getQueries($settings)
338339
/**
339340
* Execution if MySQL is required but not available
340341
*
341-
* @return \Longman\TelegramBot\Entities\ServerResponse
342+
* @return ServerResponse
342343
* @throws TelegramException
343344
*/
344345
public function executeNoDb()
@@ -358,8 +359,8 @@ public function executeNoDb()
358359
/**
359360
* Command execute method
360361
*
361-
* @return \Longman\TelegramBot\Entities\ServerResponse
362-
* @throws \Longman\TelegramBot\Exception\TelegramException
362+
* @return ServerResponse
363+
* @throws TelegramException
363364
*/
364365
public function execute()
365366
{

src/Commands/AdminCommands/DebugCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
use Longman\TelegramBot\Commands\AdminCommand;
1414
use Longman\TelegramBot\DB;
15+
use Longman\TelegramBot\Exception\TelegramException;
1516
use Longman\TelegramBot\Request;
1617

1718
/**
@@ -43,7 +44,7 @@ class DebugCommand extends AdminCommand
4344
* Command execute method
4445
*
4546
* @return mixed
46-
* @throws \Longman\TelegramBot\Exception\TelegramException
47+
* @throws TelegramException
4748
*/
4849
public function execute()
4950
{

src/Commands/AdminCommands/SendtoallCommand.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use Longman\TelegramBot\Commands\AdminCommand;
1414
use Longman\TelegramBot\Entities\Message;
1515
use Longman\TelegramBot\Entities\ServerResponse;
16+
use Longman\TelegramBot\Exception\TelegramException;
1617
use Longman\TelegramBot\Request;
1718

1819
/**
@@ -48,8 +49,8 @@ class SendtoallCommand extends AdminCommand
4849
/**
4950
* Execute command
5051
*
51-
* @return \Longman\TelegramBot\Entities\ServerResponse
52-
* @throws \Longman\TelegramBot\Exception\TelegramException
52+
* @return ServerResponse
53+
* @throws TelegramException
5354
*/
5455
public function execute()
5556
{

src/Commands/AdminCommands/SendtochannelCommand.php

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
use Longman\TelegramBot\Entities\Chat;
1616
use Longman\TelegramBot\Entities\Keyboard;
1717
use Longman\TelegramBot\Entities\Message;
18+
use Longman\TelegramBot\Entities\ServerResponse;
19+
use Longman\TelegramBot\Exception\TelegramException;
1820
use Longman\TelegramBot\Request;
1921

2022
class SendtochannelCommand extends AdminCommand
@@ -47,15 +49,15 @@ class SendtochannelCommand extends AdminCommand
4749
/**
4850
* Conversation Object
4951
*
50-
* @var \Longman\TelegramBot\Conversation
52+
* @var Conversation
5153
*/
5254
protected $conversation;
5355

5456
/**
5557
* Command execute method
5658
*
57-
* @return \Longman\TelegramBot\Entities\ServerResponse|mixed
58-
* @throws \Longman\TelegramBot\Exception\TelegramException
59+
* @return ServerResponse|mixed
60+
* @throws TelegramException
5961
*/
6062
public function execute()
6163
{
@@ -272,11 +274,11 @@ public function execute()
272274
* @todo This method will be moved to a higher level maybe in AdminCommand or Command
273275
* @todo Looking for a more significant name
274276
*
275-
* @param \Longman\TelegramBot\Entities\Message $message
276-
* @param array $data
277+
* @param Message $message
278+
* @param array $data
277279
*
278-
* @return \Longman\TelegramBot\Entities\ServerResponse
279-
* @throws \Longman\TelegramBot\Exception\TelegramException
280+
* @return ServerResponse
281+
* @throws TelegramException
280282
*/
281283
protected function sendBack(Message $message, array $data)
282284
{
@@ -311,12 +313,12 @@ protected function sendBack(Message $message, array $data)
311313
/**
312314
* Publish a message to a channel and return success or failure message in markdown format
313315
*
314-
* @param \Longman\TelegramBot\Entities\Message $message
315-
* @param string|int $channel_id
316-
* @param string|null $caption
316+
* @param Message $message
317+
* @param string|int $channel_id
318+
* @param string|null $caption
317319
*
318320
* @return string
319-
* @throws \Longman\TelegramBot\Exception\TelegramException
321+
* @throws TelegramException
320322
*/
321323
protected function publish(Message $message, $channel_id, $caption = null)
322324
{
@@ -351,7 +353,7 @@ protected function publish(Message $message, $channel_id, $caption = null)
351353
* @todo Why send just to the first found channel?
352354
*
353355
* @return mixed
354-
* @throws \Longman\TelegramBot\Exception\TelegramException
356+
* @throws TelegramException
355357
*/
356358
public function executeNoDb()
357359
{

src/Commands/AdminCommands/WhoisCommand.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
use Longman\TelegramBot\DB;
1717
use Longman\TelegramBot\Entities\Chat;
1818
use Longman\TelegramBot\Entities\PhotoSize;
19+
use Longman\TelegramBot\Entities\ServerResponse;
1920
use Longman\TelegramBot\Entities\UserProfilePhotos;
21+
use Longman\TelegramBot\Exception\TelegramException;
2022
use Longman\TelegramBot\Request;
2123

2224
/**
@@ -52,8 +54,8 @@ class WhoisCommand extends AdminCommand
5254
/**
5355
* Command execute method
5456
*
55-
* @return \Longman\TelegramBot\Entities\ServerResponse
56-
* @throws \Longman\TelegramBot\Exception\TelegramException
57+
* @return ServerResponse
58+
* @throws TelegramException
5759
*/
5860
public function execute()
5961
{

src/Commands/Command.php

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
use Longman\TelegramBot\Entities\Payments\PreCheckoutQuery;
1919
use Longman\TelegramBot\Entities\Payments\ShippingQuery;
2020
use Longman\TelegramBot\Entities\Poll;
21+
use Longman\TelegramBot\Entities\ServerResponse;
2122
use Longman\TelegramBot\Entities\Update;
23+
use Longman\TelegramBot\Exception\TelegramException;
2224
use Longman\TelegramBot\Request;
2325
use Longman\TelegramBot\Telegram;
2426

@@ -43,14 +45,14 @@ abstract class Command
4345
/**
4446
* Telegram object
4547
*
46-
* @var \Longman\TelegramBot\Telegram
48+
* @var Telegram
4749
*/
4850
protected $telegram;
4951

5052
/**
5153
* Update object
5254
*
53-
* @var \Longman\TelegramBot\Entities\Update
55+
* @var Update
5456
*/
5557
protected $update;
5658

@@ -120,8 +122,8 @@ abstract class Command
120122
/**
121123
* Constructor
122124
*
123-
* @param \Longman\TelegramBot\Telegram $telegram
124-
* @param \Longman\TelegramBot\Entities\Update $update
125+
* @param Telegram $telegram
126+
* @param Update $update
125127
*/
126128
public function __construct(Telegram $telegram, Update $update = null)
127129
{
@@ -133,9 +135,9 @@ public function __construct(Telegram $telegram, Update $update = null)
133135
/**
134136
* Set update object
135137
*
136-
* @param \Longman\TelegramBot\Entities\Update $update
138+
* @param Update $update
137139
*
138-
* @return \Longman\TelegramBot\Commands\Command
140+
* @return Command
139141
*/
140142
public function setUpdate(Update $update = null)
141143
{
@@ -149,8 +151,8 @@ public function setUpdate(Update $update = null)
149151
/**
150152
* Pre-execute command
151153
*
152-
* @return \Longman\TelegramBot\Entities\ServerResponse
153-
* @throws \Longman\TelegramBot\Exception\TelegramException
154+
* @return ServerResponse
155+
* @throws TelegramException
154156
*/
155157
public function preExecute()
156158
{
@@ -182,16 +184,16 @@ public function preExecute()
182184
/**
183185
* Execute command
184186
*
185-
* @return \Longman\TelegramBot\Entities\ServerResponse
186-
* @throws \Longman\TelegramBot\Exception\TelegramException
187+
* @return ServerResponse
188+
* @throws TelegramException
187189
*/
188190
abstract public function execute();
189191

190192
/**
191193
* Execution if MySQL is required but not available
192194
*
193-
* @return \Longman\TelegramBot\Entities\ServerResponse
194-
* @throws \Longman\TelegramBot\Exception\TelegramException
195+
* @return ServerResponse
196+
* @throws TelegramException
195197
*/
196198
public function executeNoDb()
197199
{
@@ -210,7 +212,7 @@ public function executeNoDb()
210212
/**
211213
* Get update object
212214
*
213-
* @return \Longman\TelegramBot\Entities\Update
215+
* @return Update
214216
*/
215217
public function getUpdate()
216218
{
@@ -260,7 +262,7 @@ public function getConfig($name = null)
260262
/**
261263
* Get telegram object
262264
*
263-
* @return \Longman\TelegramBot\Telegram
265+
* @return Telegram
264266
*/
265267
public function getTelegram()
266268
{
@@ -399,8 +401,8 @@ protected function removeNonPrivateMessage()
399401
* @param string $text
400402
* @param array $data
401403
*
402-
* @return \Longman\TelegramBot\Entities\ServerResponse
403-
* @throws \Longman\TelegramBot\Exception\TelegramException
404+
* @return ServerResponse
405+
* @throws TelegramException
404406
*/
405407
public function replyToChat($text, array $data = [])
406408
{
@@ -420,8 +422,8 @@ public function replyToChat($text, array $data = [])
420422
* @param string $text
421423
* @param array $data
422424
*
423-
* @return \Longman\TelegramBot\Entities\ServerResponse
424-
* @throws \Longman\TelegramBot\Exception\TelegramException
425+
* @return ServerResponse
426+
* @throws TelegramException
425427
*/
426428
public function replyToUser($text, array $data = [])
427429
{

src/Commands/SystemCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
namespace Longman\TelegramBot\Commands;
1212

13+
use Longman\TelegramBot\Entities\ServerResponse;
1314
use Longman\TelegramBot\Request;
1415

1516
abstract class SystemCommand extends Command
@@ -20,7 +21,7 @@ abstract class SystemCommand extends Command
2021
* Although system commands should just work and return a successful ServerResponse,
2122
* each system command can override this method to add custom functionality.
2223
*
23-
* @return \Longman\TelegramBot\Entities\ServerResponse
24+
* @return ServerResponse
2425
*/
2526
public function execute()
2627
{

src/Commands/SystemCommands/GenericCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
namespace Longman\TelegramBot\Commands\SystemCommands;
1212

1313
use Longman\TelegramBot\Commands\SystemCommand;
14+
use Longman\TelegramBot\Entities\ServerResponse;
1415

1516
/**
1617
* Generic command
@@ -35,7 +36,7 @@ class GenericCommand extends SystemCommand
3536
/**
3637
* Command execute method
3738
*
38-
* @return \Longman\TelegramBot\Entities\ServerResponse
39+
* @return ServerResponse
3940
*/
4041
public function execute()
4142
{

src/Commands/SystemCommands/GenericmessageCommand.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
use Longman\TelegramBot\Commands\SystemCommand;
1414
use Longman\TelegramBot\Conversation;
15+
use Longman\TelegramBot\Entities\ServerResponse;
16+
use Longman\TelegramBot\Exception\TelegramException;
1517
use Longman\TelegramBot\Request;
1618

1719
/**
@@ -42,7 +44,7 @@ class GenericmessageCommand extends SystemCommand
4244
/**
4345
* Execution if MySQL is required but not available
4446
*
45-
* @return \Longman\TelegramBot\Entities\ServerResponse
47+
* @return ServerResponse
4648
*/
4749
public function executeNoDb()
4850
{
@@ -53,8 +55,8 @@ public function executeNoDb()
5355
/**
5456
* Execute command
5557
*
56-
* @return \Longman\TelegramBot\Entities\ServerResponse
57-
* @throws \Longman\TelegramBot\Exception\TelegramException
58+
* @return ServerResponse
59+
* @throws TelegramException
5860
*/
5961
public function execute()
6062
{

0 commit comments

Comments
 (0)