Skip to content

Commit fbc60f3

Browse files
committed
Remove deprecation of attribute validation in Cookie::__construct
1 parent 5fb7027 commit fbc60f3

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
- FilteredStream::getReadFilter The read filter is internal and should never be used by consuming code.
1919
- FilteredStream::getWriteFilter We did not implement writing to the streams at all. And if we do, the filter is an internal information and should not be used by consuming code.
20-
- Attributes validation during Cookie instantiation is deprecated and will be removed in 2.0. Use the new `Cookie::isValid` to check if attributes are valid.
2120

2221

2322
## 1.4.1 - 2016-12-16

src/Cookie.php

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ final class Cookie
6363
* @param bool $httpOnly
6464
* @param \DateTime|null $expires Expires attribute is HTTP 1.0 only and should be avoided.
6565
*
66-
* @throws \InvalidArgumentException If name, value or max age is not valid. Attributes validation during instantiation is deprecated since 1.5 and will be removed in 2.0.
66+
* @throws \InvalidArgumentException If name, value or max age is not valid.
6767
*/
6868
public function __construct(
6969
$name,
@@ -75,14 +75,9 @@ public function __construct(
7575
$httpOnly = false,
7676
\DateTime $expires = null
7777
) {
78-
try {
79-
$this->validateName($name);
80-
$this->validateValue($value);
81-
$this->validateMaxAge($maxAge);
82-
} catch (\InvalidArgumentException $e) {
83-
@trigger_error('Attributes validation during instantiation is deprecated since 1.5 and will be removed in 2.0', E_USER_DEPRECATED);
84-
throw $e;
85-
}
78+
$this->validateName($name);
79+
$this->validateValue($value);
80+
$this->validateMaxAge($maxAge);
8681

8782
$this->name = $name;
8883
$this->value = $value;

0 commit comments

Comments
 (0)