@@ -193,7 +193,7 @@ |
||
193 | 193 | * @param bool $isCommand Boolean flag which indicates that passed entity should |
194 | 194 | * be treated as a command |
195 | 195 | * |
196 | - * @return bool |
|
196 | + * @return boolean|null |
|
197 | 197 | */ |
198 | 198 | protected function triggerEvent(AbstractEntity $entity, AbstractEntity $parent = null, $isCommand = false) |
199 | 199 | { |
@@ -276,7 +276,7 @@ |
||
276 | 276 | |
277 | 277 | $className = $this->config->getCommandNamespace() . "\\" . $name; |
278 | 278 | } elseif ($entity instanceof AbstractEntity) { |
279 | - $className = $this->config->getEntityEventNamespace() . "\\". $entity->getEntityType(); |
|
279 | + $className = $this->config->getEntityEventNamespace() . "\\" . $entity->getEntityType(); |
|
280 | 280 | } |
281 | 281 | |
282 | 282 | if ($className && class_exists($className)) { |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
45 | - * @return mixed |
|
45 | + * @return string |
|
46 | 46 | */ |
47 | 47 | public function getName() |
48 | 48 | { |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | } |
51 | 51 | |
52 | 52 | /** |
53 | - * @return mixed |
|
53 | + * @return string |
|
54 | 54 | */ |
55 | 55 | public function getArgs() |
56 | 56 | { |
@@ -76,6 +76,9 @@ discard block |
||
76 | 76 | return $command; |
77 | 77 | } |
78 | 78 | |
79 | + /** |
|
80 | + * @param string $command |
|
81 | + */ |
|
79 | 82 | protected function getArgsFromText($command, $text) |
80 | 83 | { |
81 | 84 | $length = strlen(static::PREFIX . $command); |
@@ -4,7 +4,7 @@ |
||
4 | 4 | |
5 | 5 | class Command extends AbstractEntity |
6 | 6 | { |
7 | - const ENTITY_TYPE = 'Command'; |
|
7 | + const ENTITY_TYPE = 'Command'; |
|
8 | 8 | |
9 | 9 | const PREFIX = '/'; |
10 | 10 |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | } |
52 | 52 | |
53 | 53 | /** |
54 | - * @param mixed $video_url |
|
54 | + * @param string $video_url |
|
55 | 55 | * |
56 | 56 | * @return $this |
57 | 57 | */ |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | } |
114 | 114 | |
115 | 115 | /** |
116 | - * @param mixed $message_text |
|
116 | + * @param string $message_text |
|
117 | 117 | * |
118 | 118 | * @return $this |
119 | 119 | */ |
@@ -315,7 +315,7 @@ |
||
315 | 315 | } |
316 | 316 | |
317 | 317 | /** |
318 | - * @return PhotoSizeArray |
|
318 | + * @return PhotoSize |
|
319 | 319 | */ |
320 | 320 | public function getPhoto() |
321 | 321 | { |
@@ -4,7 +4,7 @@ |
||
4 | 4 | |
5 | 5 | class Message extends AbstractEntity |
6 | 6 | { |
7 | - const ENTITY_TYPE = 'Message'; |
|
7 | + const ENTITY_TYPE = 'Message'; |
|
8 | 8 | |
9 | 9 | protected $messageType = self::ENTITY_TYPE; |
10 | 10 |
@@ -14,6 +14,9 @@ |
||
14 | 14 | |
15 | 15 | class Output |
16 | 16 | { |
17 | + /** |
|
18 | + * @param \Exception $e |
|
19 | + */ |
|
17 | 20 | public static function log($e) |
18 | 21 | { |
19 | 22 | $logFile = Executor::getInstance()->getConfig()->getLogFile(); |
@@ -40,7 +40,7 @@ |
||
40 | 40 | echo sprintf( |
41 | 41 | $pattern, |
42 | 42 | $e->getMessage() |
43 | - ). "\n"; |
|
43 | + ) . "\n"; |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | if ($e instanceof Fatal) { |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | * @param AbstractMethod $method Teebot method's instance to get arguments from |
56 | 56 | * @param null|AbstractEntity $parent Parent entity that initiated the Request |
57 | 57 | * |
58 | - * @return null|Response |
|
58 | + * @return Response |
|
59 | 59 | */ |
60 | 60 | public function exec(AbstractMethod $method, $parent = null) |
61 | 61 | { |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | * @param AbstractEntity $entityClass Entity that should be passed to Response constructor |
117 | 117 | * @param null|AbstractEntity $parent Parent entity |
118 | 118 | * |
119 | - * @return null|Response |
|
119 | + * @return Response |
|
120 | 120 | */ |
121 | 121 | public function createResponseFromData($receivedData, $entityClass, $parent = null) |
122 | 122 | { |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | * Returns url for request to Telegram's bot API |
136 | 136 | * |
137 | 137 | * @param string $methodName The name of Telegram's method to query |
138 | - * @param null|array $args Array of arguments to path to the method via GET string |
|
138 | + * @param string $args Array of arguments to path to the method via GET string |
|
139 | 139 | * |
140 | 140 | * @return string |
141 | 141 | */ |
@@ -1,9 +1,9 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * An example of how to run Teebot in webhook mode. |
|
4 | - * |
|
5 | - * @author Stan Drozdov <[email protected]> |
|
6 | - */ |
|
3 | + * An example of how to run Teebot in webhook mode. |
|
4 | + * |
|
5 | + * @author Stan Drozdov <[email protected]> |
|
6 | + */ |
|
7 | 7 | define('ROOT_DIR', realpath(__DIR__)); |
8 | 8 | require_once ROOT_DIR . '/vendor/autoload.php'; |
9 | 9 |
@@ -134,7 +134,7 @@ |
||
134 | 134 | { |
135 | 135 | foreach ($this->supportedProperties as $propertyName => $isRequired) { |
136 | 136 | if ($isRequired === true && empty($properties[$propertyName])) { |
137 | - throw new Critical('Required property "'.$propertyName.'" is not set!'); |
|
137 | + throw new Critical('Required property "' . $propertyName . '" is not set!'); |
|
138 | 138 | } |
139 | 139 | } |
140 | 140 | } |
@@ -4,7 +4,7 @@ |
||
4 | 4 | |
5 | 5 | class UserProfilePhotos extends AbstractEntity |
6 | 6 | { |
7 | - const ENTITY_TYPE = 'UserProfilePhotos'; |
|
7 | + const ENTITY_TYPE = 'UserProfilePhotos'; |
|
8 | 8 | |
9 | 9 | protected $total_count; |
10 | 10 |