Skip to content
This repository has been archived by the owner on Jul 12, 2020. It is now read-only.

Commit

Permalink
Code Styling
Browse files Browse the repository at this point in the history
  • Loading branch information
Art4 committed Dec 6, 2018
1 parent 6e60d7d commit 748697f
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 40 deletions.
2 changes: 1 addition & 1 deletion src/Http/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function createRequest($method, $target, array $headers = [], $body = nul
* $options can be used to set client specific data per request, like curl options
*
* @param Psr\Http\Message\RequestInterface $request,
* @param array $options client specific options for a client instance
* @param array $options client specific options for a client instance
*
* @return Psr\Http\Message\ResponseInterface
*/
Expand Down
8 changes: 5 additions & 3 deletions src/Http/MessageTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ public function withoutHeader($name)
/**
* Gets the body of the message.
*
* @return StreamInterface Returns the body as a stream.
* @return StreamInterface returns the body as a stream
*/
public function getBody()
{
Expand All @@ -323,9 +323,11 @@ public function getBody()
* immutability of the message, and MUST return a new instance that has the
* new body stream.
*
* @param StreamInterface $body Body.
* @param StreamInterface $body body
*
* @throws \InvalidArgumentException when the body is not valid
*
* @return static
* @throws \InvalidArgumentException When the body is not valid.
*/
public function withBody(StreamInterface $body)
{
Expand Down
15 changes: 9 additions & 6 deletions src/Http/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,10 @@ public function withMethod($method)
*
* This method MUST return a UriInterface instance.
*
* @link http://tools.ietf.org/html/rfc3986#section-4.3
* @return UriInterface Returns a UriInterface instance
* representing the URI of the request.
* @see http://tools.ietf.org/html/rfc3986#section-4.3
*
* @return UriInterface returns a UriInterface instance
* representing the URI of the request
*/
public function getUri()
{
Expand Down Expand Up @@ -207,9 +208,11 @@ public function getUri()
* immutability of the message, and MUST return an instance that has the
* new UriInterface instance.
*
* @link http://tools.ietf.org/html/rfc3986#section-4.3
* @param UriInterface $uri New request URI to use.
* @param bool $preserveHost Preserve the original state of the Host header.
* @see http://tools.ietf.org/html/rfc3986#section-4.3
*
* @param UriInterface $uri new request URI to use
* @param bool $preserveHost preserve the original state of the Host header
*
* @return static
*/
public function withUri(UriInterface $uri, $preserveHost = false)
Expand Down
62 changes: 36 additions & 26 deletions src/Http/StringStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public function __construct($string)
* string casting operations.
*
* @see http://php.net/manual/en/language.oop5.magic.php#object.tostring
*
* @return string
*/
public function __toString()
Expand All @@ -60,8 +61,6 @@ public function __toString()

/**
* Closes the stream and any underlying resources.
*
* @return void
*/
public function close()
{
Expand All @@ -83,7 +82,7 @@ public function detach()
/**
* Get the size of the stream if known.
*
* @return int|null Returns the size in bytes if known, or null if unknown.
* @return int|null returns the size in bytes if known, or null if unknown
*/
public function getSize()
{
Expand All @@ -93,8 +92,9 @@ public function getSize()
/**
* Returns the current position of the file read/write pointer
*
* @throws \RuntimeException on error
*
* @return int Position of the file pointer
* @throws \RuntimeException on error.
*/
public function tell()
{
Expand Down Expand Up @@ -124,14 +124,16 @@ public function isSeekable()
/**
* Seek to a position in the stream.
*
* @link http://www.php.net/manual/en/function.fseek.php
* @see http://www.php.net/manual/en/function.fseek.php
*
* @param int $offset Stream offset
* @param int $whence Specifies how the cursor position will be calculated
* based on the seek offset. Valid values are identical to the built-in
* PHP $whence values for `fseek()`. SEEK_SET: Set position equal to
* offset bytes SEEK_CUR: Set position to current location plus offset
* SEEK_END: Set position to end-of-stream plus offset.
* @throws \RuntimeException on failure.
* based on the seek offset. Valid values are identical to the built-in
* PHP $whence values for `fseek()`. SEEK_SET: Set position equal to
* offset bytes SEEK_CUR: Set position to current location plus offset
* SEEK_END: Set position to end-of-stream plus offset.
*
* @throws \RuntimeException on failure
*/
public function seek($offset, $whence = SEEK_SET)
{
Expand All @@ -145,8 +147,9 @@ public function seek($offset, $whence = SEEK_SET)
* otherwise, it will perform a seek(0).
*
* @see seek()
* @link http://www.php.net/manual/en/function.fseek.php
* @throws \RuntimeException on failure.
* @see http://www.php.net/manual/en/function.fseek.php
*
* @throws \RuntimeException on failure
*/
public function rewind()
{
Expand All @@ -166,9 +169,11 @@ public function isWritable()
/**
* Write data to the stream.
*
* @param string $string The string that is to be written.
* @return int Returns the number of bytes written to the stream.
* @throws \RuntimeException on failure.
* @param string $string the string that is to be written
*
* @throws \RuntimeException on failure
*
* @return int returns the number of bytes written to the stream
*/
public function write($string)
{
Expand All @@ -189,11 +194,13 @@ public function isReadable()
* Read data from the stream.
*
* @param int $length Read up to $length bytes from the object and return
* them. Fewer than $length bytes may be returned if underlying stream
* call returns fewer bytes.
* @return string Returns the data read from the stream, or an empty string
* if no bytes are available.
* @throws \RuntimeException if an error occurs.
* them. Fewer than $length bytes may be returned if underlying stream
* call returns fewer bytes.
*
* @throws \RuntimeException if an error occurs
*
* @return string returns the data read from the stream, or an empty string
* if no bytes are available
*/
public function read($length)
{
Expand All @@ -203,9 +210,10 @@ public function read($length)
/**
* Returns the remaining contents in a string
*
* @return string
* @throws \RuntimeException if unable to read or an error occurs while
* reading.
* reading
*
* @return string
*/
public function getContents()
{
Expand All @@ -218,11 +226,13 @@ public function getContents()
* The keys returned are identical to the keys returned from PHP's
* stream_get_meta_data() function.
*
* @link http://php.net/manual/en/function.stream-get-meta-data.php
* @param string $key Specific metadata to retrieve.
* @see http://php.net/manual/en/function.stream-get-meta-data.php
*
* @param string $key specific metadata to retrieve
*
* @return array|mixed|null Returns an associative array if no key is
* provided. Returns a specific key value if a key is provided and the
* value is found, or null if the key is not found.
* provided. Returns a specific key value if a key is provided and the
* value is found, or null if the key is not found.
*/
public function getMetadata($key = null)
{
Expand Down
8 changes: 4 additions & 4 deletions src/Provider/Youtube/SignatureDecipher.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public static function downloadRawPlayerScript($playerURL)
/**
* extract decipher opcode from raw player script
*
* @param string $decipherScript
* @param string $decipherScript
* @param Psr\Log\LoggerInterface $logger
*
* @return array return operation codes
Expand Down Expand Up @@ -173,9 +173,9 @@ public static function extractDecipherOpcode($decipherScript, LoggerInterface $l
*
* @internal
*
* @param string $patterns
* @param string $deciphers
* @param string $signature
* @param string $patterns
* @param string $deciphers
* @param string $signature
* @param Psr\Log\LoggerInterface $logger
*
* @return string return deciphered signature
Expand Down

0 comments on commit 748697f

Please sign in to comment.