Skip to content

Commit 883d13b

Browse files
committed
INT-17886: Fix code checker 3.1.0
1 parent 727d805 commit 883d13b

File tree

6 files changed

+11
-21
lines changed

6 files changed

+11
-21
lines changed

classes/aws_apcu_cache.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626

2727
use Aws\CacheInterface;
2828

29-
defined('MOODLE_INTERNAL') || die();
30-
3129
/**
3230
* An APCu cache for AWS.
3331
*
@@ -92,4 +90,4 @@ public function set($key, $value, $ttl = 0) {
9290
public function remove($key) {
9391
apcu_delete($key);
9492
}
95-
}
93+
}

classes/aws_sdk.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424

2525
namespace local_aws_sdk;
2626

27-
defined('MOODLE_INTERNAL') || die();
28-
2927
/**
3028
* Utility to help use the AWS SDK.
3129
*
@@ -116,4 +114,4 @@ private static function resolve_credentials($name, array $cfg) {
116114

117115
return [];
118116
}
119-
}
117+
}

classes/privacy/provider.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424

2525
namespace local_aws_sdk\privacy;
2626

27-
defined('MOODLE_INTERNAL') || die();
28-
2927
/**
3028
* Privacy Subsystem for local_aws_sdk implementing null_provider.
3129
*
@@ -43,4 +41,4 @@ class provider implements \core_privacy\local\metadata\null_provider {
4341
public static function get_reason() : string {
4442
return 'privacy:metadata';
4543
}
46-
}
44+
}

tests/aws_apcu_cache_test.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,19 @@
2121
* @copyright Copyright (c) 2017 Open LMS (https://www.openlms.net)
2222
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
2323
*/
24-
24+
namespace local_aws_sdk;
2525
use Aws\Credentials\Credentials;
2626
use local_aws_sdk\aws_apcu_cache;
2727
use local_aws_sdk\aws_sdk;
2828

29-
defined('MOODLE_INTERNAL') || die();
30-
3129
/**
3230
* Tests for APCu cache.
3331
*
3432
* @package local_aws_sdk
3533
* @copyright Copyright (c) 2017 Open LMS (https://www.openlms.net)
3634
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
3735
*/
38-
class local_aws_sdk_aws_apcu_cache_testcase extends advanced_testcase {
36+
class aws_apcu_cache_test extends \advanced_testcase {
3937

4038
const TEST_KEY = 'phpunit_local_aws_sdk_test';
4139

tests/aws_sdk_test.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,18 @@
2121
* @copyright Copyright (c) 2017 Open LMS (https://www.openlms.net)
2222
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
2323
*/
24-
24+
namespace local_aws_sdk;
2525
use local_aws_sdk\aws_apcu_cache;
2626
use local_aws_sdk\aws_sdk;
2727

28-
defined('MOODLE_INTERNAL') || die();
29-
3028
/**
3129
* Tests SDK class.
3230
*
3331
* @package local_aws_sdk
3432
* @copyright Copyright (c) 2017 Open LMS (https://www.openlms.net)
3533
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
3634
*/
37-
class local_aws_sdk_aws_sdk_testcase extends advanced_testcase {
35+
class aws_sdk_test extends \advanced_testcase {
3836
/**
3937
* Test various use cases for creating config.
4038
*
@@ -56,7 +54,7 @@ public function test_config_from_cfg($cfg, $expected) {
5654
* Test error handling for missing CFG value.
5755
*/
5856
public function test_config_from_cfg_missing_cfg() {
59-
$this->expectException(coding_exception::class);
57+
$this->expectException(\coding_exception::class);
6058
aws_sdk::config_from_cfg('asdf_asdf_hodor');
6159
}
6260

@@ -70,7 +68,7 @@ public function test_config_from_cfg_not_array() {
7068

7169
$CFG->phpunit_local_aws_sdk_test = 'hodor';
7270

73-
$this->expectException(coding_exception::class);
71+
$this->expectException(\coding_exception::class);
7472
aws_sdk::config_from_cfg('phpunit_local_aws_sdk_test');
7573
}
7674

@@ -87,7 +85,7 @@ public function test_config_from_cfg_unknown_cache() {
8785
'credentials_cache' => 'hodor',
8886
];
8987

90-
$this->expectException(coding_exception::class);
88+
$this->expectException(\coding_exception::class);
9189
aws_sdk::config_from_cfg('phpunit_local_aws_sdk_test');
9290
}
9391

version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@
2929
$plugin->requires = 2015051100;
3030
$plugin->component = 'local_aws_sdk';
3131
$plugin->maturity = MATURITY_STABLE;
32-
$plugin->release = '3.1.3 (Build: 20161114)';
32+
$plugin->release = '3.1.3 (Build: 20161114)';

0 commit comments

Comments
 (0)