Storage/src/Bucket.php
public function objects(array $options = [])
    {
        $resultLimit = $this->pluck('resultLimit', $options, false);

        return new ObjectIterator(
            new ObjectPageIterator(
                function (array $object) {
                    return new StorageObject(
                        $this->connection,
                        $object['name'],
                        $this->identity['bucket'],
                        isset($object['generation']) ? $object['generation'] : null,
                        $object + array_filter([
                            'requesterProjectId' => $this->identity['userProject']
                        ])
                    );
                },
                [$this->connection, 'listObjects'],
                $options + $this->identity,
                ['resultLimit' => $resultLimit]
            )
        );
    }
public function objects(array $options = [])
    {
        $resultLimit = $this->pluck('resultLimit', $options, false);

        return new ObjectIterator(
            new ObjectPageIterator(
                function (array $object) {
                    return new StorageObject(
                        $this->connection,
                        $object['name'],
                        $this->identity['bucket'],
                        isset($object['generation']) ? $object['generation'] : null,
                        $object + array_filter([
                            'requesterProjectId' => $this->identity['userProject']
                        ])
                    );
                },
                [$this->connection, 'listObjects'],
                $options + $this->identity,
                ['resultLimit' => $resultLimit]
            )
        );
    }
public function objects ( array $ options = [ ] ) { $ resultLimit = $ this -> pluck ( 'resultLimit' , $ options , false ) ; return new ObjectIterator ( new ObjectPageIterator ( function ( array $ object ) { return new StorageObject ( $ this -> connection , $ object [ 'name' ] , $ this -> identity [ 'bucket' ] , isset ( $ object [ 'generation' ] ) ? $ object [ 'generation' ] : null , $ object + array_filter ( [ 'requesterProjectId' => $ this -> identity [ 'userProject' ] ] ) ) ; } , [ $ this -> connection , 'listObjects' ] , $ options + $ this -> identity , [ 'resultLimit' => $ resultLimit ] ) ) ; }
Fetches all objects in the bucket.

Example:
```
// Get all objects beginning with the prefix 'photo'
$objects = $bucket->objects([
'prefix' => 'photo',
'fields' => 'items/name,nextPageToken'
]);

foreach ($objects as $object) {
echo $object->name() . PHP_EOL;
}
```

@see https://cloud.google.com/storage/docs/json_api/v1/objects/list Objects list API documentation.

@param array $options [optional] {
Configuration options.

@type string $delimiter Returns results in a directory-like mode.
Results will contain only objects whose names, aside from the
prefix, do not contain delimiter. Objects whose names, aside
from the prefix, contain delimiter will have their name,
truncated after the delimiter, returned in prefixes. Duplicate
prefixes are omitted.
@type int $maxResults Maximum number of results to return per
request. **Defaults to** `1000`.
@type int $resultLimit Limit the number of results returned in total.
**Defaults to** `0` (return all results).
@type string $pageToken A previously-returned page token used to
resume the loading of results from a specific point.
@type string $prefix Filter results with this prefix.
@type string $projection Determines which properties to return. May
be either `"full"` or `"noAcl"`.
@type bool $versions If true, lists all versions of an object as
distinct results. **Defaults to** `false`.
@type string $fields Selector which will cause the response to only
return the specified fields.
}
@return ObjectIterator<StorageObject>
Fetches all objects in the bucket .