@@ -41,6 +41,9 @@ |
||
| 41 | 41 | ); |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | + /** |
|
| 45 | + * @param string|null $apiMethodName |
|
| 46 | + */ |
|
| 44 | 47 | public function request($apiMethodName, $requestOptions = []) |
| 45 | 48 | { |
| 46 | 49 | $method = static::METHOD_POST; |
@@ -23,6 +23,9 @@ |
||
| 23 | 23 | */ |
| 24 | 24 | protected $fileName; |
| 25 | 25 | |
| 26 | + /** |
|
| 27 | + * @param string $path |
|
| 28 | + */ |
|
| 26 | 29 | public function __construct($path) |
| 27 | 30 | { |
| 28 | 31 | $this->initEnv($path); |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | |
| 49 | 49 | protected function getFileName() |
| 50 | 50 | { |
| 51 | - $env = getenv('ENV') ? '_' . getenv('ENV') : ''; |
|
| 51 | + $env = getenv('ENV') ? '_'.getenv('ENV') : ''; |
|
| 52 | 52 | |
| 53 | 53 | return sprintf(static::FILE_NAME, $env); |
| 54 | 54 | } |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | |
| 39 | 39 | public function __construct(ConfigContainer $config) |
| 40 | 40 | { |
| 41 | - define('TEEBOT_ROOT', realpath(__DIR__ . '/../')); |
|
| 41 | + define('TEEBOT_ROOT', realpath(__DIR__.'/../')); |
|
| 42 | 42 | |
| 43 | 43 | $this->init($config); |
| 44 | 44 | } |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | if ($response instanceof Response) { |
| 98 | 98 | $offset = $response->getOffset(); |
| 99 | 99 | } |
| 100 | - } catch (\Exception $e){ |
|
| 100 | + } catch (\Exception $e) { |
|
| 101 | 101 | $this->logger->exception($e); |
| 102 | 102 | } |
| 103 | 103 | |
@@ -142,7 +142,7 @@ |
||
| 142 | 142 | $entity = null; |
| 143 | 143 | |
| 144 | 144 | if (!class_exists($entityClass)) { |
| 145 | - throw new BuildEntityException('Entity "' . $entityClass . '" does not exists or not supported yet!'); |
|
| 145 | + throw new BuildEntityException('Entity "'.$entityClass.'" does not exists or not supported yet!'); |
|
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | /** @var AbstractEntity $entity */ |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | public function __construct(ConfigContainer $config) |
| 22 | 22 | { |
| 23 | 23 | $this->config = $config; |
| 24 | - $filename = TEEBOT_ROOT . $this->config->get('logger.filename'); |
|
| 24 | + $filename = TEEBOT_ROOT.$this->config->get('logger.filename'); |
|
| 25 | 25 | $this->logger = new Monolog('Teebot'); |
| 26 | 26 | $this->logger->pushHandler( |
| 27 | 27 | new StreamHandler($filename, Monolog::WARNING) |
@@ -77,7 +77,7 @@ |
||
| 77 | 77 | public function download($storePath) |
| 78 | 78 | { |
| 79 | 79 | if (file_exists($storePath) && !is_writable($storePath)) { |
| 80 | - throw new EntityException('File "' . $storePath . '" is already exist!"'); |
|
| 80 | + throw new EntityException('File "'.$storePath.'" is already exist!"'); |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | $filePath = $this->getFilePath(); |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | protected function initFileForUpload() |
| 21 | 21 | { |
| 22 | 22 | if (!$this->isFileReadable($this->file)) { |
| 23 | - throw new EntityException('File "' . $this->file . '" is not readable or does not exist!'); |
|
| 23 | + throw new EntityException('File "'.$this->file.'" is not readable or does not exist!'); |
|
| 24 | 24 | } |
| 25 | 25 | return fopen($this->file, 'r'); |
| 26 | 26 | } |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | $replace = []; |
| 46 | 46 | |
| 47 | 47 | foreach ($tokens as $token) { |
| 48 | - $envKey = static::ENV_PREFIX . strtoupper(substr($token, 1, strlen($token) - 2)); |
|
| 48 | + $envKey = static::ENV_PREFIX.strtoupper(substr($token, 1, strlen($token) - 2)); |
|
| 49 | 49 | $envValue = getenv($envKey); |
| 50 | 50 | |
| 51 | 51 | if ($envValue) { |