Add customer compiler pass.

@noinspection PhpDocSignatureInspection

@param CompilerPassInterface ...$compilerPasses

@return void
197911
public function addCompilerPasses(CompilerPassInterface ...$compilerPasses): void
    {
        foreach ($compilerPasses as $compilerPass)
        {
            $this->compilerPasses->attach($compilerPass);
        }
    }
397022
private function processEnvironmentReaderPass(ContainerBuilder $container)
    {
        // Register Behat context readers.
        $references = $this->processor->findAndSortTaggedServices($container, ContextExtension::READER_TAG);
        $definition = $container->getDefinition('drupal.context.environment.reader');

        foreach ($references as $reference) {
            $definition->addMethodCall('registerContextReader', array($reference));
        }
    }
545660
public function processFilesets(SassTaskCompiler $compiler): void
    {
        foreach ($this->filesets as $fs) {
            $ds = $fs->getDirectoryScanner($this->project);
            $files = $ds->getIncludedFiles();
            $dir = $fs->getDir($this->project)->getPath();

            // If output path isn't defined then set it to the path of our fileset.
            $specifiedOutputPath = (strlen($this->outputpath) > 0);
            if ($specifiedOutputPath === false) {
                $this->outputpath = $dir;
            }

            foreach ($files as $file) {
                $fullFilePath = $dir . DIRECTORY_SEPARATOR . $file;
                $this->pathInfo = pathinfo($file);

                $run = true;
                switch (strtolower($this->pathInfo['extension'])) {
                    case 'scss':
                    case 'sass':
                        break;
                    default:
                        $this->log('Ignoring ' . $file, Project::MSG_DEBUG);
                        $run = false;
                }

                if ($run
                    && ($this->extfilter === ''
                        || $this->extfilter === $this->pathInfo['extension'])
                ) {
                    $outputFile = $this->buildOutputFilePath();
                    $compiler->compile($fullFilePath, $outputFile, $this->failonerror);
                }
            }
        }
    }
1124980
public function addCompiler(CompilerInterface $compiler)
    {
        if (!in_array($compiler, $this->compilers)) {
            $blocks = &$compiler->getBlocksByName($this->name);
            $blocks[] = $this;
            $this->compilers[] = $compiler;
        }

        return $this;
    }
251936
public function compile(Compiler $compiler)
    {
        $compiler->addDebugInfo($this);

        $compiler
            ->write('try {')
        ;

        $compiler
            ->indent()
            ->subcompile($this->getNode('try'))
        ;

        if ($this->hasNode('catch') && null !== $this->getNode('catch')) {
            $compiler
                ->outdent()
                ->write('} catch (\Exception $e) {' . "\n")
                ->indent()
                ->write('if (isset($context[\'grav\'][\'debugger\'])) $context[\'grav\'][\'debugger\']->addException($e);' . "\n")
                ->write('$context[\'e\'] = $e;' . "\n")
                ->subcompile($this->getNode('catch'))
            ;
        }

        $compiler
            ->outdent()
            ->write("}\n");
    }
595015
public function setCompiler(Compiler $compiler)
    {
        $this->compiler = $compiler;
        $this->compiler->setParser($this);

        return $this;
    }
951859
public function addSignatures(\AgentSIB\Diadoc\Api\Proto\Events\DocumentSignature $value)
    {
        if ($this->Signatures === null) {
            $this->Signatures = new \Protobuf\MessageCollection();
        }

        $this->Signatures->add($value);
    }
1164268
protected function addTransUnitFilters(Builder $builder,  array $filters = null)
    {
        if (isset($filters['_search']) && $filters['_search']) {
            if (!empty($filters['domain'])) {
                $builder->addAnd($builder->expr()->field('domain')->equals(new \MongoRegex(sprintf('/%s/i', $filters['domain']))));
            }

            if (!empty($filters['key'])) {
                $builder->addAnd($builder->expr()->field('key')->equals(new \MongoRegex(sprintf('/%s/i', $filters['key']))));
            }
        }
    }
1036689
public function registerInit(Smarty_Internal_TemplateCompilerBase $compiler, $initChildSequence = false)
    {
        if ($initChildSequence || !isset($compiler->_cache['inheritanceInit'])) {
            $compiler->registerPostCompileCallback(array('Smarty_Internal_Compile_Shared_Inheritance', 'postCompile'),
                                                   array($initChildSequence), 'inheritanceInit', $initChildSequence);

            $compiler->_cache['inheritanceInit'] = true;
        }
    }
1236110
public function addCertification(\Librinfo\SeedBatchBundle\Entity\Certification $certifications)
    {
        $this->certifications[] = $certifications;

        return $this;
    }
820924
public function compile(Twig_Compiler $compiler)
    {
        $compiler->addDebugInfo($this);

        list($msg, $vars) = $this->compileString($this->getNode('body'));

        if (null !== $this->getNode('plural')) {
            list($msg1, $vars1) = $this->compileString($this->getNode('plural'));

            $vars = array_merge($vars, $vars1);
        }

        // Modified row to work with WordPress.
        $function = null === $this->getNode('plural') ? '__' : '_n';

        if (null !== $notes = $this->getNode('notes')) {
            $message = trim($notes->getAttribute('data'));

            // line breaks are not allowed cause we want a single line comment
            $message = str_replace(array("\n", "\r"), ' ', $message);
            $compiler->write("// notes: {$message}\n");
        }

        if ($vars) {
            $compiler
                ->write('echo strtr('.$function.'(')
                ->subcompile($msg)
            ;

            if (null !== $this->getNode('plural')) {
                $compiler
                    ->raw(', ')
                    ->subcompile($msg1)
                    ->raw(', abs(')
                    ->subcompile($this->getNode('count'))
                    ->raw(')')
                ;
            }

            $compiler->raw('), array(');

            foreach ($vars as $var) {
                if ('count' === $var->getAttribute('name')) {
                    $compiler
                        ->string('%count%')
                        ->raw(' => abs(')
                        ->subcompile($this->getNode('count'))
                        ->raw('), ')
                    ;
                } else {
                    $compiler
                        ->string('%'.$var->getAttribute('name').'%')
                        ->raw(' => ')
                        ->subcompile($var)
                        ->raw(', ')
                    ;
                }
            }

            $compiler->raw("));\n");
        } else {
            if (null !== $this->getNode('plural')) {
                $compiler
                    ->write('echo sprintf( '.$function.'(')
                    ->subcompile($msg)
                ;

                $compiler
                    ->raw(', ')
                    ->subcompile($msg1)
                    ->raw(', abs(')
                    ->subcompile($this->getNode('count'))
                    ->raw(')')
                ;
            } else {
                $compiler
                    ->write('echo '.$function.'(')
                    ->subcompile($msg)
                ;
            }

            $theme  = wp_get_theme();
            $domain = $theme->get('TextDomain');
            $compiler->raw(', "' . $domain . '"');

            if (null !== $this->getNode('plural')) {
                $compiler->raw(') , ')
                    ->subcompile($this->getNode('count'));
            }

            $compiler->raw(");\n");
        }
    }
46495
public function addSignatureVerifications(\AgentSIB\Diadoc\Api\Proto\Events\SignatureVerification $value)
    {
        if ($this->SignatureVerifications === null) {
            $this->SignatureVerifications = new \Protobuf\MessageCollection();
        }

        $this->SignatureVerifications->add($value);
    }
1153685
public function registerElements(ICompiler $compiler)
    {
        $compiler->registerElement('success', new Style(Colors::BLACK, Colors::GREEN));
        $compiler->registerElement('info', new Style(Colors::GREEN));
        $compiler->registerElement('error', new Style(Colors::BLACK, Colors::YELLOW));
        $compiler->registerElement('fatal', new Style(Colors::WHITE, Colors::RED));
        $compiler->registerElement('question', new Style(Colors::WHITE, Colors::BLUE));
        $compiler->registerElement('comment', new Style(Colors::YELLOW));
        $compiler->registerElement('b', new Style(null, null, [TextStyles::BOLD]));
        $compiler->registerElement('u', new Style(null, null, [TextStyles::UNDERLINE]));
    }
1021229
public function addProperty(ClassProperty $property)
    {
        if (isset($this->properties[$property->getName()])) {
            throw new CompilerException("Property '".$property->getName()."' was defined more than one time", $property->getOriginal());
        }

        $this->properties[$property->getName()] = $property;
    }
724380
public function addSigned(string $name, string $value): void
	{
		if(empty($this->signer))
		{
			throw new RuntimeException('A [ Signer ] instance is required to add signed cookies.');
		}

		$this->cookies[$name] = $this->signer->sign($value);
	}
613093
@Override
  protected void secondPassCompile() throws MappingException {
    super.secondPassCompile();
    configSchema();
    Set<String> hackedEntityNames = CollectUtils.newHashSet();
    for (Map.Entry<String, PersistentClass> entry : classes.entrySet()) {
      if (!entry.getKey().equals(entry.getValue().getEntityName())) hackedEntityNames.add(entry.getKey());
    }
    for (String entityName : hackedEntityNames)
      classes.remove(entityName);
  }
179985
private static CompilerPass createPeepholeOptimizationsPass(
      AbstractCompiler compiler, String passName) {
    final boolean late = false;
    final boolean useTypesForOptimization = compiler.getOptions().useTypesForLocalOptimization;
    List<AbstractPeepholeOptimization> optimizations = new ArrayList<>();
    optimizations.add(new MinimizeExitPoints());
    optimizations.add(new PeepholeMinimizeConditions(late));
    optimizations.add(new PeepholeSubstituteAlternateSyntax(late));
    optimizations.add(new PeepholeReplaceKnownMethods(late, useTypesForOptimization));
    optimizations.add(new PeepholeRemoveDeadCode());
    if (compiler.getOptions().j2clPassMode.shouldAddJ2clPasses()) {
      optimizations.add(new J2clEqualitySameRewriterPass(useTypesForOptimization));
      optimizations.add(new J2clStringValueOfRewriterPass());
    }
    optimizations.add(new PeepholeFoldConstants(late, useTypesForOptimization));
    optimizations.add(new PeepholeCollectPropertyAssignments());
    return new PeepholeOptimizationsPass(compiler, passName, optimizations);
  }