Protobuf\Configuration::getPlatformFactory PHP Method

getPlatformFactory() public method

Return a PlatformFactory.
public getPlatformFactory ( ) : PlatformFactory
return Protobuf\Binary\Platform\PlatformFactory
    public function getPlatformFactory()
    {
        if ($this->platformFactory !== null) {
            return $this->platformFactory;
        }
        return $this->platformFactory = new PlatformFactory();
    }

Usage Example

 public function testGetAndSetPlatformFactory()
 {
     $mock = $this->getMock('Protobuf\\Binary\\Platform\\PlatformFactory');
     $factory = $this->configuration->getPlatformFactory();
     $this->assertInstanceOf('Protobuf\\Binary\\Platform\\PlatformFactory', $factory);
     $this->configuration->setPlatformFactory($mock);
     $this->assertSame($mock, $this->configuration->getPlatformFactory());
 }
All Usage Examples Of Protobuf\Configuration::getPlatformFactory