You are here

protected function vfsStreamWrapper::calculateMode in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamWrapper.php \org\bovigo\vfs\vfsStreamWrapper::calculateMode()

calculates the file mode

Parameters

string $mode opening mode: r, w, a or x:

bool $extended true if + was set with opening mode:

Return value

int

1 call to vfsStreamWrapper::calculateMode()
vfsStreamWrapper::stream_open in vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamWrapper.php
open the stream

File

vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamWrapper.php, line 396

Class

vfsStreamWrapper
Stream wrapper to mock file system requests.

Namespace

org\bovigo\vfs

Code

protected function calculateMode($mode, $extended) {
  if (true === $extended) {
    return self::ALL;
  }
  if (self::READ === $mode) {
    return self::READONLY;
  }
  return self::WRITEONLY;
}