Closed nunoperalta closed 1 year ago
This issue is in generated code. A fix would be required in the wsdl2phpgenerator project.
@PierrickVoulet this error is from AdsSoapClient not generated ReportService.
$this->__last_request = $request;
I think this is a bug because this variable is private in SoapClient
. It is retrieved using $this->__getLastRequest()
, which will return a variable from the SoapClient
not AdsSoapClient
.
The value is already set in SoapClient::__doRequest()
. Therefore, the solution is to either remove this line or create a __getLastRequest()
function and object property. I suggested the deletion because the code currently behaves as if it is not there. However, I don't know what the purpose of this piece of code was.
I also added, some other changes for PHP 8.2. Currently, everything works in my case. There are also no errors in PHPUnit or PHPStan analysis.
Pull request: https://github.com/googleads/googleads-php-lib/pull/774
Thanks for the additional analysis, @Naki. I agree that removing this line seems to be the right thing to do, it would be consistent with what we currently do for the response data which works similarly (see logSoapCall
). For the record, the getLastRequest
and getLastResponse
methods only work when the trace
option is set to true
(see PHP doc) which is our case (see service factory).
Fixed in 62.0.0.
Dynamic properties in classes are deprecated in PHP 8.2.
There is an attribute that can be added (
#[AllowDynamicProperties]
), but best is to define the property in advance.