@param Result $result   Result or exception.
@param array  $acceptor Acceptor configuration being checked.

@return bool
191070
private function matchesPathAny($result, array $acceptor)
    {
        if (!($result instanceof ResultInterface)) {
            return false;
        }

        $actuals = $result->search($acceptor['argument']) ?: [];
        foreach ($actuals as $actual) {
            if ($actual == $acceptor['expected']) {
                return true;
            }
        }

        return false;
    }
470572
protected function onJobCompleted(string $result) : bool
    {
        $this->replySocket->send(json_encode([
            'request' => 'job_completed',
            'worker_id' => $this->workerId,
            'job_id' => $this->jobId,
            'result' => $result
        ]));
        $response = $this->replySocket->recv();
        $this->jobId = null;
        return ($response === 'ok');
    }
1100147
protected function handleRequestError($result)
    {
        /**
         * Curl error
         */
        if ($result === false) {
            throw new Exception\TransferError($this->request->getErrorString(), $this->request->getErrorCode());
        }

        switch ($this->request->getResponseHTTPCode()) {
            case 401:
                $this->error($result, ['CODE'=>401]);
                throw new Exception\AuthenticationFailure($result, 401);
                break;
            case 403:
                $this->error($result, ['CODE'=>403]);
                throw new Exception\AccessDenied($result, 403);
                break;
            case 404:
                //sometimes it's a json string, sometimes it's not... so there's that.
                if (stripos($result, '{') === 0) {
                    $error = json_decode($result);
                    $errorMessage = $error->Message;
                }
                else {
                    $errorMessage = $result;
                }
                $this->error($errorMessage, ['CODE'=>404]);
                throw new Exception\NotFound($errorMessage, 404);
                break;
        }
    }
1272687
protected static function parseBooleanType(&$data, &$result)
    {
        // Boolean type
        $booleanValue = (bool) (ord($data[2]) == 0xff);
        $dataI = substr($data, 3);
        $result[] = [
            'boolean (1)',
            $booleanValue, ];
        $data = $dataI;
    }
739307
protected function _checkResult($result) {
        $rvalue = true;
        foreach ($result as $socketName => $value) {
            if ($value !== true) {
                Mage::helper('turpentine/debug')->logWarn(
                    'Error in Varnish action result for server [%s]: %s',
                    $socketName, $value );
                $rvalue = false;
            }
        }
        return $rvalue;
    }
404926
protected function validate_add_field_result($result) {

        if (!$result) {
            throw new \moodle_exception('errorcreatingschema', 'search_solr', '', get_string('nodatafromserver', 'search_solr'));
        }

        $results = json_decode($result);
        if (!$results) {
            if (is_scalar($result)) {
                $errormsg = $result;
            } else {
                $errormsg = json_encode($result);
            }
            throw new \moodle_exception('errorcreatingschema', 'search_solr', '', $errormsg);
        }

        // It comes as error when fetching fields data.
        if (!empty($results->error)) {
            throw new \moodle_exception('errorcreatingschema', 'search_solr', '', $results->error);
        }

        // It comes as errors when adding fields.
        if (!empty($results->errors)) {

            // We treat this error separately.
            $errorstr = '';
            foreach ($results->errors as $error) {
                $errorstr .= implode(', ', $error->errorMessages);
            }
            throw new \moodle_exception('errorcreatingschema', 'search_solr', '', $errorstr);
        }

    }
1240642
public static function isValidPath($filename, $acceptfolder = FALSE) {		
		if(strpbrk($filename, $acceptfolder ? '?%*:|"<>' : '\\/?%*:|"<>') === FALSE) return true;
		return false;
	}
1040471
protected function handleEventScriptResult(
        /** @noinspection PhpUnusedParameterInspection */
        $script,
        $result
    ) {
        if (array_get($result, 'stop_propagation', false)) {
            Log::info('  * Propagation stopped by script.');

            return false;
        }

        return true;
    }
378060
public static void accept(SARLQuickfixProvider provider, Issue issue, IssueResolutionAcceptor acceptor) {
		final SuperTypeRemoveModification modification = new SuperTypeRemoveModification();
		modification.setIssue(issue);
		modification.setTools(provider);
		acceptor.accept(issue,
				Messages.SARLQuickfixProvider_0,
				Messages.SARLQuickfixProvider_17,
				JavaPluginImages.IMG_CORRECTION_REMOVE,
				modification,
				IProposalRelevance.REMOVE_REDUNDANT_SUPER_INTERFACE);
	}
1251067
private function updateIssue($issue, $result)
    {
        if ($result === StepEvent::FAILED && $this->reopenOnFail) {
            $this->jiraService->reopenIssue($issue);
        }
    }
336546
protected function checkResponseForErrors($result)
    {
        // Detect errors and die if one is found:
        if ($result->error) {
            $attribs = $result->error->attributes();

            // If this is a bad resumption token error and we're trying to
            // restore a prior state, we should clean up.
            if ($attribs['code'] == 'badResumptionToken'
                && $this->stateManager->loadState()
            ) {
                $this->stateManager->clearState();
                throw new \Exception(
                    "Token expired; removing last_state.txt. Please restart harvest."
                );
            }
            throw new \Exception(
                "OAI-PMH error -- code: {$attribs['code']}, " .
                "value: {$result->error}"
            );
        }
    }
569193
private function castResult($result)
    {
        try {
            $result = $this->typeAdapter->toArray($result);
        } catch (TypeCastException $exception) {
            return $result;
        }

        return $result;
    }
907754
protected function isSuccess($result): bool
    {
        return ! is_null($result) ? (is_string($result) && $result === 'true') || (is_bool($result) && $result) : false;
    }
433015
public static void accept(SARLQuickfixProvider provider, Issue issue, IssueResolutionAcceptor acceptor) {
		final String[] data = issue.getData();
		if (data != null && data.length > 0) {
			final String expectedType = data[0];
			final ReturnTypeAddModification modification = new ReturnTypeAddModification(expectedType);
			modification.setIssue(issue);
			modification.setTools(provider);
			acceptor.accept(issue,
					MessageFormat.format(Messages.SARLQuickfixProvider_13, expectedType),
					Messages.SARLQuickfixProvider_14,
					JavaPluginImages.IMG_CORRECTION_ADD,
					modification,
					IProposalRelevance.CHANGE_RETURN_TYPE);
		}
	}
1222299
public function expandException($ex, &$result = array(), $limit = 10)
    {
        $result[] = $ex;
        if ($ex->getPrevious()) {
            if ($limit > 0) {
                $this->expandException($ex->getPrevious(), $result, $limit - 1);
            }
        }
        return $result;
    }
601501
public function addResult(Result $result): self
    {
        $handler = $result->getHandlerName();
        $this->results[$handler][] = $result;

        return $this;
    }
186369
public static void accept(SARLQuickfixProvider provider, Issue issue, IssueResolutionAcceptor acceptor) {
		final FiredEventRemoveModification modification = new FiredEventRemoveModification();
		modification.setIssue(issue);
		modification.setTools(provider);
		acceptor.accept(issue,
				Messages.SARLQuickfixProvider_0,
				Messages.SARLQuickfixProvider_8,
				JavaPluginImages.IMG_CORRECTION_REMOVE,
				modification,
				IProposalRelevance.REMOVE_EXCEPTIONS);
	}