Comments (12)
@DragonBe Yes I upgraded to 1.0.6 and 1.0.9 and now everything works without warnings ๐
Thank you for time and debugging.
And thank you for this package is a real time saver ๐
from vies.
Hey @gasperkol,
I'll look into this immediately! Should not require a lots of time to fix.
from vies.
OK @gasperkol , it looks I need some additional information here as the constant SOAP_1_1
and SOAP_1_2
are not giving me any errors or warnings.
php -derror_reporting=32767 -ddisplay_errors=1 -ddisplay_startup_errors=1 -r "echo SOAP_1_2 . PHP_EOL;"
2
Also the SoapClient documentation is not giving any hints that these constants will be removed any time soon.
That aside, if this issue is keep giving you warnings, we already provided a way to provide your own SoapClient with your custom settings.
$vies = new Vies();
$soapClient = new SoapClient($vies->getWsdl(), ['soap_version' => 2]);
$vies->setSoapClient($soapClient);
Or you can just provide the correct options directly:
$vies = new Vies();
$vies->setOptions(['soap_version' => 2]);
I hope this will help you sort out the issue. If not, provide me some additional information so I can better analyse where PHP is generating that warning.
from vies.
Thanks for so quick reply!
Sorry for incomplete information.
So I've been using Symfony 3 and as I noticed now this is "Context check" from Symfony.
Uncaught PHP Exception Symfony\Component\Debug\Exception\ContextErrorException: "Warning: Use of undefined constant SOAP_1_2 - assumed 'SOAP_1_2' (this will throw an Error in a future version of PHP)"
So this warning still shows up because this version is set in _construct of Vies() and if I init this class this warning is triggered.
We can ignore this but if you can change this would be perfect!
If you need some additional information feel free to ask.
Thank you! @DragonBe
from vies.
@gasperkol which version of this Vies package are you using?
from vies.
@gasperkol OK, I was able to reproduce the warning even though I am not sure where we used the constant SOAP_1_2โฆ but I'll figure it out! ๐ธ
<?php
// File: /tmp/test.php
error_reporting(E_ALL|E_NOTICE|E_DEPRECATED);
ini_set('display_errors', 1);
var_dump(SOAP_1_1, SOAP_1_2);
When executing it with php /tmp/test.php
I got the warning.
php /tmp/test.php
PHP Warning: Use of undefined constant SOAP_2_1 - assumed 'SOAP_2_1' (this will throw an Error in a future version of PHP) in /tmp/test.php on line 8
Warning: Use of undefined constant SOAP_2_1 - assumed 'SOAP_2_1' (this will throw an Error in a future version of PHP) in /tmp/test.php on line 8
int(1)
int(2)
Interesting note: it only throws this warning for version 2, not for 1โฆ not sure why ๐ค
from vies.
@DragonBe I use version 1.0.1.
If I understand correctly this warning is thrown when some global constant is not set and its become string....
So if you find this SOAP_1_2 constant (and I know you will ๐ธ) where you use it then you can check why is not set.
** Sory to bother with this warning but in Symfony is annoying when you have warning in DEV ENV ๐
from vies.
Very strange situation which I need to investigate further, but once I've instantiated SoapClient with a specific version, the error I was able to reproduce was no longer there. I assume that somewhere it became defined (this is what I need to investigate ๐งfurther).
@gasperkol can I ask something of you? I have a branch where the unit tests are digging deeper into this subject (see https://github.com/DragonBe/vies/tree/michelangelo/issue-60-warning-for-not-defined-soap-version). Can you check this branch out and run ./vendor/bin/phpunit
. The output is what I'm interested in.
If you have issues running PHPUnit, I've included docker containers to make life easier: I've got them for PHP 7.0, 7.1, 7.2 and 7.3.
Getting started quickly:
docker build -t phpunit:7.1 .docker/php7.1
<<<building container here>>>
docker run --rm -t -i phpunit:7.1 ./vendor/bin/phpunit
When I ran it, no issues were reported even though I've been testing all sorts of usages of these constants converting the notices and warnings into exceptions.
PHPUnit 7.5.0 by Sebastian Bergmann and contributors.
............................................................... 63 / 210 ( 30%)
............................................................... 126 / 210 ( 60%)
............................................................... 189 / 210 ( 90%)
..................... 210 / 210 (100%)
Time: 8.11 seconds, Memory: 12.00MB
OK (210 tests, 404 assertions)
Generating code coverage report in Clover XML format ... done
Generating code coverage report in HTML format ... done
from vies.
@DragonBe Now I played with my code and settings and I noticed that only in Vies version 1.0.1 this warning shows up. In any others versions everything is ok.
And this version where you added this tests works without warning ๐ ..
So for me, a solution is to update to latest 1.X or 2.X version and everything works.
If you still need some additional information please let me know.
Thank you!
from vies.
OK, thank you for your feedback @gasperkol. Let me know if you were able to upgrade and if those warnings no longer appear.
To be on the safe side, I will include those additional tests in the code base in case future versions of PHP might break things.
For your reference, I'm running this package on PHP 7.3.0 and it works like a charm ๐
from vies.
Merged in the additional unit tests for this use case in commit c7d4d0a.
from vies.
@gasperkol you're very welcome. Thank you for reporting it, this way I learn about the things I don't know and makes me wiser along the way.
Have a nice day ๐
from vies.
Related Issues (20)
- Validation of Irish VAT ID failed for valid VAT ID HOT 7
- Making VIES package more inclusive
- Missing BG checksum validation for foreign natual persons
- VIES_EU_COUNTRY_LIST Visibility HOT 1
- Package upgrade to composer 2.0
- Ensure this package can be installed with Composer 2.0
- Implementing a Symfony constraint based on this library HOT 2
- Remove support for the United Kingdom ("GB") HOT 16
- Add support for United Kingdom (Northern Ireland) ("GB-NIR") HOT 7
- Support php8
- Validation failed for valid VAT numbers HOT 8
- 32 Bit Support HOT 1
- The service moved to SSL endpoint. HOT 1
- use of ::VIES_EXCLUDED_COUNTRY_CODES
- ValidatorLV results inconsistent with official EU validation
- heartbeat is not working anymore HOT 12
- Cannot populate CheckVatResponse after using `toArray`
- Optional Argument Validation Fails for ยฎ HOT 2
- Heathbeat check always false HOT 1
- GetAddress non getting separated city, zip
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vies.