Commit Graph

11 Commits

Author SHA1 Message Date
Julien Gidel 007bfd424e Small contribution - code readability improvements (#306)
* Some code improvements - tests same as beginning

* isUTF8Invalid returns a boolean

* Changes for tests passed

* Revert change + scrutinizer to flaky

* Null coalescing on token to return a null token

* Psalm pass and PHPunit too (php 7.4)

* Minor change to set lookahead to nullToken
2021-11-20 22:34:12 +01:00
Alies Lapatsin 451b438902 Use a safe way to execute dns_get_record (v3) (#286)
* #256 Bypass a PHP warning generated by @dns_get_record

The idea is to create a custom error handler for dns_get_record(), call dns_get_record and then restore the original error handler.
This way we can catch PHP warnings (e.g. "Warning: dns_get_record(): DNS Query failed" or "dns_get_record(): A temporary server error occurred." [ErrorException])

* #256 Make `UnableToGetDNSRecord` reason more testable

* #256 Suppress psalm’s false-positive error

see https://github.com/vimeo/psalm/issues/5134#issuecomment-782937791

* #256 Speed up tests: start from previously failed

* #256 Suppress psalm’s false-positive error

We don’t have a control over AbstractLexer and can’t specify array shape in this parent class
2021-02-28 15:27:57 +01:00
Eduardo Gulias Davis 790881fe75 improving types 2020-12-05 23:16:56 +01:00
Eduardo Gulias Davis 729ecb2a35 Psalm fixes 2020-11-08 16:19:44 +01:00
Eduardo Gulias Davis 49b18fbcfc Remove deprecation, comes from #257 2020-09-19 16:37:33 +02:00
Eduardo Gulias Davis 044b1d55d9 Return type in signature 2020-09-12 16:41:06 +02:00
Eduardo Gulias Davis bf39b372c1 update DNS validation 2020-09-12 15:43:58 +02:00
Eduardo Gulias Davis 3647ed6037 Fix #260 reporting an unhandled exception 2020-09-06 15:17:48 +02:00
Eduardo Gulias Davis e2e234c4d8 merging from master, folder structure change 2020-08-30 15:59:42 +02:00
BenHarris 840d5603eb Reimplement DNSCheckValidation (#250)
* Reimplement DNSCheckValidation to utilise get_dns_record and extend support for detection of Null MX records (RFC7505) and reserved, mDNS and private namespaces (RFC2606 & RFC6762)

* Change valid email tests to use github.com instead of example.com as example.com now (correctly) fails the tests due to the Null MX case

* Tweak to pass CI psalm issue

* Encapsulate dns check code. Simplify local and reserved domain checks. Switch test domain

* Set PHPDoc return type

* Use strict comparisons
2020-08-08 23:28:19 +02:00
Simon Schaufelberger cfa3d44471 Move files in typical src and tests folder (#242)
* Move files in typical src and tests folder

* Fix psalm error
2020-06-16 22:11:17 +02:00