@param PreCommit   $preCommitData
@param IOInterface $input

@return PreCommit
492961
public function process(PreCommit $preCommitData, IOInterface $input)
    {
        $this->io = $input;
        if (true === $preCommitData->isUndefined()) {
            $preCommitData = PreCommitConfigurator::configure($this->io, $preCommitData);
        }

        if (true === $preCommitData->isEnabled()) {
            $preCommitData = $preCommitData->setExecute($this->configTools($preCommitData->getExecute()));
        }

        return $preCommitData;
    }
1118350
public void doCommit(DefaultTransactionStatus status) throws TransactionException {
		CompensatingTransactionObject txObject = (CompensatingTransactionObject) status.getTransaction();
		txObject.getHolder().getTransactionOperationManager().commit();

	}
126964
public function configure(IOInterface $input, PhpUnitGuardCoverage $phpUnitGuardCoverage)
    {
        if (true === $phpUnitGuardCoverage->isUndefined()) {
            $guardCoverageAnswer = $input->ask(
                HookQuestions::PHPUNIT_GUARD_COVERAGE,
                HookQuestions::DEFAULT_TOOL_ANSWER
            );

            $phpUnitGuardCoverage = $phpUnitGuardCoverage->setEnabled(
                new Enabled(HookQuestions::DEFAULT_TOOL_ANSWER === strtoupper($guardCoverageAnswer))
            );

            if (true === $phpUnitGuardCoverage->isEnabled()) {
                $defaultMessage = $input->ask(
                    HookQuestions::PHPUNIT_GUARD_COVERAGE_MESSAGE,
                    HookQuestions::PHPUNIT_GUARD_COVERAGE_MESSAGE_DEFAULT
                );
                /** @var PhpUnitGuardCoverage $phpUnitGuardCoverage */
                $phpUnitGuardCoverage = $phpUnitGuardCoverage->setWarningMessage(
                    new Message($defaultMessage)
                );
                
                $this->coverageGitIgnoreConfigurator->configure();
            }
        }
            return $phpUnitGuardCoverage;
    }
595228
private function convertInputToSubmittedData(InputInterface $input, FormInterface $form)
    {
        $submittedData = [];

        // we don't need to do this recursively, since command options are one-dimensional (or are they?)
        foreach ($form->all() as $name => $field) {
            if ($input->hasOption($name)) {
                $submittedData[$name] = $input->getOption($name);
            }
        }

        return $submittedData;
    }
335233
public function update(array $input = [])
    {
        DB::beginTransaction();

        try {
            LaravelEvent::fire(static::$name.'.updating', $this);
            $this->beforeUpdate($input);
            $return = parent::update($input);
            $this->afterUpdate($input, $return);
            LaravelEvent::fire(static::$name.'.updated', $this);

            DB::commit();
        } catch (\Exception $e) {
            DB::rollBack();
            throw $e;
        }

        return $return;
    }
258293
public static function fromObject($data, $returnType = 'HpsCardinalMPIPreapprovalResponse')
    {
        $response = parent::fromObject($data, $returnType);
        $response->longAccessToken = self::readDataKey($data, 'LongAccessToken');
        $response->preCheckoutData = isset($data->PrecheckoutData) ? simplexml_load_string($data->PrecheckoutData)->PrecheckoutData : null;
        $response->preCheckoutTransactionId = self::readDataKey($data, 'PrecheckoutTransactionId');
        return $response;
    }
736949
public function preInsert(ConnectionInterface $con = null)
    {
        parent::preInsert($con);

        $this->dispatchEvent(TheliaEvents::BEFORE_CREATEADDRESS, new AddressEvent($this));

        return true;
    }
498037
public function preSetData(FormEvent $event)
    {
        $entity = $event->getData();
    
        if ($entity instanceof FileInterface && null !== $entity->getId()){
            try {
                $this->fileManager->copyFileToTemporaryDirectory($entity);
            } catch (\Gaufrette\Exception\FileNotFound $e) {
                $event->setData(null);
            }
        }
    }
167491
public function createCommitComment($owner, $repo, $sha, $body, $path = null, $position = null)
	{
		$data = array(
			'body' => $body,
		);
		if (!is_null($path))
			$data['path'] = $path;
		if (!is_null($position))
			$data['position'] = $position;

		return $this->client->request("/repos/$owner/$repo/commits/$sha/comments", 'POST', json_encode($data), 201, 'GitHubCommitComment');
	}
739175
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->validateCommand($input);

        $output->writeln('> Loading configuration file');
        $config = $input->getOption('config');
        $files = (new ConfigResolver())->getFileList($config);
        $output->writeLn('- Found '.count($files).' files');

        $preloader = (new Factory())->create($this->getOptions($input));

        $outputFile = $input->getOption('output');
        $handle = $preloader->prepareOutput($outputFile, $input->getOption('strict_types'));

        $output->writeln('> Compiling classes');

        $count = 0;
        $countSkipped = 0;
        $comments = !$input->getOption('strip_comments');

        foreach ($files as $file) {
            $count++;

            try {
                $code = $preloader->getCode($file, $comments);
                $output->writeln('- Writing '.$file);
                fwrite($handle, $code."\n");
            } catch (VisitorExceptionInterface $e) {
                $countSkipped++;
                $output->writeln('- Skipping '.$file);
            }
        }

        fclose($handle);

        $output->writeln("> Compiled loader written to $outputFile");
        $output->writeln('- Files: '.($count - $countSkipped).'/'.$count.' (skipped: '.$countSkipped.')');
        $output->writeln('- Filesize: '.(round(filesize($outputFile) / 1024)).' kb');
    }
1170934
void preCommit(Transaction transaction)
                    throws ObjectManagerException
    {
        throw new InvalidStateException(this, InternalTransaction.stateTerminated, InternalTransaction.stateNames[InternalTransaction.stateTerminated]);
    }
248014
public static function transform(PreCommit $preCommit, CommitMsg $commitMsg, PrePush $prePush)
    {
        $tools = $preCommit->getExecute()->execute();
        $prePushTools = $prePush->getExecute()->execute();
        $composer = $tools[0];
        $jsonLint = $tools[1];
        $phpLint = $tools[2];
        /** @var PhpMd $phpMd */
        $phpMd = $tools[3];
        /** @var PhpCs $phpCs */
        $phpCs = $tools[4];
        /** @var PhpCsFixer $phpCsFixer */
        $phpCsFixer = $tools[5];
        /** @var PhpUnit $phpunit */
        $phpunit = $tools[6];
        /** @var PhpUnitStrictCoverage $phpUnitStrictCoverage */
        $phpUnitStrictCoverage = $tools[7];
        /** @var PhpUnitGuardCoverage $phpUnitGuardCoverage */
        $phpUnitGuardCoverage = $tools[8];
        
        /** @var PhpUnit $phpunitPrePush */
        $phpunitPrePush = $prePushTools[0];
        /** @var PhpUnitStrictCoverage $phpUnitStrictCoveragePrePush */
        $phpUnitStrictCoveragePrePush = $prePushTools[1];
        /** @var PhpUnitGuardCoverage $phpUnitGuardCoveragePrePush */
        $phpUnitGuardCoveragePrePush = $prePushTools[2];

        return [
            'pre-commit' => [
                'enabled' => $preCommit->isEnabled(),
                'execute' => [
                    'composer' => $composer->isEnabled(),
                    'jsonlint' => $jsonLint->isEnabled(),
                    'phplint' => $phpLint->isEnabled(),
                    'phpmd' => [
                        'enabled' => $phpMd->isEnabled(),
                        'options' => $phpMd->getOptions()->value(),
                    ],
                    'phpcs' => [
                        'enabled' => $phpCs->isEnabled(),
                        'standard' => $phpCs->getStandard()->value(),
                        'ignore' => $phpCs->getIgnore()->value(),
                    ],
                    'php-cs-fixer' => [
                        'enabled' => $phpCsFixer->isEnabled(),
                        'levels' => [
                            'psr0' => $phpCsFixer->getLevels()->getPsr0()->value(),
                            'psr1' => $phpCsFixer->getLevels()->getPsr1()->value(),
                            'psr2' => $phpCsFixer->getLevels()->getPsr2()->value(),
                            'symfony' => $phpCsFixer->getLevels()->getSymfony()->value(),
                        ],
                        'options' => $phpCsFixer->getOptions()->value(),
                    ],
                    'phpunit' => [
                        'enabled' => $phpunit->isEnabled(),
                        'random-mode' => $phpunit->getRandomMode()->value(),
                        'options' => $phpunit->getOptions()->value(),
                        'strict-coverage' => [
                            'enabled' => $phpUnitStrictCoverage->isEnabled(),
                            'minimum' => $phpUnitStrictCoverage->getMinimumStrictCoverage()->value(),
                        ],
                        'guard-coverage' => [
                            'enabled' => $phpUnitGuardCoverage->isEnabled(),
                            'message' => $phpUnitGuardCoverage->getWarningMessage()->value(),
                        ],
                    ],
                ],
                'message' => [
                    'right-message' => $preCommit->getMessages()->getRightMessage()->value(),
                    'error-message' => $preCommit->getMessages()->getErrorMessage()->value(),
                ],
            ],
            'commit-msg' => [
                'enabled' => $commitMsg->isEnabled(),
                'regular-expression' => $commitMsg->getRegularExpression()->value(),
            ],
            'pre-push' => [
                'enabled' => $prePush->isEnabled(),
                'execute' => [
                    'phpunit' => [
                        'enabled' => $phpunitPrePush->isEnabled(),
                        'random-mode' => $phpunitPrePush->getRandomMode()->value(),
                        'options' => $phpunitPrePush->getOptions()->value(),
                        'strict-coverage' => [
                            'enabled' => $phpUnitStrictCoveragePrePush->isEnabled(),
                            'minimum' => $phpUnitStrictCoveragePrePush->getMinimumStrictCoverage()->value(),
                        ],
                        'guard-coverage' => [
                            'enabled' => $phpUnitGuardCoveragePrePush->isEnabled(),
                            'message' => $phpUnitGuardCoveragePrePush->getWarningMessage()->value()
                        ],
                    ],
                ],
                'message' => [
                    'right-message' => $prePush->getMessages()->getRightMessage()->value(),
                    'error-message' => $prePush->getMessages()->getErrorMessage()->value(),
                ],
            ],
        ];
    }
964429
public function submit(array $inputData = [])
    {
        $this->validated = false;
        $this->isSubmitted = true;
        $this->isValid = true;

        /** @var ElementInterface $element */
        foreach ($this->elements() as $name => $element) {
            if ($element->isDisabled()) {
                continue;
            }
            $value = $inputData[$name] ?? '';
            $this->rawData[$name] = $value;
            $value = $this->filter($name, $value);
            $this->data[$name] = $value;
            $element->withValue($value);

            // only validate elements which are not disabled.
            if (! $this->validate($name, $element->value())) {
                $this->isValid = false;
            }
        }
    }
258004
public function onBeforeEditPageCommit(BeforeEditPageCommitEvent $event)
    {
        if ($event->isAborted()) {
            return;
        }

        $pageManager = $event->getContentManager();
        $pageRepository = $pageManager->getPageRepository();
        $values = $event->getValues();

        if (!is_array($values)) {
            throw new InvalidArgumentException('exception_invalid_value_array_required');
        }

        try {
            $pageInformation = $pageManager->getTemplateManager()
                    ->getPageBlocks()
                    ->getPageInformation();

            $idLanguage = $pageInformation["idLanguage"];
            $idPage = $pageInformation["idPage"];
            $seoRepository = $this->seoManager->getSeoRepository();
            $seo = $seoRepository->fromPageAndLanguage($idLanguage, $idPage);
            if (!empty($values)) {
                $seoRepository->setConnection($pageRepository->getConnection());
                $pageRepository->startTransaction();
                $this->seoManager->set($seo);
                $values = array_merge($values, array('PageId' => $idPage, 'LanguageId' => $idLanguage));
                $result = $this->seoManager->save($values);

                if (false !== $result) {
                    $pageRepository->commit();

                    return;
                }

                $pageRepository->rollBack();
                $event->abort();
            }
        } catch (\Exception $e) {
            $event->abort();

            if (isset($pageRepository) && $pageRepository !== null) {
                $pageRepository->rollBack();
            }

            throw $e;
        }
    }
176519
public function submit($submittedData, $clearMissing = true)
    {
        if ($this->submitted) {
            throw new AlreadySubmittedException('A form can only be submitted once');
        }

        $this->submitted = true;

        return $this;
    }
94469
protected static function addOptions(InputInterface $input, $data)
    {
        if (
            ! $input instanceof ChoiceAwareElementInterface ||
            ! isset($data['options'])
        ) {
            return;
        }

        $input->setOptions($data['options']);
    }
400330
protected boolean getAutoCommit(final String dataSourceName) {
		Map<String, String> props = getConnPropsByDataSourceName(dataSourceName);
		return Boolean.parseBoolean(props.get(PROPS_AUTO_COMMIT));
	}