public function supports(mixed $resource, ?string $type = null) : bool { return \is_string($resource) && preg_match('/^(?:\\\\?[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*)+$/', $resource) && (!$type || 'attribute' === $type); }