fXmlRpc\CodeGenerator\XmlReaderParserBitmaskGenerator::generate PHP Method

generate() public method

public generate ( )
    public function generate()
    {
        $code = [];
        $bitmask = 1;
        foreach ($this->basicTypes as $type) {
            $code[] = $this->createBitmaskVariable($type, $bitmask, 'flag');
            $bitmask = $bitmask << 1;
        }
        foreach ($this->combinedTypes as $type => $combination) {
            $value = 0;
            foreach ($combination as $subType) {
                $value |= $this->values[$subType];
            }
            $code[] = $this->createBitmaskVariable($type, $value);
        }
        $commentStart = <<<'EOS'
// This following assignments are auto-generated using %s
// Don’t edit manually
EOS;
        $commentStart = sprintf($commentStart, __CLASS__);
        $commentEnd = '// End of auto-generated code';
        return $commentStart . "\n" . implode("\n", $code) . "\n" . $commentEnd;
    }