function Extension::__call

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Extension/Extension.php \Drupal\Core\Extension\Extension::__call()
  2. 10 core/lib/Drupal/Core/Extension/Extension.php \Drupal\Core\Extension\Extension::__call()

Re-routes method calls to SplFileInfo.

Offers all SplFileInfo methods to consumers; e.g., $extension->getMTime().

File

core/lib/Drupal/Core/Extension/Extension.php, line 159

Class

Extension
Defines an extension (file) object.

Namespace

Drupal\Core\Extension

Code

public function __call($method, array $args) {
    if (!isset($this->splFileInfo)) {
        $this->splFileInfo = new \SplFileInfo($this->root . '/' . $this->pathname);
    }
    return call_user_func_array([
        $this->splFileInfo,
        $method,
    ], $args);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.