@param CheckOutcome $outcome

@return string
9883
protected function getTranslatedMessage(CheckOutcome $outcome)
    {
        return $this->translateOutcomeLevel($outcome->getLevel()).' - '.$this->translate(
            $outcome->getMessageKey(),
            $outcome->getMessageParameters()
        );
    }
345374
private function getResultIfArgsEmptyForPreviewAndOther($result)
    {
        if (isset($result['template_id'])) {
            $this->saveTemplateIdInRegistry($result['template_id']);
        }
        if (isset($result['template_text'])) {
            $templateText = $result['template_text'];
            if ($this->isStringCompressed($templateText)) {
                $result['template_text'] = $this->decompressString($templateText);
            }
        }

        return $result;
    }
802274
public function toCommon(int $amount, bool $format = true): string
    {
        $money          = $this->castMoney($amount, $this->getCurrencySwiftCode());
        $moneyFormatter = new DecimalMoneyFormatter(new ISOCurrencies());

        return ($format) ?
        number_format($moneyFormatter->format($money), 2, '.', ',') :
        $moneyFormatter->format($money);
    }
316601
public static function extractResultOutput(array $result)
    {
        // extracting result only make sense when error is `null`.
        assert(static::isResultSuccessful($result) === true && $result[static::REPLY_ERRORS_INFO] === null);

        $value = $result[static::REPLY_SUCCESS_VALUE];

        return $value;
    }
669826
private function formatResultJson($result)
    {
        if ($result === 'Unauthorized' || $result === 'Forbidden') {
            $this->log->error('Erro ao enviar a transação', ['Retorno:' => $result]);

            throw new PagSeguroException($result.': Não foi possível estabelecer uma conexão com o PagSeguro.', 1001);
        }
        if ($result === 'Not Found') {
            $this->log->error('Notificação/Transação não encontrada', ['Retorno:' => $result]);

            throw new PagSeguroException($result.': Não foi possível encontrar a notificação/transação no PagSeguro.', 1002);
        }

        $result = json_decode($result);

        if (isset($result->error) && $result->error === true) {
            $errors = $result->errors;

            $message = reset($errors);
            $code = key($errors);

            $this->log->error($message, ['Retorno:' => json_encode($result)]);

            throw new PagSeguroException($message, (int) $code);
        }

        return $result;
    }
722973
protected function htmlOptionsResult($value = '')
    {
        $class = !empty($this->defaults['resultClass']) ? $this->defaults['resultClass'] . $value : '';
        $style = !empty($this->defaults['resultStyle']) ? $this->defaults['resultStyle'] : '';

        if (!empty($this->bootstrapDefaults['resultClass'])) {
            $class .= $this->bootstrapDefaults['resultClass'];
        }
        if (!empty($this->bootstrapDefaults['resultStyle'])) {
            $style .= $this->bootstrapDefaults['resultStyle'];
        }
        if (!empty($this->resultClass) && is_string($this->resultClass)) {
            $class .= ' ' . $this->resultClass;
        }
        if (!empty($this->resultStyle) && is_string($this->resultStyle)) {
            $style .= ' ' . $this->resultStyle;
        }

        return [
            'class' => $class ?: null,
            'style' => $style ?: null,
        ];
    }
590299
public function assertCommandResult($result) {
        $exitCode = $this->getExitCode();

        // Escape % as the callback will pass this value to sprintf() if the assertion fails, and
        // sprintf might complain about too few arguments as the output might contain stuff like %s
        // or %d.
        $output = str_replace('%', '%%', $this->getOutput());

        if ($result === 'fail') {
            $callback = 'notEq';
            $errorMessage = sprintf(
                'Invalid exit code, did not expect 0. Command output: %s',
                $output
            );
        } else {
            $callback = 'eq';
            $errorMessage = sprintf(
                'Expected exit code 0, got %d. Command output: %s',
                $exitCode,
                $output
            );
        }

        Assertion::$callback(0, $exitCode, $errorMessage);
    }
1265711
public static function clicksToAds($amount): string
    {
        $amountAsString = (string)$amount;
        $isNegativeValue = false;
        if ('-' === $amountAsString[0]) {
            $isNegativeValue = true;
            // cut minus sign from negative value
            $amountAsString = substr($amountAsString, 1, strlen($amountAsString));
        }
        //add leading zeros
        $amountAsString = str_pad($amountAsString, 12, '0', STR_PAD_LEFT);
        // insert decimal separator
        $amountAsString = substr_replace($amountAsString, '.', strlen($amountAsString) - 11, 0);
        if ($isNegativeValue) {
            // prepend minus sign for negative value
            $amountAsString = '-' . $amountAsString;
        }
        return $amountAsString;
    }
747051
private function transformResult($result)
    {
        if ($this->actualDriver() === self::DRIVER_PREDIS && $result instanceof Status) {
            $result = $result->getPayload() === 'OK';
        }
        return $result;
    }
1092435
public static function br(int $amount = 1) : string
    {
        $output = "";
        for ($i = 0; $i < $amount; $i++) {
            $output .= self::tag("br");
        }
        return $output;
    }
656798
public boolean validateOutcomeName(String outcome) {
        boolean isValid = false;
        if ((AuditConstants.validOutcomesList).contains(outcome))
            isValid = true;

        return isValid;
    }
64529
private function outputResult($result)
    {
        $this->io->writeln(sprintf('<comment>%s</comment>', $this->app['extend.action.io']->getOutput()), OutputInterface::OUTPUT_PLAIN);

        if ($result === 0) {
            $this->io->success('Autoloaders updated');
            $this->auditLog(__CLASS__, 'Autoloaders updated');
        } else {
            $this->io->error('Autoloaders failed update');
        }

        return $result;
    }
92213
public static function validateOutput($result, $saveFormat='')
    {
        $result = (string) $result;
        $validate = array(
            'Unknown file format.',
            'Unable to read beyond the end of the stream',
            'Index was out of range',
            'Cannot read that as a ZipFile',
            'Not a Microsoft PowerPoint 2007 presentation',
            'Index was outside the bounds of the array',
            'An attempt was made to move the position before the beginning of the stream',
            "Format '$saveFormat' is not supported."
        );
        $invalid = 0;
        foreach ($validate as $key => $value) {
            $pos = strpos($result, $value);
            if ($pos === 1 || $pos === 16) {
                $invalid = true;
            }
        }

        // Event can be used to perform extra validation on the result
        $dispatcher = AsposeApp::getEventDispatcher();
        $event = new ValidateOutputEvent($result, $invalid);

        /** @var ValidateOutputEvent $dispatchedEvent */
        $dispatchedEvent = $dispatcher->dispatch(ValidateOutputEvent::VALIDATE_OUTPUT, $event);

        // If the output is invalid it contains the error message
        if ($dispatchedEvent->isInvalid() === true) {
            return $result;
        } else {
            return ''; // FIXME returning an empty string here is really weird
        }
    }
180643
public static function getReceipt($options)
    {
        $api = new Api\GetTransactionTicket();
        if (isset($options['hash'])) {
            $api->setHash($options['hash']);
        }

        $result = $api->doRequest();
        return new Result\Receipt($result);
    }
701612
public static function getGeneratedValue(
        $productCode = null,
        $optionName = null,
        $optionValue = null,
        $method = 'name',
        $output = false,
        $urlEncode = false
    ) {
        $optionName = ($optionName !== null) ? preg_replace('/\s/', '_', $optionName) : $optionName;

        return (FoxyStripeSetting::current_foxystripe_setting()->CartValidation)
            ? \FoxyCart_Helper::fc_hash_value($productCode, $optionName, $optionValue, $method, $output, $urlEncode) :
            $optionValue;
    }
926668
public function removeOutcome(OutcomeDeclaration $outcome){
        $returnValue = (bool) false;

        if(!is_null($outcome)){
            if(isset($this->outcomes[$outcome->getSerial()])){
                unset($this->outcomes[$outcome->getSerial()]);
                $returnValue = true;
            }
        }else{
            common_Logger::w('Tried to remove null outcome');
        }

        if(!$returnValue){
            common_Logger::w('outcome not found '.$outcome->getSerial());
        }

        return (bool) $returnValue;
    }
566746
private function getProcessedTemplateBeforeSave($result)
    {
        //saving array values
        if (empty($args)) {
            $this->getResultIfArgsEmptyForBeforeSave($result);
        } else {
            //saving string value
            $field = $args[0];

            //compress the text body when is a dotmailer template
            if ($field == 'template_text' && ! $this->isStringCompressed($result) &&
                $this->transactionalHelper->isDotmailerTemplate($this->templateCode)
            ) {
                $result = $this->compressString($result);
            }
            if ($field == 'template_id') {
                $this->saveTemplateIdInRegistry($result);
            }
        }

        return $result;
    }