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

BC break in 10.1: "Call to private method PhpPact\FFI\Client::call()" #713

Closed
ostrolucky opened this issue Jan 8, 2025 · 3 comments · Fixed by #716
Closed

BC break in 10.1: "Call to private method PhpPact\FFI\Client::call()" #713

ostrolucky opened this issue Jan 8, 2025 · 3 comments · Fixed by #716

Comments

@ostrolucky
Copy link

Here is how we instantiate Verifier:

$client = new Client();
$client->call('pactffi_log_to_stderr', 4);
$verifier = new Verifier($verifierConfig, client: $client);

This stopped working, because call function was made private in d8f50a9

@tienvx
Copy link
Contributor

tienvx commented Jan 9, 2025

I consider Client an internal class, so I modified it a lot in v10.1

Will you please modify your code into this?

use PhpPact\Log\Logger;
use PhpPact\Log\Enum\LogLevel;
use PhpPact\Log\Model\Stderr;

$logger = Logger::instance();
$logger->attach(new Stderr(LogLevel::DEBUG));
$logger->apply();
$verifier = new Verifier($verifierConfig);

If you can not modify your code, I will change the method Client::call() to public for v10.x only

@ostrolucky
Copy link
Author

Thanks for providing alternative. We can modify it, but you shouldn't do such changes in minor versions. Class isn't marked @internal either. I'll leave it up to you if you want to revert the change till 11.x or not. For us problem is solved after I changed our code.

@tienvx
Copy link
Contributor

tienvx commented Jan 9, 2025

Thanks for reporting. I reverted and released in 10.1.1

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 a pull request may close this issue.

2 participants