@@ -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 | { |
@@ -280,9 +280,9 @@ |
||
280 | 280 | $ucName = ucwords($entity->getName(), Command::PARTS_DELIMITER); |
281 | 281 | $name = str_replace(Command::PARTS_DELIMITER, '', $ucName); |
282 | 282 | |
283 | - $className = $this->config->getCommandNamespace() . "\\" . $name; |
|
283 | + $className = $this->config->getCommandNamespace()."\\".$name; |
|
284 | 284 | } elseif ($entity instanceof AbstractEntity) { |
285 | - $className = $this->config->getEntityEventNamespace() . "\\". $entity->getEntityType(); |
|
285 | + $className = $this->config->getEntityEventNamespace()."\\".$entity->getEntityType(); |
|
286 | 286 | } |
287 | 287 | |
288 | 288 | 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 @@ discard block |
||
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 | |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | |
77 | 77 | protected function getArgsFromText($command, $text) |
78 | 78 | { |
79 | - $length = strlen(static::PREFIX . $command); |
|
79 | + $length = strlen(static::PREFIX.$command); |
|
80 | 80 | |
81 | 81 | $argString = trim(substr($text, $length)); |
82 | 82 |
@@ -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 |
@@ -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 |
@@ -21,7 +21,7 @@ |
||
21 | 21 | protected function initFileForUpload() |
22 | 22 | { |
23 | 23 | if (!$this->isFileReadable($this->file)) { |
24 | - throw new Critical('File "' . $this->file . '" is not readable or does not exist!'); |
|
24 | + throw new Critical('File "'.$this->file.'" is not readable or does not exist!'); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | return new \CURLFile($this->file); |
@@ -90,13 +90,13 @@ |
||
90 | 90 | return null; |
91 | 91 | } |
92 | 92 | |
93 | - return $basePath . $this->file_path; |
|
93 | + return $basePath.$this->file_path; |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | public function download($storePath) |
97 | 97 | { |
98 | 98 | if (file_exists($storePath) && !is_writable($storePath)) { |
99 | - throw new Critical('File "' . $storePath . '" is already exist!"'); |
|
99 | + throw new Critical('File "'.$storePath.'" is already exist!"'); |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | $filePath = $this->getFullPath(); |
@@ -25,7 +25,7 @@ |
||
25 | 25 | */ |
26 | 26 | protected function getSetGetMethodName($prefix, $name) |
27 | 27 | { |
28 | - $setter = $prefix . str_replace("_", "", ucwords($name, "_")); |
|
28 | + $setter = $prefix.str_replace("_", "", ucwords($name, "_")); |
|
29 | 29 | |
30 | 30 | if (method_exists($this, $setter)) { |
31 | 31 | return $setter; |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | try { |
83 | 83 | if (!empty($botName)) { |
84 | 84 | $this->botDir = $this->getBotDir($botName); |
85 | - $botConfig = $this->botDir . static::CONFIG_FILENAME; |
|
85 | + $botConfig = $this->botDir.static::CONFIG_FILENAME; |
|
86 | 86 | |
87 | 87 | $this->setNamespaces($botName); |
88 | 88 | } |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | Output::log(new Fatal('Bot does not exist!')); |
119 | 119 | } |
120 | 120 | |
121 | - return realpath($dir) . "/"; |
|
121 | + return realpath($dir)."/"; |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | /** |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | protected function loadConfigFile($configFile) |
141 | 141 | { |
142 | 142 | if (!is_file($configFile) || !is_readable($configFile)) { |
143 | - Output::log(new Fatal('File "' . $configFile . '" does not exists or not readable!')); |
|
143 | + Output::log(new Fatal('File "'.$configFile.'" does not exists or not readable!')); |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | $config = file_get_contents($configFile); |
@@ -262,6 +262,6 @@ discard block |
||
262 | 262 | return null; |
263 | 263 | } |
264 | 264 | |
265 | - return $this->file_url . $this->token . '/'; |
|
265 | + return $this->file_url.$this->token.'/'; |
|
266 | 266 | } |
267 | 267 | } |
@@ -46,7 +46,7 @@ |
||
46 | 46 | echo sprintf( |
47 | 47 | $pattern, |
48 | 48 | $e->getMessage() |
49 | - ). "\n"; |
|
49 | + )."\n"; |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | if ($e instanceof Fatal) { |