Browse Source

returnes changed in interfaces

tags/0.6
Paul Rock 7 years ago
parent
commit
5ef350b8de
  1. 12
      src/Interfaces/ClientInterface.php
  2. 31
      src/Interfaces/ConfigInterface.php

12
src/Interfaces/ClientInterface.php

@ -2,10 +2,14 @@
namespace RouterOS\Interfaces; namespace RouterOS\Interfaces;
use RouterOS\Client;
use RouterOS\Query;
/** /**
* Interface ClientInterface * Interface ClientInterface
*
* @package RouterOS\Interfaces * @package RouterOS\Interfaces
* @since 0.1
* @since 0.1
*/ */
interface ClientInterface interface ClientInterface
{ {
@ -62,8 +66,8 @@ interface ClientInterface
/** /**
* Send write query to RouterOS (with or without tag) * Send write query to RouterOS (with or without tag)
* *
* @param QueryInterface $query
* @return ClientInterface
* @param Query $query
* @return Client
*/ */
public function write(QueryInterface $query): ClientInterface;
public function write(Query $query): Client;
} }

31
src/Interfaces/ConfigInterface.php

@ -2,10 +2,13 @@
namespace RouterOS\Interfaces; namespace RouterOS\Interfaces;
use RouterOS\Config;
/** /**
* Interface ConfigInterface * Interface ConfigInterface
*
* @package RouterOS\Interfaces * @package RouterOS\Interfaces
* @since 0.2
* @since 0.2
*/ */
interface ConfigInterface interface ConfigInterface
{ {
@ -14,41 +17,41 @@ interface ConfigInterface
*/ */
const ALLOWED = [ const ALLOWED = [
// Address of Mikrotik RouterOS // Address of Mikrotik RouterOS
'host' => 'string',
'host' => 'string',
// Username // Username
'user' => 'string',
'user' => 'string',
// Password // Password
'pass' => 'string',
'pass' => 'string',
// RouterOS API port number for access (if not set use default or default with SSL if SSL enabled) // RouterOS API port number for access (if not set use default or default with SSL if SSL enabled)
'port' => 'integer',
'port' => 'integer',
// Enable ssl support (if port is not set this parameter must change default port to ssl port) // Enable ssl support (if port is not set this parameter must change default port to ssl port)
'ssl' => 'boolean',
'ssl' => 'boolean',
// Support of legacy login scheme (true - pre 6.43, false - post 6.43) // Support of legacy login scheme (true - pre 6.43, false - post 6.43)
'legacy' => 'boolean',
'legacy' => 'boolean',
// Max timeout for answer from RouterOS // Max timeout for answer from RouterOS
'timeout' => 'integer',
'timeout' => 'integer',
// Count of attempts to establish TCP session // Count of attempts to establish TCP session
'attempts' => 'integer', 'attempts' => 'integer',
// Delay between attempts in seconds // Delay between attempts in seconds
'delay' => 'integer',
'delay' => 'integer',
]; ];
/** /**
* Set parameter into array * Set parameter into array
* *
* @param string $name * @param string $name
* @param mixed $value
* @return ConfigInterface
* @param mixed $value
* @return Config
*/ */
public function set(string $name, $value): ConfigInterface;
public function set(string $name, $value): Config;
/** /**
* Remove parameter from array by name * Remove parameter from array by name
* *
* @param string $parameter * @param string $parameter
* @return ConfigInterface
* @return Config
*/ */
public function delete(string $parameter): ConfigInterface;
public function delete(string $parameter): Config;
/** /**
* Return parameter of current config by name * Return parameter of current config by name

Loading…
Cancel
Save