getVersion() public method

public getVersion ( ) : Version
return Version
 public function testToArray()
 {
     $os = new OperatingSystem();
     $this->assertEquals(['name' => null, 'version' => $os->getVersion()->toArray()], $os->toArray());
     $os->setName('Linux');
     $this->assertEquals(['name' => 'Linux', 'version' => $os->getVersion()->toArray()], $os->toArray());
 }
 /**
  *
  * @param Model\OperatingSystem $os
  * @param stdClass              $resultRaw
  */
 private function hydrateOperatingSystem(Model\OperatingSystem $os, stdClass $resultRaw)
 {
     if (isset($resultRaw->platform)) {
         $os->setName($this->getRealResult($resultRaw->platform));
     }
     if (isset($resultRaw->platform_version)) {
         $os->getVersion()->setComplete($this->getRealResult($resultRaw->platform_version));
     }
 }
 /**
  *
  * @param Model\OperatingSystem $os
  * @param stdClass              $resultRaw
  */
 private function hydrateOperatingSystem(Model\OperatingSystem $os, stdClass $resultRaw)
 {
     if (isset($resultRaw->operating_system_name)) {
         $os->setName($this->getRealResult($resultRaw->operating_system_name, 'operatingSystem', 'name'));
     }
     if (isset($resultRaw->operating_system_version_full)) {
         $os->getVersion()->setComplete($this->getRealResult($resultRaw->operating_system_version_full));
     }
 }
 /**
  *
  * @param Model\OperatingSystem $os
  * @param array                 $resultRaw
  */
 private function hydrateOperatingSystem(Model\OperatingSystem $os, array $resultRaw)
 {
     if (isset($resultRaw['general_platform'])) {
         $os->setName($this->getRealResult($resultRaw['general_platform']));
     }
     if (isset($resultRaw['general_platform_version'])) {
         $os->getVersion()->setComplete($this->getRealResult($resultRaw['general_platform_version']));
     }
 }
 /**
  *
  * @param Model\OperatingSystem $os
  * @param array                 $resultRaw
  */
 private function hydrateOperatingSystem(Model\OperatingSystem $os, array $resultRaw)
 {
     if ($this->isRealResult($resultRaw['osName']) === true) {
         $os->setName($resultRaw['osName']);
         $os->getVersion()->setComplete($this->getRealResult($resultRaw['osVersion']));
     }
 }
 /**
  *
  * @param Model\OperatingSystem $os
  * @param BrowserDetector\Os    $osRaw
  */
 private function hydrateOperatingSystem(Model\OperatingSystem $os, BrowserDetector\Os $osRaw)
 {
     $os->setName($this->getRealResult($osRaw->getName()));
     $os->getVersion()->setComplete($this->getRealResult($osRaw->getVersion()));
 }
Example #7
0
 /**
  *
  * @param Model\OperatingSystem            $os
  * @param \UAParser\Result\OperatingSystem $osRaw
  */
 private function hydrateOperatingSystem(Model\OperatingSystem $os, \UAParser\Result\OperatingSystem $osRaw)
 {
     $os->setName($this->getRealResult($osRaw->family));
     $os->getVersion()->setMajor($this->getRealResult($osRaw->major));
     $os->getVersion()->setMinor($this->getRealResult($osRaw->minor));
     $os->getVersion()->setPatch($this->getRealResult($osRaw->patch));
 }
 /**
  *
  * @param Model\OperatingSystem $os
  * @param EndorphinDetector\OS  $resultRaw
  */
 private function hydrateOperatingSystem(Model\OperatingSystem $os, EndorphinDetector\OS $resultRaw)
 {
     $os->setName($this->getRealResult($resultRaw->getName()));
     $os->getVersion()->setComplete($this->getRealResult($resultRaw->getVersion()));
 }
Example #9
0
 /**
  *
  * @param Model\OperatingSystem $os
  * @param array                 $osRaw
  */
 private function hydrateOperatingSystem(Model\OperatingSystem $os, array $osRaw)
 {
     if (isset($osRaw['name'])) {
         $os->setName($this->getRealResult($osRaw['name']));
     }
     if (isset($osRaw['version'])) {
         $os->getVersion()->setComplete($this->getRealResult($osRaw['version']));
     }
 }
 /**
  *
  * @param Model\OperatingSystem $os
  * @param \WhichBrowser\Os      $osRaw
  */
 private function hydrateOperatingSystem(Model\OperatingSystem $os, \WhichBrowser\Os $osRaw)
 {
     if ($this->isRealResult($osRaw->getName()) === true) {
         $os->setName($osRaw->getName());
     }
     if ($this->isRealResult($osRaw->getVersion()) === true) {
         $os->getVersion()->setComplete($osRaw->getVersion());
     }
 }
 /**
  *
  * @param Model\OperatingSystem          $os
  * @param UAResult\OperatingSystemResult $osRaw
  */
 private function hydrateOperatingSystem(Model\OperatingSystem $os, UAResult\OperatingSystemResult $osRaw)
 {
     if ($this->isRealResult($osRaw->getFamily()) === true) {
         $os->setName($osRaw->getFamily());
     }
     if ($this->isRealResult($osRaw->getMajor()) === true) {
         $os->getVersion()->setMajor($osRaw->getMajor());
         if ($this->isRealResult($osRaw->getMinor()) === true) {
             $os->getVersion()->setMinor($osRaw->getMinor());
         }
         if ($this->isRealResult($osRaw->getPatch()) === true) {
             $os->getVersion()->setPatch($osRaw->getPatch());
         }
     }
 }
 /**
  *
  * @param Model\OperatingSystem $os
  * @param array|string          $osRaw
  */
 private function hydrateOperatingSystem(Model\OperatingSystem $os, $osRaw)
 {
     if (isset($osRaw['name']) && $this->isRealResult($osRaw['name']) === true) {
         $os->setName($osRaw['name']);
     }
     if (isset($osRaw['version']) && $this->isRealResult($osRaw['version']) === true) {
         $os->getVersion()->setComplete($osRaw['version']);
     }
 }