You are here

public function Quota::spaceLeft in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/Quota.php \org\bovigo\vfs\Quota::spaceLeft()

checks if given used space exceeda quota limit

Parameters

int $usedSpace:

Return value

int

File

vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/Quota.php, line 69

Class

Quota
Represents a quota for disk space.

Namespace

org\bovigo\vfs

Code

public function spaceLeft($usedSpace) {
  if (self::UNLIMITED === $this->amount) {
    return $usedSpace;
  }
  if ($usedSpace >= $this->amount) {
    return 0;
  }
  $spaceLeft = $this->amount - $usedSpace;
  if (0 >= $spaceLeft) {
    return 0;
  }
  return $spaceLeft;
}