Skip to content

Commit

Permalink
add declare(strict_types=1)
Browse files Browse the repository at this point in the history
  • Loading branch information
io-developer committed Jan 17, 2023
1 parent c2bc808 commit 5ec4fd7
Show file tree
Hide file tree
Showing 61 changed files with 126 additions and 2 deletions.
2 changes: 2 additions & 0 deletions bin/php-whois.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

use Iodev\Whois\Factory;

$scriptDir = '.';
Expand Down
2 changes: 2 additions & 0 deletions src/Iodev/Whois/Config.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Iodev\Whois;

class Config
Expand Down
2 changes: 2 additions & 0 deletions src/Iodev/Whois/DataObject.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Iodev\Whois;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Iodev/Whois/Exceptions/ConnectionException.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Iodev\Whois\Exceptions;

use Exception;
Expand Down
2 changes: 2 additions & 0 deletions src/Iodev/Whois/Exceptions/ServerMismatchException.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Iodev\Whois\Exceptions;

use Throwable;
Expand Down
2 changes: 2 additions & 0 deletions src/Iodev/Whois/Exceptions/WhoisException.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Iodev\Whois\Exceptions;

use Throwable;
Expand Down
2 changes: 2 additions & 0 deletions src/Iodev/Whois/Factory.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Iodev\Whois;

use Iodev\Whois\Loaders\ILoader;
Expand Down
2 changes: 2 additions & 0 deletions src/Iodev/Whois/Helpers/DateHelper.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Iodev\Whois\Helpers;

class DateHelper
Expand Down
2 changes: 2 additions & 0 deletions src/Iodev/Whois/Helpers/DomainHelper.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Iodev\Whois\Helpers;

use Iodev\Whois\Factory;
Expand Down
2 changes: 2 additions & 0 deletions src/Iodev/Whois/Helpers/GroupFilter.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Iodev\Whois\Helpers;

class GroupFilter
Expand Down
2 changes: 2 additions & 0 deletions src/Iodev/Whois/Helpers/GroupHelper.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Iodev\Whois\Helpers;

class GroupHelper
Expand Down
2 changes: 2 additions & 0 deletions src/Iodev/Whois/Helpers/GroupSelector.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Iodev\Whois\Helpers;

class GroupSelector
Expand Down
2 changes: 2 additions & 0 deletions src/Iodev/Whois/Helpers/GroupTrait.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Iodev\Whois\Helpers;

trait GroupTrait
Expand Down
2 changes: 2 additions & 0 deletions src/Iodev/Whois/Helpers/ParserHelper.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Iodev\Whois\Helpers;

class ParserHelper
Expand Down
2 changes: 2 additions & 0 deletions src/Iodev/Whois/Helpers/TextHelper.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Iodev\Whois\Helpers;

class TextHelper
Expand Down
2 changes: 2 additions & 0 deletions src/Iodev/Whois/IFactory.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Iodev\Whois;

use Iodev\Whois\Loaders\ILoader;
Expand Down
2 changes: 2 additions & 0 deletions src/Iodev/Whois/Loaders/CurlLoader.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Iodev\Whois\Loaders;

use Iodev\Whois\Exceptions\ConnectionException;
Expand Down
2 changes: 2 additions & 0 deletions src/Iodev/Whois/Loaders/ILoader.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Iodev\Whois\Loaders;

use Iodev\Whois\Exceptions\ConnectionException;
Expand Down
2 changes: 2 additions & 0 deletions src/Iodev/Whois/Loaders/MemcachedLoader.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Iodev\Whois\Loaders;

use Memcached;
Expand Down
2 changes: 2 additions & 0 deletions src/Iodev/Whois/Loaders/SocketLoader.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Iodev\Whois\Loaders;

use Iodev\Whois\Exceptions\ConnectionException;
Expand Down
2 changes: 2 additions & 0 deletions src/Iodev/Whois/Modules/Asn/AsnInfo.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Iodev\Whois\Modules\Asn;

use Iodev\Whois\DataObject;
Expand Down
2 changes: 2 additions & 0 deletions src/Iodev/Whois/Modules/Asn/AsnInfoDeprecated.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Iodev\Whois\Modules\Asn;

trait AsnInfoDeprecated
Expand Down
2 changes: 2 additions & 0 deletions src/Iodev/Whois/Modules/Asn/AsnModule.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Iodev\Whois\Modules\Asn;

use Iodev\Whois\Exceptions\ConnectionException;
Expand Down
2 changes: 2 additions & 0 deletions src/Iodev/Whois/Modules/Asn/AsnParser.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Iodev\Whois\Modules\Asn;

use Iodev\Whois\Helpers\ParserHelper;
Expand Down
2 changes: 2 additions & 0 deletions src/Iodev/Whois/Modules/Asn/AsnParserDeprecated.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Iodev\Whois\Modules\Asn;

trait AsnParserDeprecated
Expand Down
2 changes: 2 additions & 0 deletions src/Iodev/Whois/Modules/Asn/AsnResponse.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Iodev\Whois\Modules\Asn;

use Iodev\Whois\DataObject;
Expand Down
2 changes: 2 additions & 0 deletions src/Iodev/Whois/Modules/Asn/AsnResponseDeprected.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Iodev\Whois\Modules\Asn;

trait AsnResponseDeprected
Expand Down
2 changes: 2 additions & 0 deletions src/Iodev/Whois/Modules/Asn/AsnRouteInfo.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Iodev\Whois\Modules\Asn;

use InvalidArgumentException;
Expand Down
2 changes: 2 additions & 0 deletions src/Iodev/Whois/Modules/Asn/AsnRouteInfoDeprecated.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Iodev\Whois\Modules\Asn;

trait AsnRouteInfoDeprecated
Expand Down
2 changes: 2 additions & 0 deletions src/Iodev/Whois/Modules/Asn/AsnServer.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Iodev\Whois\Modules\Asn;

use InvalidArgumentException;
Expand Down
2 changes: 2 additions & 0 deletions src/Iodev/Whois/Modules/Module.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Iodev\Whois\Modules;

use Iodev\Whois\Loaders\ILoader;
Expand Down
2 changes: 2 additions & 0 deletions src/Iodev/Whois/Modules/ModuleType.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Iodev\Whois\Modules;

class ModuleType
Expand Down
2 changes: 2 additions & 0 deletions src/Iodev/Whois/Modules/Tld/Parsers/AutoParser.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Iodev\Whois\Modules\Tld\Parsers;

use Iodev\Whois\Modules\Tld\TldInfo;
Expand Down
2 changes: 2 additions & 0 deletions src/Iodev/Whois/Modules/Tld/Parsers/BlockParser.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Iodev\Whois\Modules\Tld\Parsers;

use Iodev\Whois\Helpers\DateHelper;
Expand Down
2 changes: 2 additions & 0 deletions src/Iodev/Whois/Modules/Tld/Parsers/CommonParser.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Iodev\Whois\Modules\Tld\Parsers;

use Iodev\Whois\Helpers\GroupFilter;
Expand Down
2 changes: 2 additions & 0 deletions src/Iodev/Whois/Modules/Tld/Parsers/IndentParser.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Iodev\Whois\Modules\Tld\Parsers;

use Iodev\Whois\Helpers\GroupFilter;
Expand Down
2 changes: 2 additions & 0 deletions src/Iodev/Whois/Modules/Tld/TldInfo.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Iodev\Whois\Modules\Tld;

use InvalidArgumentException;
Expand Down
2 changes: 2 additions & 0 deletions src/Iodev/Whois/Modules/Tld/TldInfoDeprecated.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Iodev\Whois\Modules\Tld;

trait TldInfoDeprecated
Expand Down
2 changes: 2 additions & 0 deletions src/Iodev/Whois/Modules/Tld/TldModule.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Iodev\Whois\Modules\Tld;

use Iodev\Whois\Exceptions\ConnectionException;
Expand Down
2 changes: 2 additions & 0 deletions src/Iodev/Whois/Modules/Tld/TldParser.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Iodev\Whois\Modules\Tld;

abstract class TldParser
Expand Down
2 changes: 2 additions & 0 deletions src/Iodev/Whois/Modules/Tld/TldParserDeprecated.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Iodev\Whois\Modules\Tld;

use Iodev\Whois\Config;
Expand Down
2 changes: 2 additions & 0 deletions src/Iodev/Whois/Modules/Tld/TldResponse.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Iodev\Whois\Modules\Tld;

use Iodev\Whois\DataObject;
Expand Down
2 changes: 2 additions & 0 deletions src/Iodev/Whois/Modules/Tld/TldResponseDeprected.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Iodev\Whois\Modules\Tld;

trait TldResponseDeprected
Expand Down
2 changes: 2 additions & 0 deletions src/Iodev/Whois/Modules/Tld/TldServer.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Iodev\Whois\Modules\Tld;

use InvalidArgumentException;
Expand Down
2 changes: 2 additions & 0 deletions src/Iodev/Whois/Punycode/IPunycode.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Iodev\Whois\Punycode;

interface IPunycode
Expand Down
8 changes: 6 additions & 2 deletions src/Iodev/Whois/Punycode/IntlPunycode.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Iodev\Whois\Punycode;

class IntlPunycode implements IPunycode
Expand All @@ -9,18 +11,20 @@ public function encode(string $unicode): string
if (empty($unicode)) {
return '';
}
return defined('INTL_IDNA_VARIANT_UTS46')
$result = defined('INTL_IDNA_VARIANT_UTS46')
? idn_to_ascii($unicode, 0, INTL_IDNA_VARIANT_UTS46)
: idn_to_ascii($unicode);
return $result ?: '';
}

public function decode(string $ascii): string
{
if (empty($ascii)) {
return '';
}
return defined('INTL_IDNA_VARIANT_UTS46')
$result = defined('INTL_IDNA_VARIANT_UTS46')
? idn_to_utf8($ascii, 0, INTL_IDNA_VARIANT_UTS46)
: idn_to_utf8($ascii);
return $result ?: '';
}
}
2 changes: 2 additions & 0 deletions src/Iodev/Whois/Whois.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Iodev\Whois;

use Iodev\Whois\Exceptions\ConnectionException;
Expand Down
Loading

0 comments on commit 5ec4fd7

Please sign in to comment.