UserAgentParser\Model\OperatingSystem::toArray PHP Method

toArray() public method

public toArray ( ) : array
return array
    public function toArray()
    {
        return ['name' => $this->getName(), 'version' => $this->getVersion()->toArray()];
    }

Usage Example

 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());
 }