Skip to content

Commit

Permalink
INT-17886: Fix code checker 3.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
OscarNadjar authored and TheBryanOpen228 committed Apr 28, 2022
1 parent 727d805 commit d7a22cd
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 21 deletions.
4 changes: 1 addition & 3 deletions classes/aws_apcu_cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@

use Aws\CacheInterface;

defined('MOODLE_INTERNAL') || die();

/**
* An APCu cache for AWS.
*
Expand Down Expand Up @@ -92,4 +90,4 @@ public function set($key, $value, $ttl = 0) {
public function remove($key) {
apcu_delete($key);
}
}
}
4 changes: 1 addition & 3 deletions classes/aws_sdk.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@

namespace local_aws_sdk;

defined('MOODLE_INTERNAL') || die();

/**
* Utility to help use the AWS SDK.
*
Expand Down Expand Up @@ -116,4 +114,4 @@ private static function resolve_credentials($name, array $cfg) {

return [];
}
}
}
4 changes: 1 addition & 3 deletions classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@

namespace local_aws_sdk\privacy;

defined('MOODLE_INTERNAL') || die();

/**
* Privacy Subsystem for local_aws_sdk implementing null_provider.
*
Expand All @@ -43,4 +41,4 @@ class provider implements \core_privacy\local\metadata\null_provider {
public static function get_reason() : string {
return 'privacy:metadata';
}
}
}
6 changes: 2 additions & 4 deletions tests/aws_apcu_cache_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,19 @@
* @copyright Copyright (c) 2017 Open LMS (https://www.openlms.net)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace local_aws_sdk;
use Aws\Credentials\Credentials;
use local_aws_sdk\aws_apcu_cache;
use local_aws_sdk\aws_sdk;

defined('MOODLE_INTERNAL') || die();

/**
* Tests for APCu cache.
*
* @package local_aws_sdk
* @copyright Copyright (c) 2017 Open LMS (https://www.openlms.net)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class local_aws_sdk_aws_apcu_cache_testcase extends advanced_testcase {
class aws_apcu_cache_test extends \advanced_testcase {

const TEST_KEY = 'phpunit_local_aws_sdk_test';

Expand Down
12 changes: 5 additions & 7 deletions tests/aws_sdk_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,18 @@
* @copyright Copyright (c) 2017 Open LMS (https://www.openlms.net)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace local_aws_sdk;
use local_aws_sdk\aws_apcu_cache;
use local_aws_sdk\aws_sdk;

defined('MOODLE_INTERNAL') || die();

/**
* Tests SDK class.
*
* @package local_aws_sdk
* @copyright Copyright (c) 2017 Open LMS (https://www.openlms.net)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class local_aws_sdk_aws_sdk_testcase extends advanced_testcase {
class aws_sdk_test extends \advanced_testcase {
/**
* Test various use cases for creating config.
*
Expand All @@ -56,7 +54,7 @@ public function test_config_from_cfg($cfg, $expected) {
* Test error handling for missing CFG value.
*/
public function test_config_from_cfg_missing_cfg() {
$this->expectException(coding_exception::class);
$this->expectException(\coding_exception::class);
aws_sdk::config_from_cfg('asdf_asdf_hodor');
}

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

$CFG->phpunit_local_aws_sdk_test = 'hodor';

$this->expectException(coding_exception::class);
$this->expectException(\coding_exception::class);
aws_sdk::config_from_cfg('phpunit_local_aws_sdk_test');
}

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

$this->expectException(coding_exception::class);
$this->expectException(\coding_exception::class);
aws_sdk::config_from_cfg('phpunit_local_aws_sdk_test');
}

Expand Down
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@
$plugin->requires = 2015051100;
$plugin->component = 'local_aws_sdk';
$plugin->maturity = MATURITY_STABLE;
$plugin->release = '3.1.3 (Build: 20161114)';
$plugin->release = '3.1.3 (Build: 20161114)';

0 comments on commit d7a22cd

Please sign in to comment.