Skip to content

Commit d5651bf

Browse files
committed
Use top-level imports
1 parent bf060be commit d5651bf

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

src/S3/Deployer.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Aws\Exception\AwsException;
1111
use Aws\S3\S3Client;
1212
use WP2Static\CrawledFiles;
13+
use WP2Static\DeployCache;
1314
use WP2Static\Options;
1415
use WP2Static\WsLog;
1516

@@ -159,7 +160,7 @@ public function uploadFilesIter( \Iterator $files ): void {
159160

160161
if ( ! $real_filepath ) {
161162
$err = 'Trying to deploy unknown file to S3: ' . $filename;
162-
\WP2Static\WsLog::l( $err );
163+
WsLog::l( $err );
163164
continue;
164165
}
165166

@@ -228,7 +229,7 @@ public function uploadFilesIter( \Iterator $files ): void {
228229
}
229230
}
230231

231-
$is_cached = \WP2Static\DeployCache::fileisCached(
232+
$is_cached = DeployCache::fileisCached(
232233
$cache_key,
233234
$this->namespace,
234235
$hash,
@@ -266,7 +267,7 @@ public function uploadFilesIter( \Iterator $files ): void {
266267
'fulfilled' =>
267268
function ( $result, $iter_key, $promise ) use ( &$items_by_iter_key ) {
268269
$item = $items_by_iter_key[ $iter_key ];
269-
\WP2Static\DeployCache::addFile(
270+
DeployCache::addFile(
270271
$item['cache_key'],
271272
$this->namespace,
272273
$item['hash']
@@ -331,7 +332,7 @@ public static function s3Client(): \Aws\S3\S3Client {
331332
) {
332333
$client_options['credentials'] = [
333334
'key' => S3Options::getValue( 'awsAccessKeyId' ),
334-
'secret' => \WP2Static\Options::encrypt_decrypt(
335+
'secret' => Options::encrypt_decrypt(
335336
'decrypt',
336337
S3Options::getValue( 'awsSecretAccessKey' )
337338
),
@@ -358,7 +359,7 @@ public static function cloudfrontClient(): \Aws\CloudFront\CloudFrontClient {
358359
// Use the supplied access keys.
359360
$credentials = new \Aws\Credentials\Credentials(
360361
S3Options::getValue( 'awsAccessKeyId' ),
361-
\WP2Static\Options::encrypt_decrypt(
362+
Options::encrypt_decrypt(
362363
'decrypt',
363364
S3Options::getValue( 'awsSecretAccessKey' )
364365
)

src/S3/S3Controller.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
use WP2Static\Controller;
66
use WP2Static\Options;
7+
use WP2Static\SiteInfo;
8+
use WP2Static\WsLog;
79

810
class S3Controller {
911
public function run(): void {
@@ -65,7 +67,7 @@ public static function renderS3Page(): void {
6567

6668
$view = [];
6769
$view['nonce_action'] = Controller::getHookName( 's3_save_options' );
68-
$view['uploads_path'] = \WP2Static\SiteInfo::getPath( 'uploads' );
70+
$view['uploads_path'] = SiteInfo::getPath( 'uploads' );
6971

7072
$view['options'] = Options::getAll( S3Options::optionSpecs() );
7173

@@ -78,7 +80,7 @@ public function deploy( string $processed_site_path, string $enabled_deployer ):
7880
return;
7981
}
8082

81-
\WP2Static\WsLog::l( 'S3 Addon deploying' );
83+
WsLog::l( 'S3 Addon deploying' );
8284

8385
$s3_deployer = new Deployer();
8486
$s3_deployer->uploadFiles( $processed_site_path );

0 commit comments

Comments
 (0)