Skip to content

Commit

Permalink
Fix for 7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
asika32764 committed Sep 4, 2017
1 parent b0dd5d2 commit b4bb1c9
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 5 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ php:
matrix:
allow_failures:
- php: hhvm
- php: 7.2

addons:
postgresql: "9.3"
Expand Down
2 changes: 1 addition & 1 deletion src/Event/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Event implements EventInterface, \ArrayAccess, \Serializable, \Countable
*
* @since 2.0
*/
protected $arguments;
protected $arguments = [];

/**
* A flag to see if the event propagation is stopped.
Expand Down
2 changes: 1 addition & 1 deletion src/Record/Record.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public function __construct($table = null, $keys = 'id', AbstractDataMapper $map

if ($this->autoIncrement === null)
{
$this->autoIncrement = count($keys) === 1;
$this->autoIncrement = count($this->keys) === 1;
}

$this->mapper = $mapper ? : new DataMapper($this->table, $this->keys);
Expand Down
5 changes: 4 additions & 1 deletion src/Session/Bridge/NativeBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,10 @@ public function getCookieParams()
*/
public function setCookieParams($lifetime, $path = null, $domain = null, $secure = false, $httponly = true)
{
session_set_cookie_params($lifetime, $path, $domain, $secure, $httponly);
if (!headers_sent())
{
session_set_cookie_params($lifetime, $path, $domain, $secure, $httponly);
}

return $this;
}
Expand Down
5 changes: 4 additions & 1 deletion src/Session/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,10 @@ protected function init()
}

// Sync the session maxlifetime
ini_set('session.gc_maxlifetime', $this->getOption('expire_time') * 60);
if (!headers_sent())
{
ini_set('session.gc_maxlifetime', $this->getOption('expire_time') * 60);
}

$this->setCookieParams();
}
Expand Down
5 changes: 4 additions & 1 deletion src/Session/Test/Mock/MockArrayBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,10 @@ public function getCookieParams()
*/
public function setCookieParams($lifetime, $path = null, $domain = null, $secure = false, $httponly = true)
{
session_set_cookie_params($lifetime, $path, $domain, $secure, $httponly);
if (!headers_sent())
{
session_set_cookie_params($lifetime, $path, $domain, $secure, $httponly);
}

return $this;
}
Expand Down

0 comments on commit b4bb1c9

Please sign in to comment.