Stroopwafel.php in Bakery Single Sign-On System 8.2
File
src/Cookies/Stroopwafel.php
View source
<?php
namespace Drupal\bakery\Cookies;
class Stroopwafel implements CookieInterface, RemoteCookieInterface {
private $uid;
private $data;
public final function __construct($uid, $data) {
$this->uid = $uid;
$this->data = $data;
}
public static function fromData(array $data) {
return new static($data['uid'], unserialize($data['data']));
}
public function toData() : array {
return [
'uid' => $this->uid,
'category' => 'account',
'data' => serialize($this->data),
];
}
public static function getName() : string {
return 'stroopwafel';
}
public function getPath() {
return 'bakery/update';
}
public function getUid() {
return $this->uid;
}
public function getData() {
return $this->data;
}
}