<?php

namespace Rosio\EncryptedCookie;

class CookieFactory
{
	private $cryptoSystem;

	function __construct (iCryptoSystem $cryptoSystem)
	{
		$this->cryptoSystem = $cryptoSystem;
	}

	function createCookie ($name)
	{
		return new EncryptedCookie ($name)->setCryptoSystem($this->cryptoSystem);
	}

	function getCookie ($name)
	{
		return new EncryptedCookie($name)->setCryptoSystem($this->cryptoSystem)->load();
	}
}
<?php

namespace Rosio\EncryptedCookie;

use Rosio\EncryptedCookie\CryptoSystem\iCryptoSystem;

class CookieFactory
{
	private $cryptoSystem;

	function __construct (iCryptoSystem $cryptoSystem)
	{
		$this->cryptoSystem = $cryptoSystem;
	}

	function create ($name)
	{
		$cookie = new EncryptedCookie ($name);
		$cookie->setCryptoSystem($this->cryptoSystem);

		return $cookie;
	}

	function get ($name)
	{
		$cookie = new EncryptedCookie ($name);
		$cookie->setCryptoSystem($this->cryptoSystem)->load();

		return $cookie;
	}
}
Fix iCryptoSystem missing, shorten function names, fix chaining issue
Fix iCryptoSystem missing, shorten function names, fix chaining issue
