Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some PHPStan findings in tests #2073

Merged
merged 2 commits into from
Jun 7, 2022

Conversation

franmomu
Copy link
Contributor

@franmomu franmomu commented Jun 3, 2022

GuzzleException::getGuzzleException() always returns a TransferException:

/**
* @var TransferException
*/
protected $_guzzleException;
public function __construct(TransferException $guzzleException, ?Request $request = null, ?Response $response = null)
{
$this->_guzzleException = $guzzleException;
$message = $this->getErrorMessage($this->getGuzzleException());
parent::__construct($message, $request, $response);
}
public function getErrorMessage(TransferException $guzzleException): string
{
return $guzzleException->getMessage();
}
/**
* @return TransferException
*/
public function getGuzzleException(): BaseGuzzleException
{
return $this->_guzzleException;
}

Copy link
Owner

@ruflin ruflin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Can you add a changelog?

@ruflin ruflin merged commit 583bc09 into ruflin:master Jun 7, 2022
@ruflin
Copy link
Owner

ruflin commented Jun 7, 2022

Thx

@franmomu franmomu deleted the phpstan_fixes_tests branch June 7, 2022 13:57
@franmomu
Copy link
Contributor Author

franmomu commented Jun 7, 2022

I'll take a look later at the codecov job because it looks like it works for some jobs: https://github.com/ruflin/Elastica/runs/6775474480?check_suite_focus=true#step:10:27

but not for others:
https://github.com/ruflin/Elastica/runs/6775474648?check_suite_focus=true#step:10:27

Maybe the files gets deleted.

UPDATE: Looks like the report generation failed:

https://github.com/ruflin/Elastica/runs/6775474648?check_suite_focus=true#step:7:30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants