- Updated class \ncc\Objects\Vault\Password > AccessToken to use method calls rather than direct property access

This commit is contained in:
Netkas 2023-08-28 18:34:19 -04:00
parent 424b503f42
commit eeffb15eb7
No known key found for this signature in database
GPG key ID: 5DAF58535614062B
3 changed files with 21 additions and 14 deletions

View file

@ -176,6 +176,7 @@ features and reduced the number of exceptions down to 15 exceptions.
- Updated class `\ncc\Objects\PackageLock > VersionEntry` to use method calls rather than direct property access - Updated class `\ncc\Objects\PackageLock > VersionEntry` to use method calls rather than direct property access
and implemented `BytecodeObjectInterface` and implemented `BytecodeObjectInterface`
- Updated class `\ncc\Objects\SymlinkDictionary > SymlinkEntry` to use method calls rather than direct property access - Updated class `\ncc\Objects\SymlinkDictionary > SymlinkEntry` to use method calls rather than direct property access
- Updated class `\ncc\Objects\Vault\Password > AccessToken` to use method calls rather than direct property access
### Removed ### Removed
- Removed `FileNotFoundException` and `DirectoryNotFoundException` from `\ncc\Exceptions` - Removed `FileNotFoundException` and `DirectoryNotFoundException` from `\ncc\Exceptions`

View file

@ -140,7 +140,7 @@
return false; return false;
} }
return $token === $this->password->access_token; return $token === $this->password->getAccessToken();
default: default:
return false; return false;

View file

@ -35,7 +35,7 @@
* *
* @var string * @var string
*/ */
public $access_token; private $access_token;
/** /**
* @inheritDoc * @inheritDoc
@ -45,16 +45,6 @@
return AuthenticationType::ACCESS_TOKEN; return AuthenticationType::ACCESS_TOKEN;
} }
/**
* Returns a string representation of the object
*
* @return string
*/
public function __toString(): string
{
return $this->access_token;
}
/** /**
* @param string $AccessToken * @param string $AccessToken
*/ */
@ -63,6 +53,14 @@
$this->access_token = $AccessToken; $this->access_token = $AccessToken;
} }
/**
* @return string
*/
public function getAccessToken(): string
{
return $this->access_token;
}
/** /**
* Returns an array representation of the object * Returns an array representation of the object
* *
@ -86,9 +84,17 @@
public static function fromArray(array $data): AccessToken public static function fromArray(array $data): AccessToken
{ {
$object = new self(); $object = new self();
$object->access_token = Functions::array_bc($data, 'access_token'); $object->access_token = Functions::array_bc($data, 'access_token');
return $object; return $object;
} }
/**
* Returns a string representation of the object
*
* @return string
*/
public function __toString(): string
{
return $this->access_token;
}
} }