elasticsearch-php icon indicating copy to clipboard operation
elasticsearch-php copied to clipboard

ConnectionInterface::performRequest method signature does not match Connection::performRequest

Open nateeklund opened this issue 5 years ago • 2 comments

Summary of problem or feature request

ConnectionInterface::performRequest method signature does not match Connection::performRequest method signature.

This causes mocking the class with Phake to fail.

Code snippet of problem

ConnectionInterface.php

    /**
     * @param  null $body
     * @return mixed
     */
    public function performRequest(string $method, string $uri, array $params = [], $body = null, array $options = [], Transport $transport = null);

Connection.php

    /**
     * @param  string    $method
     * @param  string    $uri
     * @param  array     $params
     * @param  null      $body
     * @param  array     $options
     * @param  Transport $transport
     * @return mixed
     */
    public function performRequest(string $method, string $uri, ?array $params = [], $body = null, array $options = [], Transport $transport = null)
    {
       //  ....
    }

System details

  • PHP Version: 7.1
  • ES-PHP client version: 7.4 and 7.5

nateeklund avatar Jan 17 '20 23:01 nateeklund

I'm happy to push up the fix for this, though if you'd rather just do it as part of whatever you're in the middle of that might make more sense as it's a 1 character change. If I were to push it up I'd also fix up the PHPDoc comment a bit.

nateeklund avatar Jan 17 '20 23:01 nateeklund

https://github.com/elastic/elasticsearch-php/pull/1121 for version 6.8.x - function signature missing all type hinting

it can break Magento2 if a new install/upgrade

mamsincl avatar Mar 26 '21 12:03 mamsincl