----------------------------------------------------------------------------- main methods -----------------------------------------------------------------------------
979780
function Validator() {
    this._roots = {
        stdlib: null,
        foreign: null,
        heap: null
    };
    this._globals = env(this);
    this._locals = null;
    this._src = null;
    this._result = null;
}
46874
public function main()
    {
        if ($this->target == null) {
            throw new BuildException('target property required');
        }

        $this->getProject()->executeTarget($this->target);
    }
373382
public function main()
    {
        $className = $this->loadDependencies();

        if (!isset($this->file) and count($this->filesets) == 0) {
            throw new BuildException('Missing either a nested fileset or attribute "file" set');
        }

        if (count($this->formatters) == 0) {
            // turn legacy format attribute into formatter
            $fmt = new PHPMDFormatterElement();
            $fmt->setType($this->format);
            $fmt->setUseFile(false);

            $this->formatters[] = $fmt;
        }

        $reportRenderers = [];

        foreach ($this->formatters as $fe) {
            if ($fe->getType() == '') {
                throw new BuildException('Formatter missing required "type" attribute.');
            }

            if ($fe->getUsefile() && $fe->getOutfile() === null) {
                throw new BuildException('Formatter requires "outfile" attribute when "useFile" is true.');
            }

            $reportRenderers[] = $fe->getRenderer();
        }

        if ($this->newVersion && $this->cache) {
            $reportRenderers[] = new PHPMDRendererRemoveFromCache($this->cache);
        } else {
            $this->cache = null; // cache not compatible to old version
        }

        // Create a rule set factory
        if ($this->newVersion) {
            $ruleSetFactory = new \PHPMD\RuleSetFactory();
        } else {
            if (!class_exists("PHP_PMD_RuleSetFactory")) {
                @include 'PHP/PMD/RuleSetFactory.php';
            }
            $ruleSetFactory = new PHP_PMD_RuleSetFactory();
        }
        $ruleSetFactory->setMinimumPriority($this->minimumPriority);

        /**
         * @var PHPMD\PHPMD $phpmd
         */
        $phpmd = new $className();
        $phpmd->setFileExtensions($this->allowedFileExtensions);
        $phpmd->setIgnorePattern($this->ignorePatterns);

        $filesToParse = $this->getFilesToParse();

        if (count($filesToParse) > 0) {
            $inputPath = implode(',', $filesToParse);

            $this->log('Processing files...');

            $phpmd->processFiles($inputPath, $this->rulesets, $reportRenderers, $ruleSetFactory);

            if ($this->cache) {
                $this->cache->commit();
            }

            $this->log('Finished processing files');
        } else {
            $this->log('No files to process');
        }
    }
460304
public function boot(): void
    {
        $this->registerConsoleCommands();
        $this->registerPublishes();
        $this->registerRoutes();
        $this->registerViews();
        $this->registerTranslations();
        $this->registerEvents();
    }
475088
public function main()
    {
        if ($this->propertyname == null) {
            throw new BuildException("'property' must be set.");
        }
        if ($this->atLeast != null || $this->exactly != null) {
            // If condition values are set, evaluate the condition
            if ($this->evaluate()) {
                $this->getProject()->setNewProperty($this->propertyname, $this->getVersion());
            }
        } else {
            // Raw task
            $this->getProject()->setNewProperty($this->propertyname, $this->getVersion());
        }
    }
139389
public function main_init() {
		if ( $this->_initialized ) {
			return;
		}
		$this->_initialized = true;

		$this->filter->do_action( 'app_initialize', $this );
		$this->setup_property();
		$this->setup_textdomain();
		$this->setup_settings();
		$this->filter->do_action( 'app_initialized', $this );
	}
970680
public function init()
    {
        if ($this->countRows < 1) {
            $this->totalPages = 0;
            $this->currentPage = 0;

            return;
        }

        if ($this->limit < 10) {
            $this->limit = 10;
        }

        $this->totalPages = (int)($this->countRows / $this->limit);

        if ($this->countRows % $this->limit) {
            $this->totalPages++;
        }

        if ($this->totalPages === 0) {
            $this->totalPages = 1;
        }

        if ($this->currentPage < 0) {
            $this->currentPage = 0;
        }

        if ($this->currentPage > $this->totalPages) {
            $this->currentPage = $this->totalPages;
        }
    }
328688
public function execute()
    {
        if (!$this->isEmpty()) {
            $this->table->update($this->context + $this->values, $this->where)->run();
        }

        parent::execute();
    }
1361829
public function main()
    {
        if (!$this->defaultrequested && $this->add === "" && $this->remove === "" && !$this->echo) {
            throw new BuildException(
                "<defaultexcludes> task must set at least one attribute (echo=\"false\")"
                . " doesn't count since that is the default"
            );
        }
        if ($this->defaultrequested) {
            DirectoryScanner::resetDefaultExcludes();
        }
        if ($this->add !== "") {
            DirectoryScanner::addDefaultExclude($this->add);
        }
        if ($this->remove !== "") {
            DirectoryScanner::removeDefaultExclude($this->remove);
        }
        if ($this->echo) {
            $lineSep = Phing::getProperty('line.separator');
            $message = "Current Default Excludes:";
            $message .= $lineSep;
            $excludes = DirectoryScanner::getDefaultExcludes();
            $message .= "  ";
            $message .= implode($lineSep . "  ", $excludes);
            $this->log($message, $this->logLevel);
        }
    }
846744
public function main()
    {
        $this->validateAttributes();

        if ($this->action == 'w') {
            $this->write();
        } elseif ($this->action == 'r') {
            $this->read();
        }
    }
1045462
public function main()
    {
        $this->setup('proplist');

        $this->log("List all properties on files, dirs, or revisions from '" . $this->getWorkingCopy() ."'");
        
        $output = $this->run([$this->getWorkingCopy()], ['recursive' => $this->getRecursive()]);
        
        $this->project->setProperty($this->getPropertyName(), $output);
    }
258210
function _main() {
  const {guides: acGuidePaths, images: acGuideImagesPaths, examples: acExamplePaths} = getPathsFromAioContent();
  const {guides: coGuidePaths, images: coGuideImagesPaths, examples: coExamplePaths} = getPathsFromCodeowners();

  const guidesDiff = arrayDiff(acGuidePaths, coGuidePaths);
  const imagesDiff = arrayDiff(acGuideImagesPaths, coGuideImagesPaths);
  const examplesDiff = arrayDiff(acExamplePaths, coExamplePaths);
  const hasDiff = !!(guidesDiff.diffCount || imagesDiff.diffCount || examplesDiff.diffCount);

  if (hasDiff) {
    const expectedGuidesSrc = path.relative(PROJECT_ROOT_DIR, AIO_GUIDES_DIR);
    const expectedImagesSrc = path.relative(PROJECT_ROOT_DIR, AIO_GUIDE_IMAGES_DIR);
    const expectedExamplesSrc = path.relative(PROJECT_ROOT_DIR, AIO_GUIDE_EXAMPLES_DIR);
    const actualSrc = path.relative(PROJECT_ROOT_DIR, CODEOWNERS_PATH);

    reportDiff(guidesDiff, expectedGuidesSrc, actualSrc);
    reportDiff(imagesDiff, expectedImagesSrc, actualSrc);
    reportDiff(examplesDiff, expectedExamplesSrc, actualSrc);
  }

  process.exit(hasDiff ? 1 : 0);
}
122411
public function main()
    {
        $this->ini = new IniFileConfig();
        $readFile = null;
        $writeFile = null;

        if (null !== $this->source && null === $this->dest) {
            $readFile = $this->source;
        } elseif (null !== $this->dest && null === $this->source) {
            $readFile = $this->dest;
        } else {
            $readFile = $this->source;
        }

        if (null !== $this->dest) {
            $writeFile = $this->dest;
        } elseif (null !== $this->source) {
            $writeFile = $this->source;
        } else {
            $writeFile = $this->dest;
        }

        if ($readFile === null && $writeFile === null) {
            $msg = "Neither source nor dest is set";
            if ($this->haltonerror) {
                throw new BuildException($msg);
            }
            $this->log($msg, Project::MSG_ERR);
            return;
        }

        if (!$this->checkReadFile($readFile)) {
            return;
        }

        if (!$this->checkWriteFile($writeFile)) {
            return;
        }

        $this->enumerateGets();
        $this->enumerateSets();
        $this->enumerateRemoves();

        if (count($this->sets) || count($this->removals)) {
            try {
                $this->ini->write($writeFile);
                $this->log("Wrote to $writeFile");
            } catch (Exception $ex) {
                $msg = $ex->getMessage();
                if ($this->haltonerror) {
                    throw new BuildException($msg);
                }
                $this->log($msg, Project::MSG_ERR);
            }
        }
    }
758324
public function main()
    {
        if ($this->list === null && $this->currPath === null && count($this->dirsets) === 0 && count($this->filesets) == 0 && count($this->filelists) == 0) {
            throw new BuildException("Need either list, path, nested dirset, nested fileset or nested filelist to iterate through");
        }
        if ($this->param === null) {
            throw new BuildException("You must supply a property name to set on each iteration in param");
        }
        if ($this->calleeTarget === null) {
            throw new BuildException("You must supply a target to perform");
        }

        $callee = $this->createCallTarget();
        $mapper = null;

        if ($this->mapperElement !== null) {
            $mapper = $this->mapperElement->getImplementation();
        }

        if ($this->list !== null) {
            $arr = explode($this->delimiter, $this->list);
            $total_entries = 0;

            foreach ($arr as $index => $value) {
                if ($this->trim) {
                    $value = trim($value);
                }
                $premapped = '';
                if ($mapper !== null) {
                    $premapped = $value;
                    $value = $mapper->main($value);
                    if ($value === null) {
                        continue;
                    }
                    $value = array_shift($value);
                }
                $this->log(
                    "Setting param '$this->param' to value '$value'" . ($premapped ? " (mapped from '$premapped')" : ''),
                    Project::MSG_VERBOSE
                );
                $prop = $callee->createProperty();
                $prop->setOverride(true);
                $prop->setName($this->param);
                $prop->setValue($value);
                $prop = $callee->createProperty();
                $prop->setOverride(true);
                $prop->setName($this->index);
                $prop->setValue($index);
                $callee->main();
                $total_entries++;
            }
        }

        if ($this->currPath !== null) {
            $pathElements = $this->currPath->listPaths();
            foreach ($pathElements as $pathElement) {
                $ds = new DirectoryScanner();
                $ds->setBasedir($pathElement);
                $ds->scan();
                $this->process($callee, new PhingFile($pathElement), $ds->getIncludedFiles(), array());
            }
        }

        // filelists
        foreach ($this->filelists as $fl) {
            $srcFiles = $fl->getFiles($this->project);

            $this->process($callee, $fl->getDir($this->project), $srcFiles, []);
        }

        // filesets
        foreach ($this->filesets as $fs) {
            $ds = $fs->getDirectoryScanner($this->project);
            $srcFiles = $ds->getIncludedFiles();
            $srcDirs = $ds->getIncludedDirectories();

            $this->process($callee, $fs->getDir($this->project), $srcFiles, $srcDirs);
        }

        foreach ($this->dirsets as $dirset) {
            $ds = $dirset->getDirectoryScanner($this->project);
            $srcDirs = $ds->getIncludedDirectories();

            $this->process($callee, $dirset->getDir($this->project), [], $srcDirs);
        }

        if ($this->list === null) {
            $this->log(
                "Processed {$this->total_dirs} directories and {$this->total_files} files",
                Project::MSG_VERBOSE
            );
        } else {
            $this->log(
                "Processed $total_entries entr" . ($total_entries > 1 ? 'ies' : 'y') . " in list",
                Project::MSG_VERBOSE
            );
        }
    }
783970
public function main()
    {
        if ($this->property == null) {
            throw new BuildException("property attribute required", $this->getLocation());
        }
        if ($this->file == null) {
            throw new BuildException("file attribute required", $this->getLocation());
        } else {
            $value = $this->file->getAbsoluteFile()->getParent();
            $this->getProject()->setNewProperty($this->property, $value);
        }
    }
585369
public function main()
    {
        if ($this->countConditions() > 1) {
            throw new BuildException(
                "You must not nest more than one condition into <condition>"
            );
        }
        if ($this->countConditions() < 1) {
            throw new BuildException(
                "You must nest a condition into <condition>"
            );
        }
        if ($this->property === null) {
            throw new BuildException('The property attribute is required.');
        }
        $cs = $this->getIterator();
        if ($cs->current()->evaluate()) {
            $this->log("Condition true; setting " . $this->property . " to " . $this->value, Project::MSG_DEBUG);
            $this->project->setNewProperty($this->property, $this->value);
        } elseif ($this->alternative !== null) {
            $this->log("Condition false; setting " . $this->property . " to " . $this->alternative, Project::MSG_DEBUG);
            $this->project->setNewProperty($this->property, $this->alternative);
        } else {
            $this->log('Condition false; not setting ' . $this->property, Project::MSG_DEBUG);
        }
    }
733179
public function main()
    {
        if (!$this->param('xml') && !$this->param('version')) {
            $this->out('<info>Current Paths:</info>', 2);
            $this->out('* app:  ' . APP_DIR . DIRECTORY_SEPARATOR);
            $this->out('* root: ' . ROOT . DIRECTORY_SEPARATOR);
            $this->out('* core: ' . CORE_PATH);
            $this->out('');

            $this->out('<info>Available Shells:</info>', 2);
        }

        if ($this->param('version')) {
            $this->out(Configure::version());

            return;
        }

        $shellList = $this->Command->getShellList();
        if (!$shellList) {
            return;
        }

        if (!$this->param('xml')) {
            $this->_asText($shellList);
        } else {
            $this->_asXml($shellList);
        }
    }