Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Added
- Add PHP 8 type declarations.
### Removed
- Remove deprecated config options for `user` and `pass`.
- **BC break**: Removed support for PHP versions <= v8.0 as they are no longer
[actively supported](https://php.net/supported-versions.php) by the PHP project.

Expand Down
10 changes: 0 additions & 10 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,21 +85,11 @@ class Client implements LoggerAwareInterface
* username: string, // Required
* password: string, // Required
* uri: string, // Optional. Default https://mxm.xtremepush.com/
* user: string, // @deprecated See username
* pass: string, // @deprecated See password
* debugLogging: bool, // Optional. Enable logging of request/response. Default false
* } $config
*/
public function __construct(array $config)
{
// Support deprecated key names from v3
if (!isset($config['username']) && isset($config['user'])) {
$config['username'] = $config['user'];
}
if (!isset($config['password']) && isset($config['pass'])) {
$config['password'] = $config['pass'];
}

// Must have user/pass
if (!isset($config['username']) || !isset($config['password'])) {
throw new Exception\InvalidArgumentException('API config requires username & password');
Expand Down
13 changes: 0 additions & 13 deletions tests/ApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,6 @@ public function testConfigValid(): void
static::assertSame($this->testConfig, $api->getConfig());
}

public function testConfigSupportDeprecatedUserPass(): void
{
$config = [
'user' => 'api@user.com',
'pass' => 'apipass',
];

$api = new Client($config);

static::assertSame($config['user'], $api->getConfig()['username']);
static::assertSame($config['pass'], $api->getConfig()['password']);
}

public function testConfigDefaultHost(): void
{
$config = [
Expand Down