Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 148 | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 148 Revision 150
Zeile 1... Zeile 1...
1
<?php
1
<?php
-
 
2
 
2
namespace Egulias\EmailValidator\Validation;
3
namespace Egulias\EmailValidator\Validation;
Zeile 3... Zeile 4...
3
 
4
 
4
class DNSGetRecordWrapper
5
class DNSGetRecordWrapper
5
{
6
{
6
    /**
7
    /**
7
     * @param string $host
8
     * @param string $host
-
 
9
     * @param int $type
-
 
10
     * 
8
     * @param int $type
11
     * @return DNSRecords
9
     */
12
     */
10
    public function getRecords(string $host, int $type) : DNSRecords
13
    public function getRecords(string $host, int $type): DNSRecords
11
    {
14
    {
12
        // A workaround to fix https://bugs.php.net/bug.php?id=73149
15
        // A workaround to fix https://bugs.php.net/bug.php?id=73149
13
        /** @psalm-suppress InvalidArgument */
16
        /** @psalm-suppress InvalidArgument */
14
        set_error_handler(
17
        set_error_handler(
15
            static function (int $errorLevel, string $errorMessage): ?bool {
18
            static function (int $errorLevel, string $errorMessage): never {
16
                throw new \RuntimeException("Unable to get DNS record for the host: $errorMessage");
19
                throw new \RuntimeException("Unable to get DNS record for the host: $errorMessage");
17
            }
20
            }
18
        );
21
        );
19
        try {
22
        try {