diff options
author | Björn Roland <bjoern.roland@intradesys.com> | 2015-11-18 00:01:35 +0100 |
---|---|---|
committer | Björn Roland <bjoern.roland@intradesys.com> | 2015-11-18 00:01:35 +0100 |
commit | 1c880fae48099471dc6a2155c205b8d539e3a31b (patch) | |
tree | fed41010343287cb4b0271768f8c651fe1685ee1 /src/Objects/Key.php | |
parent | 325a9e3e422215e9df3c7887a894a22f6594a368 (diff) | |
download | php-ssllabs-api-1c880fae48099471dc6a2155c205b8d539e3a31b.zip php-ssllabs-api-1c880fae48099471dc6a2155c205b8d539e3a31b.tar.gz php-ssllabs-api-1c880fae48099471dc6a2155c205b8d539e3a31b.tar.bz2 |
Composer support ; started response object to PHP object mapping, Exceptions, Calls
Diffstat (limited to 'src/Objects/Key.php')
-rw-r--r-- | src/Objects/Key.php | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/src/Objects/Key.php b/src/Objects/Key.php new file mode 100644 index 0000000..c57a613 --- /dev/null +++ b/src/Objects/Key.php @@ -0,0 +1,80 @@ +<?php +namespace BjoernrDe\SSLLabsApi\Objects; + +class Key implements ApiObject +{ + private $size; + private $strength; + private $alg; + private $debianFlaw; + private $q; + + public function getSize() + { + return ($this->size); + } + + private function setSize($size) + { + $this->size = $size; + } + + public function getStrength() + { + return ($this->strength); + } + + private function setStrength($strength) + { + $this->strength = $strength; + } + + public function getAlg() + { + return ($this->alg); + } + + private function setAlg($alg) + { + $this->alg = $alg; + } + + public function getDebianFlaw() + { + return ($this->debianFlaw); + } + + private function setDebianFlaw($debianFlaw) + { + $this->debianFlaw = $debianFlaw; + } + + public function getQ() + { + return ($this->q); + } + + private function setQ($q) + { + $this->q = $q; + } + + /** + * {@inheritDoc} + * + * @return \BjoernrDe\SSLLabsApi\Objects\Key + * @see \BjoernrDe\SSLLabsApi\Objects\ApiObject::populateObjectByApiResponse() + */ + public function populateObjectByApiResponse($jsonString) + { + $response = json_decode($jsonString); + + isset($response->size) ? $this->setSize($response->size) : ''; + isset($response->alg) ? $this->setAlg($response->alg) : ''; + isset($response->debianFlaw) ? $this->setDebianFlaw($response->debianFlaw) : ''; + isset($response->strength) ? $this->setStrength($response->strength) : ''; + isset($response->q) ? $this->setQ($response->q) : ''; + + return ($this); + } +}
\ No newline at end of file |