* expires A date string
* path The path this cookie is used on
* domain Domain this cookie is used on
- * @throws MWException
+ * @throws InvalidArgumentException
*/
public function set( $value, $attr ) {
$this->value = $value;
}
class CookieJar {
- private $cookie = array();
+ private $cookie = [];
/**
* Set a cookie in the cookie jar. Make sure only one cookie per-name exists.
* @return string
*/
public function serializeToHttpRequest( $path, $domain ) {
- $cookies = array();
+ $cookies = [];
foreach ( $this->cookie as $c ) {
$serialized = $c->serializeToHttpRequest( $path, $domain );
if ( count( $bit ) >= 1 ) {
list( $name, $value ) = explode( '=', array_shift( $bit ), 2 );
- $attr = array();
+ $attr = [];
foreach ( $bit as $piece ) {
$parts = explode( '=', $piece );