Skip to content

Commit 49fed8b

Browse files
author
Matias Melograno
committed
added comments
1 parent 815673b commit 49fed8b

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/SplitIO/Component/Cache/SegmentCache.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public function isInSegment($segmentName, $key)
3737
public function getChangeNumber($segmentName)
3838
{
3939
$since = Di::getCache()->getItem(self::getCacheKeyForSinceParameter($segmentName))->get();
40+
// empty check for nullable value
4041
return (empty($since)) ? -1 : $since;
4142
}
4243
}

src/SplitIO/Component/Cache/SplitCache.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ private static function getSplitNameFromCacheKey($key)
3838
public function getChangeNumber()
3939
{
4040
$since = Di::getCache()->getItem(self::getCacheKeyForSinceParameter())->get();
41+
// empty check for nullable value
4142
return (empty($since)) ? -1 : $since;
4243
}
4344

@@ -100,6 +101,7 @@ public function trafficTypeExists($trafficType)
100101
$cache = Di::getCache();
101102

102103
$count = $cache->getItem(self::getCacheKeyForTrafficType($trafficType))->get();
104+
// empty check for nullable value
103105
return (empty($count) || $count < 1) ? false : true;
104106
}
105107
}

0 commit comments

Comments
 (0)