Skip to content

Commit

Permalink
Adding Session::expires_at() method
Browse files Browse the repository at this point in the history
  • Loading branch information
PGBI committed Jul 15, 2016
1 parent 6273573 commit cdeb8c7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
/vendor
composer.lock
tmp
coverage.xml
/reports
11 changes: 11 additions & 0 deletions src/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Classy;

use Classy\Exceptions\SDKException;
use DateTime;

Class Session implements \Serializable
{
Expand Down Expand Up @@ -68,6 +69,16 @@ public function expired()
return time() > $this->expires_at;
}

/**
* @return DateTime
*/
public function expires_at()
{
$result = new DateTime();
$result->setTimestamp($this->expires_at);
return $result;
}


/**
* String representation of object
Expand Down

0 comments on commit cdeb8c7

Please sign in to comment.