Skip to content

Commit

Permalink
Address feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Kim Pepper <kim@pepper.id.au>
  • Loading branch information
kimpepper committed Nov 13, 2024
1 parent a0bdb57 commit 46357f4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/OpenSearch/Namespaces/AbstractNamespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ public function __construct(Transport $transport, callable|EndpointFactoryInterf
$endpoints = $endpointFactory;
$endpointFactory = new LegacyEndpointFactory($endpointFactory);
} else {
$endpoints = fn ($c) => $endpointFactory->getEndpoint('OpenSearch\\Endpoints\\' . $c);
$endpoints = function ($c) use ($endpointFactory) {
@trigger_error('The $endpoints property is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);
return $endpointFactory->getEndpoint('OpenSearch\\Endpoints\\' . $c);
};
}
$this->endpoints = $endpoints;
$this->endpointFactory = $endpointFactory;
Expand Down
2 changes: 1 addition & 1 deletion util/template/client-class
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class Client
} else {
$endpoints = function ($c) {
@trigger_error('The $endpoints property is deprecated in 2.3.2 and will be removed in 3.0.0.', E_USER_DEPRECATED);
$endpointFactory->getEndpoint('OpenSearch\\Endpoints\\' . $c);
return $endpointFactory->getEndpoint('OpenSearch\\Endpoints\\' . $c);
};
}
$this->endpoints = $endpoints;
Expand Down

0 comments on commit 46357f4

Please sign in to comment.