Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
frqnck committed Apr 28, 2017
1 parent cf9abc2 commit 6853123
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 49 deletions.
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@
"psr/cache": "1.0.*"
},
"require-dev": {
"phpunit/phpunit": "^3.7.0|^5.0.5",
"satooshi/php-coveralls": "~0.7.1"
"phpunit/phpunit": "^4.8|^5.7",
"satooshi/php-coveralls": "~0.7.1",
"cache/integration-tests": "dev-master"
},
"suggest": {
"ext-apc": "Allows to cache into APC data store ~ up to PHP 5.4.",
Expand Down
40 changes: 1 addition & 39 deletions src/PsrCache/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@ class Item implements ItemInterface
{
const DEFAULT_EXPIRATION = 'now +1 year';

/**
* The pool that the item belongs to.
* @var ItemPoolInterface
*/
// protected $pool;

/**
* The cache key for the item.
* @var string
Expand Down Expand Up @@ -114,39 +108,7 @@ public function set($value = null)
*/
public function isHit()
{
return $this->hit && $this->getTtlInSecond() > 0;
}

/**
* @deprecated
* @codeCoverageIgnore
*/
public function exists()
{
return $this->hit;
}

/**
* @deprecated
* @codeCoverageIgnore
*/
public function isRegenerating()
{
return false;
}

/**
* @deprecated
* @see Item::expiresAt()
* @codeCoverageIgnore
*/
public function setExpiration($ttl = null)
{
if (is_int($ttl)) {
$ttl = new \DateTime('now +' . $ttl . ' seconds');
}

return $this->expiresAt($ttl);
return $this->hit && $this->getTtlInSecond() > 0;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/PsrCache/Pool.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public function save(ItemInterface $item)
$item->get(), // value to store
$item->getKey(), // its key
null, // disable tags support
is_null($ttl) ? 0 : $ttl // ttl in sec or null for ever
is_null($ttl) ? 0 : $ttl // ttl in sec or null forever
);
$item->setHit($success);

Expand Down
7 changes: 0 additions & 7 deletions tests/PsrCache/ItemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public function testItemConstructor()
$this->assertNull($item->get());

$this->assertFalse($item->isHit());
$this->assertFalse($item->exists());
}

public function testItemConstructorHittingCache()
Expand All @@ -48,7 +47,6 @@ public function testItemConstructorHittingCache()
$this->assertEquals('bar', $item->get());

$this->assertTrue($item->isHit());
$this->assertTrue($item->exists());
}

public function testSetAndisHit()
Expand Down Expand Up @@ -123,11 +121,6 @@ public function testExpiresAfter($from, $to)
);
}

public function testItemIsRegenerating()
{
$this->assertFalse($this->item->isRegenerating());
}

/**
* @expectedException Apix\Cache\PsrCache\InvalidArgumentException
*/
Expand Down

0 comments on commit 6853123

Please sign in to comment.