Procudes the docblock for the class.
505865
protected function getClassDocBlockLines() {
    $docblock_lines = parent::getClassDocBlockLines();

    // Do not include the annotation if this plugin is a class override.
    if (!empty($this->component_data['replace_parent_plugin'])) {
      return $docblock_lines;
    }

    $docblock_lines[] = '';

    $docblock_lines = array_merge($docblock_lines, $this->classAnnotation());

    return $docblock_lines;
  }
182685
def bound_method(block)
      type = self.type
      arity = block.arity
      arity += 1 if arity >= 0 # Make sure the object gets passed
      arity += 1 if arity == 1 && type == :around # Make sure the block gets passed

      method = lambda { |object, *args| object.instance_exec(*args, &block) }


      # Proxy arity to the original block
      (
      class << method;
        self;
      end).class_eval do
        define_method(:arity) { arity }
      end

      method
    end
689688
protected function assembleDocBlock($docBlock, $target)
    {
        if (!$docBlock) {
            return;
        }

        $target->setSummary($docBlock->getSummary());
        $target->setDescription($docBlock->getDescription());

        /** @var DocBlock\Tag $tag */
        foreach ($docBlock->getTags() as $tag) {
            $tagDescriptor = $this->builder->buildDescriptor($tag);

            // allow filtering of tags
            if (!$tagDescriptor) {
                continue;
            }

            $target->getTags()
                ->get($tag->getName(), new Collection())
                ->add($tagDescriptor);
        }
    }
323294
protected function processShortcuts(array $property, ClassDefinition $classDefinition)
    {
        foreach ($property['shortcuts'] as $shortcut) {
            if ('_' == substr($property['name'], 0, 1)) {
                $name = substr($property['name'], 1);
            } else {
                $name = $property['name'];
            }

            $docBlock = null;
            if (isset($shortcut['docblock'])) {
                $docBlock = $shortcut['docblock'];
            } elseif (isset($property['docblock'])) {
                $docBlock = $property['docblock'];
            }

            $returnsType = [];

            if ($docBlock) {
                $docBlockParser = new DocblockParser('/'.$docBlock.'/');
                $docBlockParsed = $docBlockParser->parse();

                if ($annotations = $docBlockParsed->getAnnotationsByType('var')) {
                    $returnsType = array_map(function ($type) {
                        return 'mixed' == ($type = trim($type)) ? 'variable' : $type;
                    }, (array) explode('|', $annotations[0]->getString()));
                }

                // Clear annotations
                $docBlockParsed->setAnnotations([]);
                $docBlock = $docBlockParsed->generate();
            }

            switch ($shortcut['name']) {
                case 'get':
                    $classDefinition->addMethod(new ClassMethod(
                        $classDefinition,
                        ['public'],
                        'get'.camelize($name),
                        null,
                        new StatementsBlock([
                            [
                                'type' => 'return',
                                'expr' => [
                                    'type' => 'property-access',
                                    'left' => [
                                        'type' => 'variable',
                                        'value' => 'this',
                                    ],
                                    'right' => [
                                        'type' => 'variable',
                                        'value' => $property['name'],
                                    ],
                                ],
                            ],
                        ]),
                        $docBlock,
                        $this->createReturnsType($returnsType, true),
                        $shortcut
                    ), $shortcut);
                    break;

                case 'set':
                    $classDefinition->addMethod(new ClassMethod(
                        $classDefinition,
                        ['public'],
                        'set'.camelize($name),
                        new ClassMethodParameters([
                            [
                                'type' => 'parameter',
                                'name' => $name,
                                'const' => 0,
                                'data-type' => 1 == \count($returnsType) ? $returnsType[0] : 'variable',
                                'mandatory' => 0,
                            ],
                        ]),
                        new StatementsBlock([
                            [
                                'type' => 'let',
                                'assignments' => [
                                    [
                                        'assign-type' => 'object-property',
                                        'operator' => 'assign',
                                        'variable' => 'this',
                                        'property' => $property['name'],
                                        'expr' => [
                                            'type' => 'variable',
                                            'value' => $name,
                                            'file' => $property['file'],
                                            'line' => $property['line'],
                                            'char' => $property['char'],
                                        ],
                                        'file' => $property['file'],
                                        'line' => $property['line'],
                                        'char' => $property['char'],
                                    ],
                                ],
                            ],
                            [
                                'type' => 'return',
                                'expr' => [
                                    'type' => 'variable',
                                    'value' => 'this',
                                    'file' => $property['file'],
                                    'line' => $property['line'],
                                    'char' => $property['char'],
                                ],
                            ],
                        ]),
                        $docBlock,
                        null,
                        $shortcut
                    ), $shortcut);
                    break;

                case 'toString':
                case '__toString':
                    $classDefinition->addMethod(new ClassMethod(
                        $classDefinition,
                        ['public'],
                        '__toString',
                        null,
                        new StatementsBlock([
                            [
                                'type' => 'return',
                                'expr' => [
                                    'type' => 'property-access',
                                    'left' => [
                                        'type' => 'variable',
                                        'value' => 'this',
                                    ],
                                    'right' => [
                                        'type' => 'variable',
                                        'value' => $property['name'],
                                    ],
                                ],
                            ],
                        ]),
                        $docBlock,
                        $this->createReturnsType(['string']),
                        $shortcut
                    ), $shortcut);
                    break;

                default:
                    throw new CompilerException("Unknown shortcut '".$shortcut['name']."'", $shortcut);
            }
        }
    }
221823
private function extractDocBlockPartsSource(): void
  {
    // Get the DocBlock for the source.
    $tmp = PHP_EOL;
    foreach ($this->routineSourceCodeLines as $line)
    {
      $n = preg_match('/create\\s+(procedure|function)\\s+([a-zA-Z0-9_]+)/i', $line);
      if ($n) break;

      $tmp .= $line;
      $tmp .= PHP_EOL;
    }

    $phpdoc = new DocBlockReflection($tmp);

    // Get the short description.
    $this->docBlockPartsSource['sort_description'] = $phpdoc->getShortDescription();

    // Get the long description.
    $this->docBlockPartsSource['long_description'] = $phpdoc->getLongDescription();

    // Get the description for each parameter of the stored routine.
    foreach ($phpdoc->getTags() as $key => $tag)
    {
      if ($tag->getName()=='param')
      {
        /* @var $tag ParamTag */
        $this->docBlockPartsSource['parameters'][$key] = ['name'        => $tag->getTypes()[0],
                                                          'description' => $tag->getDescription()];
      }
    }
  }
769259
private void block() {
        final long steps = this.limits.simpSteps;
        assert this.level == 0;
        assert !this.config.plain;
        if (!this.config.block) { return; }
        if (this.config.blkwait >= this.stats.simplifications) { return; }
        assert this.simplifier == Simplifier.TOPSIMP;
        this.simplifier = Simplifier.BLOCK;
        updateCands();
        final long limit;
        if (this.stats.simplifications <= this.config.blkrtc) { limit = Long.MAX_VALUE; } else { limit = this.stats.steps + 10 * steps / sizePenalty(); }
        while (this.empty == null && !this.candsBlock.empty() && this.stats.steps++ < limit) {
            final int cand = this.candsBlock.top();
            final long priority = this.candsBlock.priority(cand);
            this.candsBlock.pop(cand);
            if (priority == 0 || !var(cand).free()) { continue; }
            blockLit(cand);
            blockLit(-cand);
        }
        assert this.schedule;
        this.schedule = false;
        assert this.simplifier == Simplifier.BLOCK;
        this.simplifier = Simplifier.TOPSIMP;
    }
96135
protected function extractPackageFromDocBlock($docBlock)
    {
        $packageTags = $docBlock ? $docBlock->getTagsByName('package') : null;
        if (! $packageTags) {
            return null;
        }

        /** @var DocBlock\Tag $tag */
        $tag = reset($packageTags);

        return trim($tag->getContent());
    }
482607
protected function getMethodDescription($docBlock): string
    {
        if ($docBlock->hasTag(self::API_METHOD_DESCRIPTION)) {
            $tags = $docBlock->getTagsByName(self::API_METHOD_DESCRIPTION);

            return (string)$tags[0];
        }

        return $docBlock->getSummary();
    }
272640
private function getDocBlockFromProperty($class, $property)
    {
        // Use a ReflectionProperty instead of $class to get the parent class if applicable
        try {
            $reflectionProperty = new \ReflectionProperty($class, $property);
        } catch (\ReflectionException $e) {
            return;
        }

        return $this->docBlockFactory->create($reflectionProperty, $this->contextFactory->createFromReflector($reflectionProperty->getDeclaringClass()));
    }
137754
function (out) {
            // var tplParam = out.templateParam;
            out.enterBlock("classInit");
            this._writeMapInheritance(out, "__$macrolibs", out.templateParam.$macrolibs, "{}");
            out.leaveBlock();
            this.$ClassGenerator._writeClassInit.call(this, out);
        }
381417
protected function checkExistingDocBlock(File $phpCsFile, int $docBlockEndPosition): void
    {
        if ($this->hasCorrectContent($phpCsFile, $docBlockEndPosition)) {
            return;
        }

        $fix = $phpCsFile->addFixableError('Constants interface doc block outdated.', $docBlockEndPosition, 'DocBlockOutdated');
        if (!$fix) {
            return;
        }

        $tokens = $phpCsFile->getTokens();
        $docBlockStartPosition = $tokens[$docBlockEndPosition]['comment_opener'];

        $phpCsFile->fixer->beginChangeset();
        for ($i = $docBlockStartPosition; $i <= $docBlockEndPosition; $i++) {
            $phpCsFile->fixer->replaceToken($i, '');
        }

        $docBlockStartPosition--;
        $this->insertDocBlock($phpCsFile, $docBlockStartPosition);
        $phpCsFile->fixer->endChangeset();
    }
328972
boolean documentBlock(String description) {
    if (!lazyInitDocumentation()) {
      return true;
    }

    if (documentation.blockDescription != null) {
      return false;
    }

    documentation.blockDescription = description;
    return true;
  }
877379
protected function getDocBlockReplace()
    {
        // For now, docblocks will only contain the ide-helper content

        if ( ! $this->isDocBlockRequired()) return '';

        $rows = $this->collectDocBlockPropertyRows();


        if ( ! count($rows)) return '';

        $replace = "/**\n"
                 . $this->getDocBlockIntro();

        foreach ($rows as $row) {

            $replace .= ' * '
                      . "@{$row['tag']} "
                      . "{$row['type']} "
                      . "{$row['name']}\n";
        }

        $replace .= " */\n";

        return $replace;
    }
792408
private Class<? extends Object> getClassForClassDoc(final ClassDoc doc) {
        try {
            return DocletUtils.getClassForDoc(doc);
        } catch (ClassNotFoundException e) {
            // we got a classdoc for a class we can't find.  Maybe in a library or something
            return null;
        } catch (NoClassDefFoundError e) {
            return null;
        } catch (UnsatisfiedLinkError e) {
            return null; // naughty BWA bindings
        }
    }
1243109
public function preUpdate(ClassMetadata $class, object $document) : void
    {
        if (! empty($class->lifecycleCallbacks[Events::preUpdate])) {
            $class->invokeLifecycleCallbacks(Events::preUpdate, $document, [new PreUpdateEventArgs($document, $this->dm, $this->uow->getDocumentChangeSet($document))]);
            $this->uow->recomputeSingleDocumentChangeSet($class, $document);
        }
        $this->evm->dispatchEvent(Events::preUpdate, new PreUpdateEventArgs($document, $this->dm, $this->uow->getDocumentChangeSet($document)));
        $this->cascadePreUpdate($class, $document);
    }
877803
function init() {
        $this->blockname = get_class($this);
        $this->title = get_string('pluginname', $this->blockname);
    }
1141681
public function when(/* see docblock */)
    {
        $arguments = func_get_args();
        if ($arguments[0] instanceof Antecedent) {
            $antecedent = $arguments[0];
        } elseif ($arguments[0] instanceof PHPUnit_Framework_Constraint) {
            $antecedent = Antecedent\IndependentConstraintsAntecedent::fromAll($arguments);
        } elseif ($arguments[0] instanceof Constraint) {
            $antecedent = Antecedent\IndependentConstraintsAntecedent::fromAll($arguments);
        } elseif ($arguments && count($arguments) == 1) {
            $antecedent = Antecedent\SingleCallbackAntecedent::from($arguments[0]);
        } else {
            throw new \InvalidArgumentException("Invalid call to when(): " . var_export($arguments, true));
        }
        $this->antecedents[] = $antecedent;
        return $this;
    }