Skip to content

Commit 856b5a3

Browse files
committed
Refactored phpstan config
1 parent 09ba37b commit 856b5a3

File tree

9 files changed

+12
-33
lines changed

9 files changed

+12
-33
lines changed

composer.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,8 @@
5555
"phpcs --standard=ruleset.xml --extensions=php --encoding=utf-8 --tab-width=4 -sp src",
5656
"phpcs --standard=ruleset.xml --extensions=php --encoding=utf-8 --tab-width=4 -sp tests"
5757
],
58-
"phpstan7.1": [
59-
"@php vendor/bin/phpstan analyse -c phpstan-src-71.neon src --level 2 --no-progress"
60-
],
6158
"phpstan": [
62-
"@php vendor/bin/phpstan analyse -c phpstan-src.neon src --level 2 --no-progress"
59+
"phpstan analyse src --level 2 --no-progress"
6360
]
6461
}
6562
}

phpstan-src.neon

Lines changed: 0 additions & 12 deletions
This file was deleted.

phpstan-tests.neon

Lines changed: 0 additions & 14 deletions
This file was deleted.

phpstan.neon

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
parameters:
2+
ignoreErrors:
3+
- '#Unsafe usage of new static()#'

src/Elasticsearch/ClientBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ public function setHosts(array $hosts): ClientBuilder
342342
*
343343
* @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html
344344
*
345-
* @throws Elasticsearch\Common\Exceptions\AuthenticationConfigException
345+
* @throws AuthenticationConfigException
346346
*/
347347
public function setApiKey(string $id, string $apiKey): ClientBuilder
348348
{
@@ -363,7 +363,7 @@ public function setApiKey(string $id, string $apiKey): ClientBuilder
363363
* @param string $username
364364
* @param string $password
365365
*
366-
* @throws Elasticsearch\Common\Exceptions\AuthenticationConfigException
366+
* @throws AuthenticationConfigException
367367
*/
368368
public function setBasicAuthentication(string $username, string $password): ClientBuilder
369369
{

src/Elasticsearch/Endpoints/AbstractEndpoint.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ private function getOptionalType(): string
219219
*/
220220
private function checkUserParams(array $params)
221221
{
222-
if (isset($params) !== true) {
222+
if (empty($params)) {
223223
return; //no params, just return.
224224
}
225225

tests/Elasticsearch/Tests/Helper/Iterators/SearchHitIteratorTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
*/
1919
class SearchHitIteratorTest extends \PHPUnit\Framework\TestCase
2020
{
21+
/**
22+
* @var SearchResponseIterator
23+
*/
24+
private $searchResponse;
2125

2226
public function setUp()
2327
{

util/RestSpecRunner.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use GitWrapper\GitWrapper;
88

99
error_reporting(E_ALL | E_STRICT);
10+
use Elasticsearch\Tests\Utility;
1011

1112
// Set the default timezone. While this doesn't cause any tests to fail, PHP
1213
// complains if it is not set in 'date.timezone' of php.ini.

0 commit comments

Comments
 (0)