public function key() { if (null === ($key = key($this->resources))) { return null; } if ($this->mode & self::KEY_AS_PATH) { return $this->resources[$key]->getPath(); } return $key; }