Skip to content

Commit

Permalink
Move the deprecation trigger to the methods
Browse files Browse the repository at this point in the history
Signed-off-by: Kim Pepper <[email protected]>
  • Loading branch information
kimpepper committed Feb 11, 2025
1 parent d68c725 commit d11b0c2
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 15 deletions.
5 changes: 5 additions & 0 deletions src/OpenSearch/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -1864,6 +1864,7 @@ public function deletePointInTime(array $params = [])
*/
public function asyncSearch(): AsyncSearchNamespace
{
@trigger_error('The ' . __METHOD__ . ' method is deprecated since 2.4.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);
return $this->asyncSearch;
}
/**
Expand Down Expand Up @@ -1901,6 +1902,7 @@ public function danglingIndices(): DanglingIndicesNamespace
*/
public function dataFrameTransformDeprecated(): DataFrameTransformDeprecatedNamespace
{
@trigger_error('The ' . __METHOD__ . ' method is deprecated since 2.4.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);
return $this->dataFrameTransformDeprecated;
}
/**
Expand Down Expand Up @@ -1966,6 +1968,7 @@ public function ml(): MlNamespace
*/
public function monitoring(): MonitoringNamespace
{
@trigger_error('The ' . __METHOD__ . ' method is deprecated since 2.4.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);
return $this->monitoring;
}
/**
Expand Down Expand Up @@ -2038,6 +2041,7 @@ public function searchPipeline(): SearchPipelineNamespace
*/
public function searchableSnapshots(): SearchableSnapshotsNamespace
{
@trigger_error('The ' . __METHOD__ . ' method is deprecated since 2.4.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);
return $this->searchableSnapshots;
}
/**
Expand Down Expand Up @@ -2075,6 +2079,7 @@ public function sql(): SqlNamespace
*/
public function ssl(): SslNamespace
{
@trigger_error('The ' . __METHOD__ . ' method is deprecated since 2.4.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);
return $this->ssl;
}
/**
Expand Down
3 changes: 0 additions & 3 deletions src/OpenSearch/Namespaces/AsyncSearchNamespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@

namespace OpenSearch\Namespaces;

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

/**
* Class AsyncSearchNamespace
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@

namespace OpenSearch\Namespaces;

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

/**
* Class DataFrameTransformDeprecatedNamespace
*
Expand Down
3 changes: 0 additions & 3 deletions src/OpenSearch/Namespaces/MonitoringNamespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@

namespace OpenSearch\Namespaces;

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

/**
* Class MonitoringNamespace
*
Expand Down
3 changes: 0 additions & 3 deletions src/OpenSearch/Namespaces/SearchableSnapshotsNamespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@

namespace OpenSearch\Namespaces;

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

/**
* Class SearchableSnapshotsNamespace
*
Expand Down
3 changes: 0 additions & 3 deletions src/OpenSearch/Namespaces/SslNamespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@

namespace OpenSearch\Namespaces;

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

/**
* Class SslNamespace
*
Expand Down
1 change: 1 addition & 0 deletions util/template/client-namespace-function-deprecated
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
*/
public function :name(): :namespace
{
@trigger_error('The ' . __METHOD__ . ' method is deprecated since 2.4.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);
return $this->:name;
}

0 comments on commit d11b0c2

Please sign in to comment.