Classes/Command/S3CommandController.php
/**
     * Removes all objects from a bucket
     *
     * This command deletes all objects (files) of the given bucket.
     *
     * @param string $bucket Name of the bucket
     * @return void
     */
Removes all objects from a bucket
This command deletes all objects (files) of the given bucket.

@param string $bucket Name of the bucket
@return void
Removes all objects from a bucket This command deletes all objects ( files ) of the given bucket . @param string $bucket Name of the bucket @return void
public function flushBucketCommand(string $bucket): void
    {
        try {
            $batchDelete = BatchDelete::fromListObjects($this->s3Client, ['Bucket' => $bucket]);
            $promise = $batchDelete->promise();
        } catch (\Exception $e) {
            $this->outputLine($e->getMessage());
            $this->quit(1);
            exit;
        }
        $promise->wait();
        $this->outputLine('Successfully flushed bucket %s.', [$bucket]);
    }
public function flushBucketCommand ( string $ bucket ) : void { try { $ batchDelete = BatchDelete :: fromListObjects ( $ this -> s3Client , [ 'Bucket' => $ bucket ] ) ; $ promise = $ batchDelete -> promise ( ) ; } catch ( \ Exception $ e ) { $ this -> outputLine ( $ e -> getMessage ( ) ) ; $ this -> quit ( 1 ) ; exit ; } $ promise -> wait ( ) ; $ this -> outputLine ( 'Successfully flushed bucket %s.' , [ $ bucket ] ) ; }
Removes all objects from a bucket
 This command deletes all objects (files) of the given bucket.
Removes all objects from a bucket This command deletes all objects ( files ) of the given bucket .