From bb523cc04b518dfcd2a46e1e3b1f06c75846db7b Mon Sep 17 00:00:00 2001 From: sc0Vu Date: Wed, 7 Feb 2018 13:55:32 +0800 Subject: [PATCH] Add comments,__get and __set. --- src/Contract.php | 6 +++--- src/Contracts/Ethabi.php | 3 ++- src/Contracts/SolidityType.php | 13 ++++--------- src/Eth.php | 7 ++++--- src/Methods/JSONRPC.php | 9 ++++++--- src/Net.php | 7 ++++--- src/Personal.php | 7 ++++--- src/Providers/Provider.php | 1 + src/RequestManagers/RequestManager.php | 1 + src/Shh.php | 7 ++++--- src/Utils.php | 5 +---- src/Web3.php | 7 ++++--- 12 files changed, 38 insertions(+), 35 deletions(-) diff --git a/src/Contract.php b/src/Contract.php index 7d5f1ba..72119ac 100644 --- a/src/Contract.php +++ b/src/Contract.php @@ -98,8 +98,8 @@ class Contract /** * construct * - * @param mixed string | Web3\Providers\Provider $provider - * @param mixed string | stdClass | array $abi + * @param string|\Web3\Providers\Provider $provider + * @param string|\stdClass|array $abi * @return void */ public function __construct($provider, $abi) @@ -202,7 +202,7 @@ class Contract /** * setProvider * - * @param $provider + * @param \Web3\Providers\Provider $provider * @return $this */ public function setProvider($provider) diff --git a/src/Contracts/Ethabi.php b/src/Contracts/Ethabi.php index 6f7f88a..d794005 100644 --- a/src/Contracts/Ethabi.php +++ b/src/Contracts/Ethabi.php @@ -52,6 +52,7 @@ class Ethabi if (method_exists($this, $method)) { return call_user_func_array([$this, $method], []); } + return false; } /** @@ -59,7 +60,7 @@ class Ethabi * * @param string $name * @param mixed $value - * @return bool + * @return mixed */ public function __set($name, $value) { diff --git a/src/Contracts/SolidityType.php b/src/Contracts/SolidityType.php index 98474ac..51898dc 100644 --- a/src/Contracts/SolidityType.php +++ b/src/Contracts/SolidityType.php @@ -21,10 +21,7 @@ class SolidityType * * @return void */ - public function __construct() - { - // - } + // public function __construct() {} /** * get @@ -39,6 +36,7 @@ class SolidityType if (method_exists($this, $method)) { return call_user_func_array([$this, $method], []); } + return false; } /** @@ -46,7 +44,7 @@ class SolidityType * * @param string $name * @param mixed $value - * @return bool + * @return mixed; */ public function __set($name, $value) { @@ -65,10 +63,7 @@ class SolidityType * @param array $arguments * @return void */ - public static function __callStatic($name, $arguments) - { - // - } + // public static function __callStatic($name, $arguments) {} /** * nestedTypes diff --git a/src/Eth.php b/src/Eth.php index 282ebd3..42817b2 100644 --- a/src/Eth.php +++ b/src/Eth.php @@ -44,7 +44,7 @@ class Eth /** * construct * - * @param mixed string | Web3\Providers\Provider $provider + * @param string|\Web3\Providers\Provider $provider * @return void */ public function __construct($provider) @@ -120,6 +120,7 @@ class Eth if (method_exists($this, $method)) { return call_user_func_array([$this, $method], []); } + return false; } /** @@ -127,7 +128,7 @@ class Eth * * @param string $name * @param mixed $value - * @return bool + * @return mixed */ public function __set($name, $value) { @@ -152,7 +153,7 @@ class Eth /** * setProvider * - * @param $provider + * @param \Web3\Providers\Provider $provider * @return bool */ public function setProvider($provider) diff --git a/src/Methods/JSONRPC.php b/src/Methods/JSONRPC.php index 3822716..3e7fc4b 100644 --- a/src/Methods/JSONRPC.php +++ b/src/Methods/JSONRPC.php @@ -70,6 +70,7 @@ class JSONRPC implements IRPC if (method_exists($this, $method)) { return call_user_func_array([$this, $method], []); } + return false; } /** @@ -77,7 +78,7 @@ class JSONRPC implements IRPC * * @param string $name * @param mixed $value - * @return bool + * @return mixed */ public function __set($name, $value) { @@ -92,7 +93,7 @@ class JSONRPC implements IRPC /** * __toString * - * @return array + * @return string */ public function __toString() { @@ -151,7 +152,7 @@ class JSONRPC implements IRPC * setArguments * * @param array $arguments - * @return array + * @return bool */ public function setArguments($arguments) { @@ -159,6 +160,8 @@ class JSONRPC implements IRPC throw new InvalidArgumentException('Please use array when call setArguments.'); } $this->arguments = $arguments; + + return true; } /** diff --git a/src/Net.php b/src/Net.php index 6b52b2b..bb06615 100644 --- a/src/Net.php +++ b/src/Net.php @@ -44,7 +44,7 @@ class Net /** * construct * - * @param mixed string | Web3\Providers\Provider $provider + * @param string|\Web3\Providers\Provider $provider * @return void */ public function __construct($provider) @@ -120,6 +120,7 @@ class Net if (method_exists($this, $method)) { return call_user_func_array([$this, $method], []); } + return false; } /** @@ -127,7 +128,7 @@ class Net * * @param string $name * @param mixed $value - * @return bool + * @return mixed */ public function __set($name, $value) { @@ -152,7 +153,7 @@ class Net /** * setProvider * - * @param $provider + * @param \Web3\Providers\Provider $provider * @return bool */ public function setProvider($provider) diff --git a/src/Personal.php b/src/Personal.php index bea8473..77c5e4c 100644 --- a/src/Personal.php +++ b/src/Personal.php @@ -44,7 +44,7 @@ class Personal /** * construct * - * @param mixed string | Web3\Providers\Provider $provider + * @param string|\Web3\Providers\Provider $provider * @return void */ public function __construct($provider) @@ -120,6 +120,7 @@ class Personal if (method_exists($this, $method)) { return call_user_func_array([$this, $method], []); } + return false; } /** @@ -127,7 +128,7 @@ class Personal * * @param string $name * @param mixed $value - * @return bool + * @return mixed */ public function __set($name, $value) { @@ -152,7 +153,7 @@ class Personal /** * setProvider * - * @param $provider + * @param \Web3\Providers\Provider $provider * @return bool */ public function setProvider($provider) diff --git a/src/Providers/Provider.php b/src/Providers/Provider.php index c370f9b..00ee915 100644 --- a/src/Providers/Provider.php +++ b/src/Providers/Provider.php @@ -74,6 +74,7 @@ class Provider if (method_exists($this, $method)) { return call_user_func_array([$this, $method], []); } + return false; } /** diff --git a/src/RequestManagers/RequestManager.php b/src/RequestManagers/RequestManager.php index 6f5ed83..51d17bf 100644 --- a/src/RequestManagers/RequestManager.php +++ b/src/RequestManagers/RequestManager.php @@ -45,6 +45,7 @@ class RequestManager if (method_exists($this, $method)) { return call_user_func_array([$this, $method], []); } + return false; } /** diff --git a/src/Shh.php b/src/Shh.php index b6ca4da..bc438e4 100644 --- a/src/Shh.php +++ b/src/Shh.php @@ -45,7 +45,7 @@ class Shh /** * construct * - * @param mixed string | Web3\Providers\Provider $provider + * @param string|\Web3\Providers\Provider $provider * @return void */ public function __construct($provider) @@ -121,6 +121,7 @@ class Shh if (method_exists($this, $method)) { return call_user_func_array([$this, $method], []); } + return false; } /** @@ -128,7 +129,7 @@ class Shh * * @param string $name * @param mixed $value - * @return bool + * @return mixed */ public function __set($name, $value) { @@ -153,7 +154,7 @@ class Shh /** * setProvider * - * @param $provider + * @param \Web3\Providers\Provider $provider * @return bool */ public function setProvider($provider) diff --git a/src/Utils.php b/src/Utils.php index a9ceee7..73536f1 100644 --- a/src/Utils.php +++ b/src/Utils.php @@ -67,10 +67,7 @@ class Utils * * @return void */ - public function __construct() - { - // - } + // public function __construct() {} /** * toHex diff --git a/src/Web3.php b/src/Web3.php index ebf7572..35a2cde 100644 --- a/src/Web3.php +++ b/src/Web3.php @@ -84,7 +84,7 @@ class Web3 /** * construct * - * @param mixed string | Web3\Providers\Provider $provider + * @param string|\Web3\Providers\Provider $provider * @return void */ public function __construct($provider) @@ -160,6 +160,7 @@ class Web3 if (method_exists($this, $method)) { return call_user_func_array([$this, $method], []); } + return false; } /** @@ -167,7 +168,7 @@ class Web3 * * @param string $name * @param mixed $value - * @return bool + * @return mixed */ public function __set($name, $value) { @@ -192,7 +193,7 @@ class Web3 /** * setProvider * - * @param $provider + * @param \Web3\Providers\Provider $provider * @return bool */ public function setProvider($provider)