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; }