diff --git a/CHANGELOG.md b/CHANGELOG.md index 3586c62..109cb81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 and implemented `BytecodeObjectInterface` - 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 `FileNotFoundException` and `DirectoryNotFoundException` from `\ncc\Exceptions` diff --git a/src/ncc/Objects/Vault/Entry.php b/src/ncc/Objects/Vault/Entry.php index c0443d7..80391d7 100644 --- a/src/ncc/Objects/Vault/Entry.php +++ b/src/ncc/Objects/Vault/Entry.php @@ -140,7 +140,7 @@ return false; } - return $token === $this->password->access_token; + return $token === $this->password->getAccessToken(); default: return false; diff --git a/src/ncc/Objects/Vault/Password/AccessToken.php b/src/ncc/Objects/Vault/Password/AccessToken.php index 2d73761..04251dd 100644 --- a/src/ncc/Objects/Vault/Password/AccessToken.php +++ b/src/ncc/Objects/Vault/Password/AccessToken.php @@ -35,7 +35,7 @@ * * @var string */ - public $access_token; + private $access_token; /** * @inheritDoc @@ -45,16 +45,6 @@ return AuthenticationType::ACCESS_TOKEN; } - /** - * Returns a string representation of the object - * - * @return string - */ - public function __toString(): string - { - return $this->access_token; - } - /** * @param string $AccessToken */ @@ -63,6 +53,14 @@ $this->access_token = $AccessToken; } + /** + * @return string + */ + public function getAccessToken(): string + { + return $this->access_token; + } + /** * Returns an array representation of the object * @@ -86,9 +84,17 @@ public static function fromArray(array $data): AccessToken { $object = new self(); - $object->access_token = Functions::array_bc($data, 'access_token'); - return $object; } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function __toString(): string + { + return $this->access_token; + } } \ No newline at end of file