Page MenuHomePhabricator

D660.id2046.diff
No OneTemporary

D660.id2046.diff

diff --git a/composer.json b/composer.json
--- a/composer.json
+++ b/composer.json
@@ -11,10 +11,18 @@
],
"minimum-stability": "dev",
"prefer-stable": true,
+
+ "scripts": {
+ "test": [
+ "./vendor/bin/phpstan analyse ./src --level 7"
+ ]
+ },
"autoload": {
"psr-4": {
"magic3w\\support\\base32\\" : "./src/"
}
},
- "require": {}
+ "require-dev": {
+ "phpstan/phpstan": "^0.12.82"
+ }
}
diff --git a/composer.lock b/composer.lock
--- a/composer.lock
+++ b/composer.lock
@@ -4,9 +4,70 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "e1685f02ec231689c0fb0c702478bd6d",
+ "content-hash": "048a2fa13bcd12c0eb0b1b011eaea853",
"packages": [],
- "packages-dev": [],
+ "packages-dev": [
+ {
+ "name": "phpstan/phpstan",
+ "version": "0.12.82",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phpstan/phpstan.git",
+ "reference": "3920f0fb0aff39263d3a4cb0bca120a67a1a6a11"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phpstan/phpstan/zipball/3920f0fb0aff39263d3a4cb0bca120a67a1a6a11",
+ "reference": "3920f0fb0aff39263d3a4cb0bca120a67a1a6a11",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.1|^8.0"
+ },
+ "conflict": {
+ "phpstan/phpstan-shim": "*"
+ },
+ "bin": [
+ "phpstan",
+ "phpstan.phar"
+ ],
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "0.12-dev"
+ }
+ },
+ "autoload": {
+ "files": [
+ "bootstrap.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "description": "PHPStan - PHP Static Analysis Tool",
+ "support": {
+ "issues": "https://github.com/phpstan/phpstan/issues",
+ "source": "https://github.com/phpstan/phpstan/tree/0.12.82"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/ondrejmirtes",
+ "type": "github"
+ },
+ {
+ "url": "https://www.patreon.com/phpstan",
+ "type": "patreon"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2021-03-19T06:08:17+00:00"
+ }
+ ],
"aliases": [],
"minimum-stability": "dev",
"stability-flags": [],
diff --git a/src/Base32Int.php b/src/Base32Int.php
--- a/src/Base32Int.php
+++ b/src/Base32Int.php
@@ -34,12 +34,24 @@
class Base32Int
{
- public static function encode($number) {
- return strtoupper(base_convert($number, 10, 32));
+ /**
+ *
+ * @param int $number
+ * @return string
+ */
+ public static function encode(int $number) : string
+ {
+ return strtoupper(base_convert((string)$number, 10, 32));
}
- public static function decode($number) {
- return base_convert(strtoupper($number), 32, 10);
+ /**
+ *
+ * @param string $number
+ * @return int
+ */
+ public static function decode(string $number) : int
+ {
+ return (int)base_convert(strtoupper($number), 32, 10);
}
}
\ No newline at end of file

File Metadata

Mime Type
text/plain
Expires
Wed, Apr 14, 4:28 PM (3 w, 6 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
6088
Default Alt Text
D660.id2046.diff (3 KB)

Event Timeline