Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate unused classes #264

Merged
merged 1 commit into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading