Skip to content

Commit

Permalink
phalcon#10789 - Use DI to instantiate Cookie object
Browse files Browse the repository at this point in the history
  • Loading branch information
Olivier Garbé committed Aug 13, 2015
1 parent 5ccecc2 commit 9341efa
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions phalcon/http/response/cookies.zep
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,9 @@ class Cookies implements CookiesInterface, InjectionAwareInterface
* Check if the cookie needs to be updated or
*/
if !fetch cookie, this->_cookies[name] {

let cookie = new Cookie(name, value, expire, path, secure, domain, httpOnly);
let cookie =
<Cookie> this->_dependencyInjector->get("Phalcon\\Http\\Cookie",
[name, value, expire, path, secure, domain, httpOnly]);

/**
* Pass the DI to created cookies
Expand Down Expand Up @@ -154,7 +155,7 @@ class Cookies implements CookiesInterface, InjectionAwareInterface
/**
* Create the cookie if the it does not exist
*/
let cookie = new Cookie(name),
let cookie = <Cookie> this->_dependencyInjector->get("Phalcon\\Http\\Cookie", [name]),
dependencyInjector = this->_dependencyInjector;

if typeof dependencyInjector == "object" {
Expand Down

0 comments on commit 9341efa

Please sign in to comment.