PhpMigration\App::commandExportPosbit PHP Method

commandExportPosbit() protected method

protected commandExportPosbit ( )
    protected function commandExportPosbit()
    {
        $docfile = current($this->args['<file>']);
        if (!file_exists($docfile)) {
            Logging::error('Unable load docfile {name}', ['name' => $docfile]);
            exit(1);
        }
        $html = file_get_contents($docfile);
        $exporter = new FunctionListExporter();
        $methodlist = $exporter->parseAll($html);
        foreach ($methodlist as $method) {
            // Skip class method
            if ($method['modifier'] || strpos($method['name'], '::') !== false) {
                continue;
            }
            // Find by-reference param
            $posbit = 0;
            foreach ($method['params'] as $key => $param) {
                if ($param['reference']) {
                    $posbit |= 1 << $key;
                }
            }
            if (!$posbit) {
                continue;
            }
            printf("%-40s => %4u, // %s\n", "'" . $method['name'] . "'", $posbit, strrev(decbin($posbit)));
        }
    }