Skip to content

Commit

Permalink
Add lang.FormatException to imports
Browse files Browse the repository at this point in the history
  • Loading branch information
thekid committed Apr 5, 2020
1 parent d5147f6 commit 94b2094
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main/php/unittest/web/Cookie.class.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php namespace unittest\web;

use lang\FormatException;

/**
* Represents a cookie
*
Expand All @@ -15,6 +17,13 @@ public function __construct($name, $value, $attributes= []) {
$this->attributes= $attributes;
}

/**
* Parse a cookie from a header value
*
* @param string $header
* @return self
* @throws lang.FormatException
*/
public static function parse($header) {
sscanf($header, '%[^=]=%[^;]', $name, $value);
if (false === ($offset= strpos($header, ';'))) {
Expand Down

0 comments on commit 94b2094

Please sign in to comment.