diff --git a/README.md b/README.md index 522367f..b571d84 100644 --- a/README.md +++ b/README.md @@ -42,36 +42,36 @@ use Gyron\Net2Web\Session; */ class AccessApiFactory { - /** - * @var string - */ - private $sCachePath; + /** + * @var string + */ + private $sCachePath; - /** - * @param string $sCachePath - */ - public function __construct( string $sCachePath ) { - $this->sCachePath = $sCachePath; - } + /** + * @param string $sCachePath + */ + public function __construct( string $sCachePath ) { + $this->sCachePath = $sCachePath; + } - /** - * @param array $aConfig requires user_id, password, ip and port - * @return Client - * @throws \Exception - */ - public function forConfig( array $aConfig ) { - $sCacheFile = sprintf( '%s/net2web_session.sid', rtrim( $this->sCachePath, '/' ) ); + /** + * @param array $aConfig requires user_id, password, ip and port + * @return Client + * @throws \Exception + */ + public function forConfig( array $aConfig ) { + $sCacheFile = sprintf( '%s/net2web_session.sid', rtrim( $this->sCachePath, '/' ) ); - $sSessionId = null; - if ( is_file( $sCacheFile ) ) { - $sSessionId = trim( file_get_contents( $sCacheFile ) ); - } + $sSessionId = null; + if ( is_file( $sCacheFile ) ) { + $sSessionId = trim( file_get_contents( $sCacheFile ) ); + } - $oNet2Session = new Session( $aConfig['user_id'], $aConfig['password'], $aConfig['ip'], (string)$aConfig['port'], $sSessionId ); - if ( $sSessionId != $oNet2Session->getSessionId() ) { - file_put_contents( $sCacheFile, trim( $oNet2Session->getSessionId() ) ); - } - return ( new Client( oNet2Session ) ); - } + $oNet2Session = new Session( $aConfig['user_id'], $aConfig['password'], $aConfig['ip'], (string)$aConfig['port'], $sSessionId ); + if ( $sSessionId != $oNet2Session->getSessionId() ) { + file_put_contents( $sCacheFile, trim( $oNet2Session->getSessionId() ) ); + } + return ( new Client( oNet2Session ) ); + } } ```