diff --git a/src/OpenSearch/Helper/Iterators/SearchHitIterator.php b/src/OpenSearch/Helper/Iterators/SearchHitIterator.php index 84ca74630..aa00504f8 100644 --- a/src/OpenSearch/Helper/Iterators/SearchHitIterator.php +++ b/src/OpenSearch/Helper/Iterators/SearchHitIterator.php @@ -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 { /** diff --git a/src/OpenSearch/Helper/Iterators/SearchResponseIterator.php b/src/OpenSearch/Helper/Iterators/SearchResponseIterator.php index ec6e8e5d8..7d605ca77 100644 --- a/src/OpenSearch/Helper/Iterators/SearchResponseIterator.php +++ b/src/OpenSearch/Helper/Iterators/SearchResponseIterator.php @@ -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 { /** diff --git a/src/OpenSearch/Serializers/ArrayToJSONSerializer.php b/src/OpenSearch/Serializers/ArrayToJSONSerializer.php index de119fa58..6237258fa 100644 --- a/src/OpenSearch/Serializers/ArrayToJSONSerializer.php +++ b/src/OpenSearch/Serializers/ArrayToJSONSerializer.php @@ -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 { /** diff --git a/src/OpenSearch/Serializers/EverythingToJSONSerializer.php b/src/OpenSearch/Serializers/EverythingToJSONSerializer.php index fc1c40515..e0f1359e2 100644 --- a/src/OpenSearch/Serializers/EverythingToJSONSerializer.php +++ b/src/OpenSearch/Serializers/EverythingToJSONSerializer.php @@ -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 { /** diff --git a/tests/ClientBuilder/ArrayLogger.php b/tests/ClientBuilder/ArrayLogger.php index 68640be90..04edb9875 100644 --- a/tests/ClientBuilder/ArrayLogger.php +++ b/tests/ClientBuilder/ArrayLogger.php @@ -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 { /** diff --git a/tests/Helper/Iterators/SearchHitIteratorTest.php b/tests/Helper/Iterators/SearchHitIteratorTest.php index 080e5d1fa..406d7e657 100644 --- a/tests/Helper/Iterators/SearchHitIteratorTest.php +++ b/tests/Helper/Iterators/SearchHitIteratorTest.php @@ -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 { diff --git a/tests/Helper/Iterators/SearchResponseIteratorTest.php b/tests/Helper/Iterators/SearchResponseIteratorTest.php index e971278cb..b5473caca 100644 --- a/tests/Helper/Iterators/SearchResponseIteratorTest.php +++ b/tests/Helper/Iterators/SearchResponseIteratorTest.php @@ -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 { diff --git a/tests/Serializers/ArrayToJSONSerializerTest.php b/tests/Serializers/ArrayToJSONSerializerTest.php index 1b2b0630b..c3b0a7daa 100644 --- a/tests/Serializers/ArrayToJSONSerializerTest.php +++ b/tests/Serializers/ArrayToJSONSerializerTest.php @@ -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 { diff --git a/tests/Serializers/EverythingToJSONSerializerTest.php b/tests/Serializers/EverythingToJSONSerializerTest.php index 93b7c5d5f..137c5caa3 100644 --- a/tests/Serializers/EverythingToJSONSerializerTest.php +++ b/tests/Serializers/EverythingToJSONSerializerTest.php @@ -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 {