Skip to content

Commit

Permalink
Added type hinting and code style in SemaphoresManager
Browse files Browse the repository at this point in the history
  • Loading branch information
micheleangioni committed May 17, 2017
1 parent 77c0e94 commit 52b8725
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/MicheleAngioni/Support/Semaphores/SemaphoresManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function __construct(CacheInterface $cache, KeyManagerInterface $keyManag
*
* @return int
*/
public function getLockingTime()
public function getLockingTime(): int
{
return $this->lockingTime;
}
Expand All @@ -55,9 +55,9 @@ public function getLockingTime()
*
* @return int
*/
public function setLockingTime($minutes)
public function setLockingTime(int $minutes): int
{
return $this->lockingTime = (int)$minutes;
return $this->lockingTime = $minutes;
}

/**
Expand All @@ -68,7 +68,7 @@ public function setLockingTime($minutes)
*
* @return string
*/
public function getSemaphoreKey($id, $section)
public function getSemaphoreKey($id, string $section)
{
return $this->keyManager->getKey($id, [], $section);
}
Expand All @@ -81,7 +81,7 @@ public function getSemaphoreKey($id, $section)
*
* @return int
*/
public function checkIfSemaphoreIsLocked($id, $section)
public function checkIfSemaphoreIsLocked($id, string $section): int
{
$key = $this->getSemaphoreKey($id, $section);

Expand All @@ -98,7 +98,7 @@ public function checkIfSemaphoreIsLocked($id, $section)
* @param string $id
* @param string $section
*/
public function lockSemaphore($id, $section)
public function lockSemaphore($id, string $section)
{
$key = $this->getSemaphoreKey($id, $section);

Expand All @@ -111,7 +111,7 @@ public function lockSemaphore($id, $section)
* @param string $id
* @param string $section
*/
public function unlockSemaphore($id, $section)
public function unlockSemaphore($id, string $section)
{
$key = $this->getSemaphoreKey($id, $section);

Expand Down

0 comments on commit 52b8725

Please sign in to comment.