Get violations of a certain severity.

@param string $severity The severity type.

@return ViolationInterface[]
770310
public function get($severity)
    {
        $severity = $this->mapSeverity($severity);
        if (!isset($this->violations[$severity])) {
            return array();
        }

        return $this->violations[$severity];
    }
1350672
public static function getDurations(int $precision = -1): array
    {
        $ret = [];
        foreach (self::$timers as $t) {
            Arr::addValue($ret, $t->getName(), $t->getDuration($precision));
        }
        return $ret;
    }
1102392
def violations(self):
        
        return self._all_violations if self.config.fail_on == FAIL_ON_ANY else self._diff_violations
711925
public function getRequirementErrors(array $requirements)
    {
        $errors = array();
        foreach ($requirements as $items) {
            foreach ($items as $name => $info) {
                if (empty($info['status'])) {
                    $errors[$info['severity']][] = $name;
                }
            }
        }

        return $errors;
    }
1311734
private function getProviders($identifier)
    {
        if (isset($this->interfaceProviders[$identifier])) {
            return $this->interfaceProviders[$identifier];
        } elseif (isset($this->classProviders[$identifier])) {
            return $this->classProviders[$identifier];
        } else {
            return [];
        }
    }
85057
public function findByCodes($codes)
    {
        $codes = (array) $codes;
        $violations = [];
        foreach ($this as $violation) {
            if (\in_array($violation->getCode(), $codes, true)) {
                $violations[] = $violation;
            }
        }

        return new static($violations);
    }
157433
protected function getJoomlaSeverity($severity)
    {
        switch ($severity) {
            case Log::Error:
                return JLog::ERROR;
            case Log::Warning:
                return JLog::WARNING;
            case Log::Notice:
                return JLog::NOTICE;
            case Log::Info:
                return JLog::INFO;
            case Log::Debug:
            default:
                return JLog::DEBUG;
        }
    }
583569
protected function getAllowedPublicMethods(): array
    {
        $allowedInterfaces = \array_unique(\array_merge($this->getAllowedInterfaces(), [ImmutabilityBehaviour::class]));
        $allowedMethods = \array_merge(
            ...\array_map(
                function (string $interface): array {
                    return (new \ReflectionClass($interface))->getMethods(\ReflectionMethod::IS_PUBLIC);
                },
                $allowedInterfaces
            )
        );

        return \array_unique(\array_filter(\array_map(
            function (\ReflectionMethod $method): string {
                return !$method->isStatic() ? $method->getName() : '';
            },
            $allowedMethods
        )));
    }
1175640
public function getCommitsSince(string $revision) : array
    {
        $cmd = (new Commits($this->repo->getRoot()))->byRevision($revision)
                                                    ->prettyFormat(Commits\Jsonized::FORMAT);

        $result = $this->runner->run($cmd, new Commits\Jsonized());
        return $result->getFormattedOutput();
    }
696291
public function getExceptions(\Throwable $exception): array
    {
        $exc = $exception;
        do {
            $exc_data = [
                'value' => $this->serializer->serialize($exc->getMessage()),
                'type' => get_class($exc),
            ];

            /**'exception'
             * Exception::getTrace doesn't store the point at where the exception
             * was thrown, so we have to stuff it in ourselves. Ugh.
             */
            $trace = $exc->getTrace();
            $frame_where_exception_thrown = [
                'file' => $exc->getFile(),
                'line' => $exc->getLine(),
            ];

            array_unshift($trace, $frame_where_exception_thrown);

            $exc_data['stacktrace'] = [
                'frames' => $this->getStackTraceFrames($trace),
            ];

            $exceptions[] = $exc_data;
        } while ($exc = $exc->getPrevious());

        return array_reverse($exceptions);
    }
560087
public function createViolationErrorResponse(ViolationListException $exception)
    {
        $errorData = [];

        /** @var \Symfony\Component\Validator\ConstraintViolationInterface $violation */
        foreach ($exception->getViolationList() as $violation) {
            $errorData[$violation->getPropertyPath()] = $violation->getMessage();
        }

        // Try get code from errors storage via exception
        $errors = $this->handler->getErrors();
        $code = $errors->hasException($exception) ? $errors->getExceptionCode($exception) : 0;

        return $this->createErrorResponse($code, null, $errorData);
    }
919541
public function getSingleCommit(string $sha): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/commits/:sha',
            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $sha));
    }
354147
public function getStatuses()
    {
        return [
            self::STATUS_PENDING,
            self::STATUS_PROCESSING,
            self::STATUS_COMPLETE,
            self::STATUS_FAILED,
            self::STATUS_REFUNDED,
            self::STATUS_REFUNDED_PARTIAL,
        ];
    }
478636
public List<ActiveRule> getActiveRules(RulePriority severity) {
    List<ActiveRule> result = new ArrayList<>();
    for (ActiveRule activeRule : activeRules) {
      if (activeRule.getSeverity().equals(severity) && activeRule.isEnabled()) {
        result.add(activeRule);
      }
    }
    return result;
  }
465106
public function GetPendingSettlements(& $pagination = null, $sorting = null)
    {
        return $this->GetList('disputes_pendingsettlement', $pagination, '\MangoPay\Dispute', null, null, $sorting);
    }
781814
protected function getParameters()
    {
        $effectiveParameters = [];
        $missedAliases = [];

        foreach ($this->getParametersAliases() as $checkParameterShort => $checkParameterUri) {
            if ($this->hasRequestParameter($checkParameterUri)) {
                $effectiveParameters[$checkParameterUri] = $this->getRequestParameter($checkParameterUri);
            }
            else if ($this->hasRequestParameter($checkParameterShort)) {
                $effectiveParameters[$checkParameterUri] = $this->getRequestParameter($checkParameterShort);
            }
            else if ($this->isRequiredParameter($checkParameterShort)) {
                $missedAliases[] = $checkParameterShort;
            }
        }

        if (count($missedAliases) > 0) {
            throw new \common_exception_RestApi(
                'Missed required parameters: ' . implode(', ', $missedAliases));
        }

        return $effectiveParameters;
    }
155976
public function getSeverityReason()
    {
        if (!array_key_exists('type', $this->severityReason)) {
            syslog(LOG_WARNING, 'Severity reason should always have a "type" set');
            $this->severityReason['type'] = 'userSpecifiedSeverity';
        }

        return $this->severityReason;
    }