Lines Matching refs:resource
39 * @param resource|string|StreamInterface $resource Entity body data
45 public static function factory($resource = '', array $options = []) argument
47 $type = gettype($resource);
51 if ($resource !== '') {
52 fwrite($stream, $resource);
59 return new self($resource, $options);
62 if ($resource instanceof StreamInterface) {
63 return $resource;
66 if ($type == 'object' && method_exists($resource, '__toString')) {
67 return self::factory((string) $resource, $options);
70 if (is_callable($resource)) {
71 return new PumpStream($resource, $options);
74 if ($resource instanceof \Iterator) {
75 return new PumpStream(function () use ($resource) {
76 if (!$resource->valid()) {
79 $result = $resource->current();
80 $resource->next();