Skip to content

Commit

Permalink
Deprecate more unused classes (#264)
Browse files Browse the repository at this point in the history
Signed-off-by: Kim Pepper <[email protected]>
  • Loading branch information
kimpepper authored Jan 23, 2025
1 parent 7582a53 commit 079d337
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/OpenSearch/Helper/Iterators/SearchHitIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@

use Iterator;

// @phpstan-ignore classConstant.deprecatedClass
@trigger_error(SearchHitIterator::class . ' is deprecated in 2.4.0 and will be removed in 3.0.0.', E_USER_DEPRECATED);

/**
* @deprecated in 2.4.0 and will be removed in 3.0.0.
*/
class SearchHitIterator implements Iterator, \Countable
{
/**
Expand Down
6 changes: 6 additions & 0 deletions src/OpenSearch/Helper/Iterators/SearchResponseIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@
use OpenSearch\Client;
use Iterator;

// @phpstan-ignore classConstant.deprecatedClass
@trigger_error(SearchResponseIterator::class . ' is deprecated in 2.4.0 and will be removed in 3.0.0.', E_USER_DEPRECATED);

/**
* @deprecated in 2.4.0 and will be removed in 3.0.0.
*/
class SearchResponseIterator implements Iterator
{
/**
Expand Down
6 changes: 6 additions & 0 deletions src/OpenSearch/Serializers/ArrayToJSONSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,17 @@

use OpenSearch\Common\Exceptions\RuntimeException;

// @phpstan-ignore classConstant.deprecatedClass
@trigger_error(ArrayToJSONSerializer::class . ' is deprecated in 2.4.0 and will be removed in 3.0.0.', E_USER_DEPRECATED);

if (!defined('JSON_INVALID_UTF8_SUBSTITUTE')) {
//PHP < 7.2 Define it as 0 so it does nothing
define('JSON_INVALID_UTF8_SUBSTITUTE', 0);
}

/**
* @deprecated in 2.4.0 and will be removed in 3.0.0.
*/
class ArrayToJSONSerializer implements SerializerInterface
{
/**
Expand Down
6 changes: 6 additions & 0 deletions src/OpenSearch/Serializers/EverythingToJSONSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,17 @@

use OpenSearch\Common\Exceptions\RuntimeException;

// @phpstan-ignore classConstant.deprecatedClass
@trigger_error(EverythingToJSONSerializer::class . ' is deprecated in 2.4.0 and will be removed in 3.0.0.', E_USER_DEPRECATED);

if (!defined('JSON_INVALID_UTF8_SUBSTITUTE')) {
//PHP < 7.2 Define it as 0 so it does nothing
define('JSON_INVALID_UTF8_SUBSTITUTE', 0);
}

/**
* @deprecated in 2.4.0 and will be removed in 3.0.0.
*/
class EverythingToJSONSerializer implements SerializerInterface
{
/**
Expand Down
6 changes: 6 additions & 0 deletions tests/ClientBuilder/ArrayLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
use Psr\Log\LoggerInterface;
use Psr\Log\LogLevel;

// @phpstan-ignore classConstant.deprecatedClass
@trigger_error(ArrayLogger::class . ' is deprecated in 2.4.0 and will be removed in 3.0.0.', E_USER_DEPRECATED);

/**
* @deprecated in 2.4.0 and will be removed in 3.0.0.
*/
class ArrayLogger implements LoggerInterface
{
/**
Expand Down
1 change: 1 addition & 0 deletions tests/Helper/Iterators/SearchHitIteratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
/**
* Class SearchResponseIteratorTest
*
* @deprecated in 2.4.0 and will be removed in 3.0.0.
*/
class SearchHitIteratorTest extends \PHPUnit\Framework\TestCase
{
Expand Down
1 change: 1 addition & 0 deletions tests/Helper/Iterators/SearchResponseIteratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
/**
* Class SearchResponseIteratorTest
*
* @deprecated in 2.4.0 and will be removed in 3.0.0.
*/
class SearchResponseIteratorTest extends \PHPUnit\Framework\TestCase
{
Expand Down
1 change: 1 addition & 0 deletions tests/Serializers/ArrayToJSONSerializerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
/**
* Class ArrayToJSONSerializerTest
*
* @deprecated in 2.4.0 and will be removed in 3.0.0.
*/
class ArrayToJSONSerializerTest extends \PHPUnit\Framework\TestCase
{
Expand Down
1 change: 1 addition & 0 deletions tests/Serializers/EverythingToJSONSerializerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
/**
* Class EverythingToJSONSerializerTest
*
* @deprecated in 2.4.0 and will be removed in 3.0.0.
*/
class EverythingToJSONSerializerTest extends \PHPUnit\Framework\TestCase
{
Expand Down

0 comments on commit 079d337

Please sign in to comment.