diff --git a/src/Api/Dht.php b/src/Api/Dht.php index bc6589a..8c7cc5e 100644 --- a/src/Api/Dht.php +++ b/src/Api/Dht.php @@ -1,10 +1,21 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace IPFS\Api; use IPFS\Annotation\Api as Endpoint; use IPFS\Command\Command; + /** * @author Robert Schönthal * @autogenerated @@ -13,89 +24,94 @@ final class Dht implements Api { /** - * Query the DHT for all of the multiaddresses associated with a Peer ID. - * - * @Endpoint(name="dht:findpeer") - * - * @param string $arg The ID of the peer to search for. - * @param bool $verbose Print extra information. - * - * @return Command - */ - public function findpeer(string $arg, bool $verbose = false) : Command + * Query the DHT for all of the multiaddresses associated with a Peer ID. + * + * @Endpoint(name="dht:findpeer") + * + * @param string $arg the ID of the peer to search for + * @param bool $verbose print extra information + * + * @return Command + */ + public function findpeer(string $arg, bool $verbose = false): Command { return new Command(__METHOD__, get_defined_vars()); } + /** - * Find peers in the DHT that can provide a specific value, given a key. - * - * @Endpoint(name="dht:findprovs") - * - * @param string $arg The key to find providers for. - * @param bool $verbose Print extra information. - * - * @return Command - */ - public function findprovs(string $arg, bool $verbose = false) : Command + * Find peers in the DHT that can provide a specific value, given a key. + * + * @Endpoint(name="dht:findprovs") + * + * @param string $arg the key to find providers for + * @param bool $verbose print extra information + * + * @return Command + */ + public function findprovs(string $arg, bool $verbose = false): Command { return new Command(__METHOD__, get_defined_vars()); } + /** - * Given a key, query the DHT for its best value. - * - * @Endpoint(name="dht:get") - * - * @param string $arg The key to find a value for. - * @param bool $verbose Print extra information. - * - * @return Command - */ - public function get(string $arg, bool $verbose = false) : Command + * Given a key, query the DHT for its best value. + * + * @Endpoint(name="dht:get") + * + * @param string $arg the key to find a value for + * @param bool $verbose print extra information + * + * @return Command + */ + public function get(string $arg, bool $verbose = false): Command { return new Command(__METHOD__, get_defined_vars()); } + /** - * Announce to the network that you are providing given values. - * - * @Endpoint(name="dht:provide") - * - * @param string]: The key[s $arg The key[s] to send provide records for. - * @param bool $verbose Print extra information. - * @param bool $recursive Recursively provide entire graph. - * - * @return Command - */ - public function provide(string]: The key[s $arg, bool $verbose = false, bool $recursive = false) : Command + * Announce to the network that you are providing given values. + * + * @Endpoint(name="dht:provide") + * + * @param string $arg the key[s] to send provide records for + * @param bool $verbose print extra information + * @param bool $recursive recursively provide entire graph + * + * @return Command + */ + public function provide(string $arg, bool $verbose = false, bool $recursive = false): Command { return new Command(__METHOD__, get_defined_vars()); } + /** - * Write a key/value pair to the DHT. - * - * @Endpoint(name="dht:put") - * - * @param string $arg The key to store the value at. - * @param string $arg1 The value to store. - * @param bool $verbose Print extra information. - * - * @return Command - */ - public function put(string $arg, string $arg1, bool $verbose = false) : Command + * Write a key/value pair to the DHT. + * + * @Endpoint(name="dht:put") + * + * @param string $arg the key to store the value at + * @param string $arg1 the value to store + * @param bool $verbose print extra information + * + * @return Command + */ + public function put(string $arg, string $arg1, bool $verbose = false): Command { return new Command(__METHOD__, get_defined_vars()); } + /** - * Find the closest Peer IDs to a given Peer ID by querying the DHT. - * - * @Endpoint(name="dht:query") - * - * @param string $arg The peerID to run the query against. - * @param bool $verbose Print extra information. - * - * @return Command - */ - public function query(string $arg, bool $verbose = false) : Command + * Find the closest Peer IDs to a given Peer ID by querying the DHT. + * + * @Endpoint(name="dht:query") + * + * @param string $arg the peerID to run the query against + * @param bool $verbose print extra information + * + * @return Command + */ + public function query(string $arg, bool $verbose = false): Command { return new Command(__METHOD__, get_defined_vars()); } -} \ No newline at end of file +}