Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 26 deletions.
8 changes: 4 additions & 4 deletions src/Container/Movable.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Movable extends AbstractContainer
/**
* Internal object Id
*
* @var integer
* @var int
*/
protected $id;

Expand All @@ -48,15 +48,15 @@ class Movable extends AbstractContainer
/**
* Value state (LOADED/SWAPPED/LOCKED)
*
* @var integer
* @var int
*/
private $state;

/**
* Object constructor
*
* @param \Zend\Memory\MemoryManager $memoryManager
* @param integer $id
* @param int $id
* @param string $value
*/
public function __construct(Memory\MemoryManager $memoryManager, $id, $value)
Expand Down Expand Up @@ -255,7 +255,7 @@ public function isSwapped()
* Get object id
*
* @internal
* @return integer
* @return int
*/
public function getId()
{
Expand Down
34 changes: 17 additions & 17 deletions src/MemoryManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class MemoryManager
* Default value is 2/3 of memory_limit php.ini variable
* Negative value means no limit
*
* @var integer
* @var int
*/
private $memoryLimit = -1;

Expand All @@ -42,21 +42,21 @@ class MemoryManager
* Default value is 16K
* Negative value means that memory objects are never swapped
*
* @var integer
* @var int
*/
private $minSize = 16384;

/**
* Overall size of memory, used by values
*
* @var integer
* @var int
*/
private $memorySize = 0;

/**
* Id for next Zend_Memory object
*
* @var integer
* @var int
*/
private $nextId = 0;

Expand Down Expand Up @@ -100,7 +100,7 @@ class MemoryManager
/**
* Unique memory manager id
*
* @var integer
* @var int
*/
private $managerId;

Expand Down Expand Up @@ -135,9 +135,9 @@ public function __construct(CacheStorage $cache = null)
$this->_generateMemManagerId();

$memoryLimitStr = trim(ini_get('memory_limit'));
if ($memoryLimitStr != '' && $memoryLimitStr != -1) {
$this->memoryLimit = (integer)$memoryLimitStr;
switch (strtolower($memoryLimitStr[strlen($memoryLimitStr)-1])) {
if ($memoryLimitStr != '' && $memoryLimitStr != -1) {
$this->memoryLimit = (int) $memoryLimitStr;
switch (strtolower($memoryLimitStr[strlen($memoryLimitStr) - 1])) {
case 'g':
$this->memoryLimit *= 1024;
// no break
Expand Down Expand Up @@ -174,7 +174,7 @@ public function __destruct()
/**
* Set memory grow limit
*
* @param integer $newLimit
* @param int $newLimit
*/
public function setMemoryLimit($newLimit)
{
Expand All @@ -186,7 +186,7 @@ public function setMemoryLimit($newLimit)
/**
* Get memory grow limit
*
* @return integer
* @return int
*/
public function getMemoryLimit()
{
Expand All @@ -196,7 +196,7 @@ public function getMemoryLimit()
/**
* Set minimum size of values, which may be swapped
*
* @param integer $newSize
* @param int $newSize
*/
public function setMinSize($newSize)
{
Expand All @@ -206,7 +206,7 @@ public function setMinSize($newSize)
/**
* Get minimum size of values, which may be swapped
*
* @return integer
* @return int
*/
public function getMinSize()
{
Expand Down Expand Up @@ -274,7 +274,7 @@ private function _create($value, $locked)
*
* @internal
* @param Container\Movable $container
* @param integer $id
* @param int $id
* @return null
*/
public function unlink(Container\Movable $container, $id)
Expand All @@ -299,7 +299,7 @@ public function unlink(Container\Movable $container, $id)
*
* @internal
* @param \Zend\Memory\Container\Movable $container
* @param integer $id
* @param int $id
*/
public function processUpdate(Container\Movable $container, $id)
{
Expand All @@ -314,7 +314,7 @@ public function processUpdate(Container\Movable $container, $id)
}

// Remove just updated object from list of candidates to unload
if ( isset($this->unloadCandidates[$id])) {
if (isset($this->unloadCandidates[$id])) {
unset($this->unloadCandidates[$id]);
}

Expand Down Expand Up @@ -386,7 +386,7 @@ private function _swapCheck()
* if object is not changed since last swap
*
* @param \Zend\Memory\Container\Movable $container
* @param integer $id
* @param int $id
*/
private function _swap(Container\Movable $container, $id)
{
Expand All @@ -409,7 +409,7 @@ private function _swap(Container\Movable $container, $id)
*
* @internal
* @param \Zend\Memory\Container\Movable $container
* @param integer $id
* @param int $id
*/
public function load(Container\Movable $container, $id)
{
Expand Down
10 changes: 5 additions & 5 deletions src/Value.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 +79,19 @@ public function count()
* ArrayAccess interface method
* returns true if string offset exists
*
* @param integer $offset
* @param int $offset
* @return bool
*/
public function offsetExists($offset)
{
return $offset >= 0 && $offset < strlen($this->value);
return $offset >= 0 && $offset < strlen($this->value);
}

/**
* ArrayAccess interface method
* Get character at $offset position
*
* @param integer $offset
* @param int $offset
* @return string
*/
public function offsetGet($offset)
Expand All @@ -103,7 +103,7 @@ public function offsetGet($offset)
* ArrayAccess interface method
* Set character at $offset position
*
* @param integer $offset
* @param int $offset
* @param string $char
*/
public function offsetSet($offset, $char)
Expand All @@ -120,7 +120,7 @@ public function offsetSet($offset, $char)
* ArrayAccess interface method
* Unset character at $offset position
*
* @param integer $offset
* @param int $offset
*/
public function offsetUnset($offset)
{
Expand Down

0 comments on commit 57fe8e9

Please sign in to comment.