Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Quota.php

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

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal