Skip to content

Commit

Permalink
Replace __CLASS__ for class deprecations
Browse files Browse the repository at this point in the history
Signed-off-by: Kim Pepper <[email protected]>
  • Loading branch information
kimpepper committed Dec 19, 2024
1 parent 6dc6523 commit 273949b
Show file tree
Hide file tree
Showing 32 changed files with 34 additions and 32 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Changed fluent setters to return static
### Deprecated
- Passing a callable to \OpenSearch\ClientBuilder::setEndpoint() is deprecated and replaced with passing an EndpointFactory to \OpenSearch\ClientBuilder::setEndpointFactory() ([#237](https://github.com/opensearch-project/opensearch-php/pull/237))
- Connections, Connection pools and Selectors are deprecated. Use a PSR HTTP Client that supports retries instead.
### Removed
- Removed support for PHP 7.3 and 7.4
- Removed support for PHP 7.3, 7.4 and 8.0.
- Removed support for async requests which were never actually working.
### Fixed
- Fixed PHP 8.4 deprecations
### Updated APIs
Expand Down
2 changes: 1 addition & 1 deletion src/OpenSearch/ClientBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
use Psr\Log\NullLogger;
use ReflectionClass;

@trigger_error(__CLASS__ . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);
@trigger_error(ClientBuilder::class . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);

/**
* @deprecated in 2.3.2 and will be removed in 3.0.0.
Expand Down
2 changes: 1 addition & 1 deletion src/OpenSearch/Common/EmptyLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
use Psr\Log\AbstractLogger;
use Psr\Log\LoggerInterface;

@trigger_error(__CLASS__ . ' is deprecated in 2.3.2 and will be removed in 3.0.0. Use Psr\Log\NullLogger instead', E_USER_DEPRECATED);
@trigger_error(EmptyLogger::class . ' is deprecated in 2.3.2 and will be removed in 3.0.0. Use Psr\Log\NullLogger instead', E_USER_DEPRECATED);

/**
* Class EmptyLogger
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

namespace OpenSearch\Common\Exceptions;

@trigger_error(__CLASS__ . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);
@trigger_error(AuthenticationConfigException::class . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);

/**
* @deprecated in 2.3.2 and will be removed in 3.0.0.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

namespace OpenSearch\Common\Exceptions;

@trigger_error(__CLASS__ . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);
@trigger_error(BadRequest400Exception::class . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);

/**
* @deprecated in 2.3.2 and will be removed in 3.0.0.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

namespace OpenSearch\Common\Exceptions;

@trigger_error(__CLASS__ . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);
@trigger_error(ClientErrorResponseException::class . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);

/**
* @deprecated in 2.3.2 and will be removed in 3.0.0.
Expand Down
2 changes: 1 addition & 1 deletion src/OpenSearch/Common/Exceptions/Conflict409Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

namespace OpenSearch\Common\Exceptions;

@trigger_error(__CLASS__ . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);
@trigger_error(Conflict409Exception::class . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);

/**
* @deprecated in 2.3.2 and will be removed in 3.0.0.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
use OpenSearch\Common\Exceptions\OpenSearchException;
use OpenSearch\Common\Exceptions\TransportException;

@trigger_error(__CLASS__ . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);
@trigger_error(CouldNotConnectToHost::class . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);

/**
* @deprecated in 2.3.2 and will be removed in 3.0.0.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
use OpenSearch\Common\Exceptions\OpenSearchException;
use OpenSearch\Common\Exceptions\TransportException;

@trigger_error(__CLASS__ . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);
@trigger_error(CouldNotResolveHostException::class . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);

/**
* @deprecated in 2.3.2 and will be removed in 3.0.0.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
use OpenSearch\Common\Exceptions\OpenSearchException;
use OpenSearch\Common\Exceptions\TransportException;

@trigger_error(__CLASS__ . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);
@trigger_error(OperationTimeoutException::class . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);

/**
* @deprecated in 2.3.2 and will be removed in 3.0.0.
Expand Down
2 changes: 1 addition & 1 deletion src/OpenSearch/Common/Exceptions/Forbidden403Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

namespace OpenSearch\Common\Exceptions;

@trigger_error(__CLASS__ . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);
@trigger_error(Forbidden403Exception::class . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);

/**
* @deprecated in 2.3.2 and will be removed in 3.0.0.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

namespace OpenSearch\Common\Exceptions;

@trigger_error(__CLASS__ . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);
@trigger_error(InvalidArgumentException::class . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);

/**
* @deprecated in 2.3.2 and will be removed in 3.0.0.
Expand Down
2 changes: 1 addition & 1 deletion src/OpenSearch/Common/Exceptions/MaxRetriesException.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

namespace OpenSearch\Common\Exceptions;

@trigger_error(__CLASS__ . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);
@trigger_error(MaxRetriesException::class . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);

/**
* @deprecated in 2.3.2 and will be removed in 3.0.0.
Expand Down
2 changes: 1 addition & 1 deletion src/OpenSearch/Common/Exceptions/Missing404Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

namespace OpenSearch\Common\Exceptions;

@trigger_error(__CLASS__ . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);
@trigger_error(Missing404Exception::class . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);

/**
* @deprecated in 2.3.2 and will be removed in 3.0.0.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

namespace OpenSearch\Common\Exceptions;

@trigger_error(__CLASS__ . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);
@trigger_error(NoDocumentsToGetException::class . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);

/**
* @deprecated in 2.3.2 and will be removed in 3.0.0.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

namespace OpenSearch\Common\Exceptions;

@trigger_error(__CLASS__ . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);
@trigger_error(RequestTimeout408Exception::class . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);

/**
* @deprecated in 2.3.2 and will be removed in 3.0.0.
Expand Down
2 changes: 1 addition & 1 deletion src/OpenSearch/ConnectionPool/AbstractConnectionPool.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
use OpenSearch\Connections\ConnectionFactoryInterface;
use OpenSearch\Connections\ConnectionInterface;

@trigger_error(__CLASS__ . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);
@trigger_error(AbstractConnectionPool::class . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);

/**
* @deprecated in 2.3.2 and will be removed in 3.0.0.
Expand Down
2 changes: 1 addition & 1 deletion src/OpenSearch/ConnectionPool/ConnectionPoolInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

use OpenSearch\Connections\ConnectionInterface;

@trigger_error(__CLASS__ . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);
@trigger_error(ConnectionPoolInterface::class . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);

/**
* @deprecated in 2.3.2 and will be removed in 3.0.0.
Expand Down
2 changes: 1 addition & 1 deletion src/OpenSearch/ConnectionPool/Selectors/RandomSelector.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

use OpenSearch\Connections\ConnectionInterface;

@trigger_error(__CLASS__ . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);
@trigger_error(RandomSelector::class . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);

/**
* @deprecated in 2.3.2 and will be removed in 3.0.0.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

use OpenSearch\Connections\ConnectionInterface;

@trigger_error(__CLASS__ . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);
@trigger_error(RoundRobinSelector::class . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);

/**
* @deprecated in 2.3.2 and will be removed in 3.0.0.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

use OpenSearch\Connections\ConnectionInterface;

@trigger_error(__CLASS__ . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);
@trigger_error(SelectorInterface::class . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);

/**
* @deprecated in 2.3.2 and will be removed in 3.0.0.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

use OpenSearch\Connections\ConnectionInterface;

@trigger_error(__CLASS__ . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);
@trigger_error(StickyRoundRobinSelector::class . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);

/**
* @deprecated in 2.3.2 and will be removed in 3.0.0.
Expand Down
2 changes: 1 addition & 1 deletion src/OpenSearch/ConnectionPool/SimpleConnectionPool.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
use OpenSearch\Connections\ConnectionFactoryInterface;
use OpenSearch\Connections\ConnectionInterface;

@trigger_error(__CLASS__ . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);
@trigger_error(SimpleConnectionPool::class . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);

/**
* @deprecated in 2.3.2 and will be removed in 3.0.0.
Expand Down
2 changes: 1 addition & 1 deletion src/OpenSearch/ConnectionPool/SniffingConnectionPool.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
use OpenSearch\Connections\ConnectionFactoryInterface;
use OpenSearch\Connections\ConnectionInterface;

@trigger_error(__CLASS__ . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);
@trigger_error(SniffingConnectionPool::class . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);

/**
* @deprecated in 2.3.2 and will be removed in 3.0.0.
Expand Down
2 changes: 1 addition & 1 deletion src/OpenSearch/ConnectionPool/StaticConnectionPool.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
use OpenSearch\Connections\ConnectionFactoryInterface;
use OpenSearch\Connections\ConnectionInterface;

@trigger_error(__CLASS__ . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);
@trigger_error(StaticConnectionPool::class . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);

/**
* @deprecated in 2.3.2 and will be removed in 3.0.0.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
use OpenSearch\Connections\ConnectionFactoryInterface;
use OpenSearch\Connections\ConnectionInterface;

@trigger_error(__CLASS__ . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);
@trigger_error(StaticNoPingConnectionPool::class . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);

/**
* @deprecated in 2.3.2 and will be removed in 3.0.0.
Expand Down
2 changes: 1 addition & 1 deletion src/OpenSearch/Connections/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
use OpenSearch\Transport;
use Psr\Log\LoggerInterface;

@trigger_error(__CLASS__ . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);
@trigger_error(Connection::class . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);

/**
* @deprecated in 2.3.2 and will be removed in 3.0.0.
Expand Down
2 changes: 1 addition & 1 deletion src/OpenSearch/Connections/ConnectionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
use OpenSearch\Serializers\SerializerInterface;
use Psr\Log\LoggerInterface;

@trigger_error(__CLASS__ . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);
@trigger_error(ConnectionFactory::class . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);

/**
* @deprecated in 2.3.2 and will be removed in 3.0.0.
Expand Down
2 changes: 1 addition & 1 deletion src/OpenSearch/Connections/ConnectionFactoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

namespace OpenSearch\Connections;

@trigger_error(__CLASS__ . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);
@trigger_error(ConnectionFactoryInterface::class . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);

/**
* @deprecated in 2.3.2 and will be removed in 3.0.0.
Expand Down
2 changes: 1 addition & 1 deletion src/OpenSearch/Connections/ConnectionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

use OpenSearch\Transport;

@trigger_error(__CLASS__ . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);
@trigger_error(ConnectionInterface::class . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);

/**
* @deprecated in 2.3.2 and will be removed in 3.0.0.
Expand Down
2 changes: 1 addition & 1 deletion src/OpenSearch/Handlers/SigV4Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use Psr\Http\Message\RequestInterface;
use RuntimeException;

@trigger_error(__CLASS__ . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);
@trigger_error(SigV4Handler::class . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);

/**
* @phpstan-type RingPhpRequest array{http_method: string, scheme: string, uri: string, query_string?: string, version?: string, headers: array<string, list<string>>, body: string|resource|null, client?: array<string, mixed>}
Expand Down
2 changes: 1 addition & 1 deletion src/OpenSearch/Transport.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
use OpenSearch\Connections\ConnectionInterface;
use Psr\Log\LoggerInterface;

@trigger_error(__CLASS__ . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);
@trigger_error(Transport::class . ' is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);

/**
* @deprecated in 2.3.2 and will be removed in 3.0.0.
Expand Down

0 comments on commit 273949b

Please sign in to comment.