Skip to content

Commit

Permalink
Remove redundant doc blocks.
Browse files Browse the repository at this point in the history
Inherit documentation from the interface where possible.
  • Loading branch information
markstory committed Sep 19, 2017
1 parent 173293f commit 98f4673
Showing 1 changed file with 20 additions and 77 deletions.
97 changes: 20 additions & 77 deletions src/Http/Cookie/Cookie.php
Expand Up @@ -185,10 +185,7 @@ public function toHeaderValue()
}

/**
* Create a cookie with an updated name
*
* @param string $name Name of the cookie
* @return static
* {@inheritDoc}
*/
public function withName($name)
{
Expand All @@ -200,11 +197,7 @@ public function withName($name)
}

/**
* Get the id for a cookie
*
* Cookies are unique across name, domain, path tuples.
*
* @return string
* {@inheritDoc}
*/
public function getId()
{
Expand All @@ -214,9 +207,7 @@ public function getId()
}

/**
* Gets the cookie name
*
* @return string
* {@inheritDoc}
*/
public function getName()
{
Expand Down Expand Up @@ -245,20 +236,15 @@ protected function validateName($name)
}

/**
* Gets the cookie value
*
* @return string|array
* {@inheritDoc}
*/
public function getValue()
{
return $this->value;
}

/**
* Create a cookie with an updated value.
*
* @param string|array $value Value of the cookie to set
* @return static
* {@inheritDoc}
*/
public function withValue($value)
{
Expand All @@ -281,10 +267,7 @@ protected function _setValue($value)
}

/**
* Create a new cookie with an updated path
*
* @param string $path Sets the path
* @return static
* {@inheritDoc}
*/
public function withPath($path)
{
Expand All @@ -296,20 +279,15 @@ public function withPath($path)
}

/**
* Get the path attribute.
*
* @return string
* {@inheritDoc}
*/
public function getPath()
{
return $this->path;
}

/**
* Create a cookie with an updated domain
*
* @param string $domain Domain to set
* @return static
* {@inheritDoc}
*/
public function withDomain($domain)
{
Expand All @@ -321,9 +299,7 @@ public function withDomain($domain)
}

/**
* Get the domain attribute.
*
* @return string
* {@inheritDoc}
*/
public function getDomain()
{
Expand All @@ -348,20 +324,15 @@ protected function validateString($value)
}

/**
* Check if the cookie is secure
*
* @return bool
* {@inheritDoc}
*/
public function isSecure()
{
return $this->secure;
}

/**
* Create a cookie with Secure updated
*
* @param bool $secure Secure attribute value
* @return static
* {@inheritDoc}
*/
public function withSecure($secure)
{
Expand All @@ -373,10 +344,7 @@ public function withSecure($secure)
}

/**
* Create a cookie with HTTP Only updated
*
* @param bool $httpOnly HTTP Only
* @return static
* {@inheritDoc}
*/
public function withHttpOnly($httpOnly)
{
Expand Down Expand Up @@ -405,20 +373,15 @@ protected function validateBool($value)
}

/**
* Check if the cookie is HTTP only
*
* @return bool
* {@inheritDoc}
*/
public function isHttpOnly()
{
return $this->httpOnly;
}

/**
* Create a cookie with an updated expiration date
*
* @param \DateTime|\DateTimeImmutable $dateTime Date time object
* @return static
* {@inheritDoc}
*/
public function withExpiry($dateTime)
{
Expand All @@ -429,22 +392,15 @@ public function withExpiry($dateTime)
}

/**
* Get the current expiry time
*
* @return \DateTime|\DateTimeImmutable|null Timestamp of expiry or null
* {@inheritDoc}
*/
public function getExpiry()
{
return $this->expiresAt;
}

/**
* Get the timestamp from the expiration time
*
* Timestamps are strings as large timestamps can overflow MAX_INT
* in 32bit systems.
*
* @return string|null The expiry time as a string timestamp.
* {@inheritDoc}
*/
public function getExpiresTimestamp()
{
Expand All @@ -456,9 +412,7 @@ public function getExpiresTimestamp()
}

/**
* Builds the expiration value part of the header string
*
* @return string
* {@inheritDoc}
*/
public function getFormattedExpires()
{
Expand All @@ -470,12 +424,7 @@ public function getFormattedExpires()
}

/**
* Check if a cookie is expired when compared to $time
*
* Cookies without an expiration date always return false.
*
* @param \DateTime|\DateTimeImmutable $time The time to test against. Defaults to 'now' in UTC.
* @return bool
* {@inheritDoc}
*/
public function isExpired($time = null)
{
Expand All @@ -488,9 +437,7 @@ public function isExpired($time = null)
}

/**
* Create a new cookie that will virtually never expire.
*
* @return static
* {@inheritDoc}
*/
public function withNeverExpire()
{
Expand All @@ -501,11 +448,7 @@ public function withNeverExpire()
}

/**
* Create a new cookie that will expire/delete the cookie from the browser.
*
* This is done by setting the expiration time to 1 year ago
*
* @return static
* {@inheritDoc}
*/
public function withExpired()
{
Expand Down

0 comments on commit 98f4673

Please sign in to comment.