Skip to content

Commit

Permalink
feat: Share 服务加入 wei 中
Browse files Browse the repository at this point in the history
  • Loading branch information
twinh committed Aug 1, 2020
1 parent 3cc948b commit c881063
Show file tree
Hide file tree
Showing 4 changed files with 420 additions and 14 deletions.
202 changes: 192 additions & 10 deletions docs/auto-completion-static.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public static function until($name, $args = [])
/**
* Attach a handler to an event
*
* @param string|array $name The name of event, or an array that the key is event name and the value is event hanlder
* @param string|array $name The name of event, or an associative array contains event name and event handler pairs
* @param callable $fn The event handler
* @param int $priority The event priority
* @throws \InvalidArgumentException when the second argument is not callable
Expand Down Expand Up @@ -238,7 +238,7 @@ class Password
* Hash the password using the specified algorithm
*
* @param string $password The password to hash
* @return string|false The hashed password, or false on error.
* @return string|false the hashed password, or false on error
* @throws \InvalidArgumentException
* @see Password::hash
*/
Expand All @@ -259,7 +259,7 @@ public static function hash($password)
* )
*
* @param string $hash The password hash to extract info from
* @return array The array of information about the hash.
* @return array the array of information about the hash
* @see Password::getInfo
*/
public static function getInfo($hash)
Expand All @@ -272,7 +272,7 @@ public static function getInfo($hash)
* If the answer is true, after validating the password using password_verify, rehash it.
*
* @param string $hash The hash to test
* @return boolean True if the password needs to be rehashed.
* @return bool true if the password needs to be rehashed
* @see Password::needsRehash
*/
public static function needsRehash($hash)
Expand All @@ -284,7 +284,7 @@ public static function needsRehash($hash)
*
* @param string $password The password to verify
* @param string $hash The hash to verify against
* @return boolean If the password matches the hash
* @return bool If the password matches the hash
* @see Password::verify
*/
public static function verify($password, $hash)
Expand Down Expand Up @@ -340,6 +340,97 @@ class Session
{
}

class Share
{
/**
* @param string $title
* @return $this
* @see Share::setTitle
*/
public static function setTitle($title)
{
}

/**
* @return string
* @see Share::getTitle
*/
public static function getTitle()
{
}

/**
* @param string $image
* @return $this
* @see Share::setImage
*/
public static function setImage($image)
{
}

/**
* @return string
* @see Share::getImage
*/
public static function getImage()
{
}

/**
* @param string $description
* @return Share
* @see Share::setDescription
*/
public static function setDescription($description)
{
}

/**
* @return string
* @see Share::getDescription
*/
public static function getDescription()
{
}

/**
* @param string $url
* @return Share
* @see Share::setUrl
*/
public static function setUrl($url)
{
}

/**
* @return string
* @see Share::getUrl
*/
public static function getUrl()
{
}

/**
* Returns share data as JSON
*
* @return string
* @see Share::toJson
*/
public static function toJson()
{
}

/**
* Returns share data as JSON for WeChat
*
* @return string
* @see Share::toWechatJson
*/
public static function toWechatJson()
{
}
}

class Soap
{
}
Expand Down Expand Up @@ -868,7 +959,7 @@ public function until($name, $args = [])
/**
* Attach a handler to an event
*
* @param string|array $name The name of event, or an array that the key is event name and the value is event hanlder
* @param string|array $name The name of event, or an associative array contains event name and event handler pairs
* @param callable $fn The event handler
* @param int $priority The event priority
* @throws \InvalidArgumentException when the second argument is not callable
Expand Down Expand Up @@ -993,7 +1084,7 @@ class Password
* Hash the password using the specified algorithm
*
* @param string $password The password to hash
* @return string|false The hashed password, or false on error.
* @return string|false the hashed password, or false on error
* @throws \InvalidArgumentException
* @see Password::hash
*/
Expand All @@ -1014,7 +1105,7 @@ public function hash($password)
* )
*
* @param string $hash The password hash to extract info from
* @return array The array of information about the hash.
* @return array the array of information about the hash
* @see Password::getInfo
*/
public function getInfo($hash)
Expand All @@ -1027,7 +1118,7 @@ public function getInfo($hash)
* If the answer is true, after validating the password using password_verify, rehash it.
*
* @param string $hash The hash to test
* @return boolean True if the password needs to be rehashed.
* @return bool true if the password needs to be rehashed
* @see Password::needsRehash
*/
public function needsRehash($hash)
Expand All @@ -1039,7 +1130,7 @@ public function needsRehash($hash)
*
* @param string $password The password to verify
* @param string $hash The hash to verify against
* @return boolean If the password matches the hash
* @return bool If the password matches the hash
* @see Password::verify
*/
public function verify($password, $hash)
Expand Down Expand Up @@ -1095,6 +1186,97 @@ class Session
{
}

class Share
{
/**
* @param string $title
* @return $this
* @see Share::setTitle
*/
public function setTitle($title)
{
}

/**
* @return string
* @see Share::getTitle
*/
public function getTitle()
{
}

/**
* @param string $image
* @return $this
* @see Share::setImage
*/
public function setImage($image)
{
}

/**
* @return string
* @see Share::getImage
*/
public function getImage()
{
}

/**
* @param string $description
* @return Share
* @see Share::setDescription
*/
public function setDescription($description)
{
}

/**
* @return string
* @see Share::getDescription
*/
public function getDescription()
{
}

/**
* @param string $url
* @return Share
* @see Share::setUrl
*/
public function setUrl($url)
{
}

/**
* @return string
* @see Share::getUrl
*/
public function getUrl()
{
}

/**
* Returns share data as JSON
*
* @return string
* @see Share::toJson
*/
public function toJson()
{
}

/**
* Returns share data as JSON for WeChat
*
* @return string
* @see Share::toWechatJson
*/
public function toWechatJson()
{
}
}

class Soap
{
}
Expand Down
15 changes: 11 additions & 4 deletions docs/auto-completion.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,12 @@ class ServiceTraitMixin {
class SessionMixin {
}

/**
* @property Wei\Share $share A service contains share data
*/
class ShareMixin {
}

/**
* @property Wei\Soap $soap A Soap client that works like HTTP service
* @method Wei\Soap soap($options = []) Create a new Soap service and execute
Expand All @@ -331,7 +337,7 @@ class TMixin {

/**
* @property Wei\TagCache $tagCache A cache service that support tagging
* @method Wei\TagCache tagCache($tag, $_ = null, $__ = null) Manager: Create a new cache service with tagging support
* @method Wei\TagCache tagCache($tag, $ignore1 = null, $ignore2 = null) Manager: Create a new cache service with tagging support
*/
class TagCacheMixin {
}
Expand Down Expand Up @@ -693,14 +699,14 @@ class IsLuhnMixin {

/**
* @property Wei\Validator\MaxLength $isMaxLength Check if the length (or size) of input is lower than specified length
* @method mixed isMaxLength($input, $max = null, $__ = null)
* @method mixed isMaxLength($input, $max = null, $ignore = null)
*/
class IsMaxLengthMixin {
}

/**
* @property Wei\Validator\MinLength $isMinLength Check if the length (or size) of input is greater than specified length
* @method mixed isMinLength($input, $min = null, $__ = null)
* @method mixed isMinLength($input, $min = null, $ignore = null)
*/
class IsMinLengthMixin {
}
Expand All @@ -721,7 +727,7 @@ class IsNaturalNumberMixin {

/**
* @property Wei\Validator\NoneOf $isNoneOf Check if the input is NOT valid by all of specified rules
* @method mixed isNoneOf($input, $rules = [], $__ = null)
* @method mixed isNoneOf($input, $rules = [], $ignore = null)
*/
class IsNoneOfMixin {
}
Expand Down Expand Up @@ -927,6 +933,7 @@ class IsUuidMixin {
* @mixin SchemaMixin
* @mixin ServiceTraitMixin
* @mixin SessionMixin
* @mixin ShareMixin
* @mixin SoapMixin
* @mixin StatsDMixin
* @mixin TMixin
Expand Down
Loading

0 comments on commit c881063

Please sign in to comment.