Skip to content

Commit

Permalink
Drop PHP 7.3 support
Browse files Browse the repository at this point in the history
  • Loading branch information
simPod committed Nov 14, 2020
1 parent 0130d35 commit 15ab946
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 52 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"sort-packages": true
},
"require": {
"php": "^7.3 || ^8.0",
"php": "^7.4 || ^8.0",
"psr/log": "^1.1",
"roave/you-are-using-it-wrong": "^1.4"
},
Expand Down
4 changes: 1 addition & 3 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
<file>src</file>
<file>tests</file>

<rule ref="Cdn77">
<exclude name="SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint" />
</rule>
<rule ref="Cdn77" />

<rule ref="Generic.Formatting.MultipleStatementAlignment" />
<rule ref="Squiz.Commenting.FunctionComment.SpacingAfterParamType" />
Expand Down
6 changes: 2 additions & 4 deletions src/Exception/GeneralException.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@
// phpcs:ignore SlevomatCodingStandard.Classes.SuperfluousExceptionNaming.SuperfluousSuffix
final class GeneralException extends RuntimeException implements SnmpException
{
/** @var string|null */
public $host;
public ?string $host = null;

/** @var string|null */
public $oids;
public ?string $oids = null;

/** @param list<string> $oids */
public static function new(
Expand Down
6 changes: 2 additions & 4 deletions src/Exception/RequestException.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@

abstract class RequestException extends RuntimeException implements SnmpException
{
/** @var string */
public $host;
public string $host;

/** @var string|null */
public $oids;
public ?string $oids = null;
}
27 changes: 9 additions & 18 deletions src/Transport/ApiSnmpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,32 +32,23 @@ final class ApiSnmpClient implements SnmpClient
{
private const API_PATH = '/snmp-proxy';

/** @var ClientInterface */
private $client;
private ClientInterface $client;

/** @var RequestFactoryInterface */
private $requestFactory;
private RequestFactoryInterface $requestFactory;

/** @var StreamFactoryInterface */
private $streamFactory;
private StreamFactoryInterface $streamFactory;

/** @var string */
private $apiHostUrl;
private string $apiHostUrl;

/** @var string */
private $host;
private string $host;

/** @var string */
private $community;
private string $community;

/** @var int */
private $timeout;
private int $timeout;

/** @var int */
private $retries;
private int $retries;

/** @var string */
private $version;
private string $version;

public function __construct(
ClientInterface $client,
Expand Down
3 changes: 1 addition & 2 deletions src/Transport/Cli/SymfonyProcessProcessExecutor.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@

final class SymfonyProcessProcessExecutor implements ProcessExecutor
{
/** @var int */
private $commandTimeout;
private int $commandTimeout;

public function __construct(int $commandTimeout)
{
Expand Down
11 changes: 4 additions & 7 deletions src/Transport/CliSnmpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,14 @@ final class CliSnmpClient implements SnmpClient
{
use SimpleBatch;

/** @var ProcessExecutor */
private $processExecutor;
private ProcessExecutor $processExecutor;

/** @var string[] */
private $processArgs;
private array $processArgs;

/** @var string */
private $host;
private string $host;

/** @var bool */
private $useBulk;
private bool $useBulk;

public function __construct(
string $host = '127.0.0.1',
Expand Down
6 changes: 2 additions & 4 deletions src/Transport/ExtensionSnmpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@ final class ExtensionSnmpClient implements SnmpClient
{
use SimpleBatch;

/** @var SNMP */
private $snmp;
private SNMP $snmp;

/** @var string */
private $host;
private string $host;

public function __construct(
string $host = '127.0.0.1',
Expand Down
5 changes: 2 additions & 3 deletions src/Transport/FallbackSnmpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@

final class FallbackSnmpClient implements SnmpClient
{
/** @var LoggerInterface */
private $logger;
private LoggerInterface $logger;

/** @var iterable<SnmpClient> */
private $snmpClients;
private iterable $snmpClients;

/** @param iterable<SnmpClient> $snmpClients */
public function __construct(LoggerInterface $logger, iterable $snmpClients)
Expand Down
6 changes: 2 additions & 4 deletions src/Transport/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@ final class Request
public const GET_NEXT = 'getNext';
public const WALK = 'walk';

/** @var string */
public $type;
public string $type;

/** @var list<string> */
public $oids;

/** @var int|null */
public $maxRepetitions;
public ?int $maxRepetitions = null;

/** @param list<string> $oids */
private function __construct(string $type, array $oids, ?int $maxRepetitions = null)
Expand Down
3 changes: 1 addition & 2 deletions tests/Transport/SimpleBatchTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,7 @@ private function createBatchSnmpClient(SnmpClient $snmpClient) : SnmpClient
return new class ($snmpClient) implements SnmpClient {
use SimpleBatch;

/** @var SnmpClient */
private $snmpClient;
private SnmpClient $snmpClient;

public function __construct(SnmpClient $snmpClient)
{
Expand Down

0 comments on commit 15ab946

Please sign in to comment.