Classes/Command/S3CommandController.php
/**
     * Displays a list of buckets
     *
     * This command outputs a list of all buckets from the currently configured S3
     * account.
     *
     * @return void
     */
Displays a list of buckets
This command outputs a list of all buckets from the currently configured S3
account.

@return void
Displays a list of buckets This command outputs a list of all buckets from the currently configured S3 account . @return void
public function listBucketsCommand(): void
    {
        try {
            $result = $this->s3Client->listBuckets();
        } catch (\Exception $e) {
            $this->outputLine($e->getMessage());
            $this->quit(1);
            exit;
        }
        if (count($result['Buckets']) === 0) {
            $this->outputLine('The account currently does not have any buckets.');
        }
        $tableRows = [];
        $headerRow = ['Bucket Name', 'Creation Date'];
        foreach ($result['Buckets'] as $bucket) {
            $tableRows[] = [$bucket['Name'], $bucket['CreationDate']];
        }
        $this->output->outputTable($tableRows, $headerRow);
    }
public function listBucketsCommand ( ) : void { try { $ result = $ this -> s3Client -> listBuckets ( ) ; } catch ( \ Exception $ e ) { $ this -> outputLine ( $ e -> getMessage ( ) ) ; $ this -> quit ( 1 ) ; exit ; } if ( count ( $ result [ 'Buckets' ] ) === 0 ) { $ this -> outputLine ( 'The account currently does not have any buckets.' ) ; } $ tableRows = [ ] ; $ headerRow = [ 'Bucket Name' , 'Creation Date' ] ; foreach ( $ result [ 'Buckets' ] as $ bucket ) { $ tableRows [ ] = [ $ bucket [ 'Name' ] , $ bucket [ 'CreationDate' ] ] ; } $ this -> output -> outputTable ( $ tableRows , $ headerRow ) ; }
Displays a list of buckets
 This command outputs a list of all buckets from the currently configured S3
 account.
Displays a list of buckets This command outputs a list of all buckets from the currently configured S3 account .