Create a new report from a named error.

@param \Bugsnag\Configuration $config  the config instance
@param string                 $name    the error name
@param string|null            $message the error message

@return static
973159
public static function fromNamedError(Configuration $config, $name, $message = null)
    {
        $report = new static($config);

        $report->setName($name)
              ->setMessage($message)
              ->setStacktrace(Stacktrace::generate($config))
              ->setUnhandled(false)
              ->setSeverityReason(['type' => 'handledError']);

        return $report;
    }
1056090
public static ConfigurationException createConfigurationException(
			final ErrorKeys errorId, final String message)
	{

		return new ConfigurationException(errorId.toString() + ":\r\n"
				+ message);
	}
989876
public function make( array $config, $name = null )
	{
		$config = $this->parseConfig( $config, $name );

		if ( isset( $config['read'] ) )
			return $this->createReadWriteConnection( $config );

		return $this->createSingleConnection( $config );
	}
123919
public static function message($name, $message = null)
    {
        if (func_num_args() === 2) {
            return static::$_messages[$name] = $message;
        }
        return isset(static::$_messages[$name]) ? static::$_messages[$name] : static::$_messages['_default_'];
    }
131876
public static function registerConfig($name, array $config) {
		if( empty($config['path']) ) {
			throw new \Exception('Missing a valid `path` in configuration of route "'.$name.'"');
		}
		if( empty($config['response']) ) {
			$config['response']	= !empty($config['output']) ? static::getOutputResponse($config['output']) : 'Orpheus\InputController\HTTPController\HTMLHTTPResponse';
		}
		if( empty($config['controller']) ) {
			if( !empty($config['redirect']) ) {
				$config['controller'] = 'Orpheus\\Controller\\RedirectController';
			} else
			if( !empty($config['render']) ) {
				$config['controller'] = 'Orpheus\\Controller\\StaticPageController';
			} else {
				throw new \Exception('Missing a valid `controller` in configuration of route "'.$name.'"');
			}
		}
		if( !isset($config['restrictTo']) ) {
			$config['restrictTo'] = null;
		}
		$options = $config;
		unset($options['path'], $options['controller'], $options['method'], $options['restrictTo']);
		static::register($name, $config['path'], $config['controller'], isset($config['method']) ? $config['method'] : null, $config['restrictTo'], $config['response'], $options);
	}
228366
public function make($config, $name = null)
    {
        $config = $this->parseConfig($config, $name);

//        if (isset($config['read'])) {
//            return $this->createReadWriteConnection($config);
//        }
        return $this->createSingleConnection($config);
    }
1115587
public function notifyError($name, $message, callable $callback = null)
    {
        $this->bugsnag->notifyError($name, $message, $callback);
    }
631623
public function sendEvent($name, $message)
    {
        if (false == $message instanceof Message) {
            $message = $this->context->createMessage($message);
        }

        $message->setProperty(Config::TOPIC, $name);

        $topic = $this->context->createTopic('enqueue.default');
        $topic->setType(AmqpTopic::TYPE_FANOUT);
        $topic->addFlag(AmqpTopic::FLAG_DURABLE);

        $this->context->createProducer()->send($topic, $message);
    }
640078
public static function registerConfig($name, array $config) {
		if( empty($config['path']) ) {
			throw new \Exception('Missing a valid "path" in configuration of route "'.$name.'"');
		}
		
// 		$parameters = array();
// 		if( isset($config['parameters']) && is_array($config['parameters']) ) {
// 			foreach( $config['parameters'] as $paramName => $paramConfig ) {
// 				$parameters[] = CLIArgument::make($paramName, $paramConfig);
// 			}
// 		}
		$options = $config;
		unset($options['path'], $options['controller'], $options['parameters']);
		static::register($name, $config['path'], $config['controller'], array(), $options);
	}
44862
public function message($message, $config = array())
    {
        $config = new AnConfig($config);

        $config->append(array(
            'type' => 'info',
            'block' => true,
            'closable' => false,
        ));

        $alertblock = ($config->block) ? 'alert-block' : '';

        $close_handler = '';
        if ($config->closable) {
            $close_handler = '<a class="close" data-dismiss="alert">&times;</a>';
        }

        $message = AnTranslator::_($message);

        return "<div class=\"alert alert-{$config->type} $alertblock\">$close_handler<p>$message</p></div>";
    }
430696
public static function create($name, array $config = array())
    {
        if (!isset(self::$config->generators[$name])) {
            throw new Exception("Unknown generator '$name'.");
        }

        $generator = \Yii::createComponent(\CMap::mergeArray(self::$config->generators[$name], $config));
        $generator->init();

        foreach (self::$config->attributes as $attribute => $value) {
            if (property_exists($generator, $attribute)) {
                $generator->$attribute = $value;
            }
        }

        return $generator;
    }
623596
public function set(string $name, string $config): self
    {
        try {
            $this->sections[$name] = new SectionConfiguration($config);
        } catch (\Throwable $e) {
            throw new \InvalidArgumentException(
                sprintf('AppSection "%s" configuration is invalid: %s', $name, $e->getMessage()), 0, $e
            );
        }

        return $this;
    }
1003995
public static function comment( $name, $message = null, $options = null ) {

		$options = self::options( null, $options );

		$name_more_clean = self::clean( $name, true );

		if ( ! empty( $options['description'] ) ) {
			$message = $options['description'];
		} elseif ( empty( $message ) ) {
			return '';
		}

		$message = apply_filters( 'pods_form_ui_comment_text', $message, $name, $options );

		ob_start();

		$type                = 'comment';
		$attributes          = array();
		$attributes['class'] = 'description pods-form-ui-' . $type . ' pods-form-ui-' . $type . '-' . $name_more_clean;
		$attributes          = self::merge_attributes( $attributes, $name, $type, $options, false );

		pods_view( PODS_DIR . 'ui/fields/_comment.php', compact( array_keys( get_defined_vars() ) ) );

		$output = ob_get_clean();

		return apply_filters( "pods_form_ui_{$type}", $output, $name, $message, $attributes, $options );
	}
157147
protected static function getRepositoryByConfig($config, $name)
    {
        if (!is_array($config)) {
            if (class_exists($config)) {
                return new $config;
            }

            throw new Exception('Cannot create repository from string');
        } elseif ($config['driver'] == 'faker') {
            return new Faker(Factory::create());
        } elseif ($config['driver'] == 'middleware') {
            return resolve($config['middleware'])->execute(function() {
            }
            );
        }

        return static::initPdoDatabase($config, $name);
    }
1119523
public function setConfig($name, array $config)
    {
        if (isset($this->configs[$name])) {
            throw new \InvalidArgumentException(sprintf(
                '%s config "%s" already exists.',
                $this->serviceType,
                $name
            ));
        }

        $this->configs[$name] = $config;
    }
506053
public static function run($name, array $config = array())
    {
        $generator = self::create($name, $config);

        if (!$generator->validate()) {
            $generator->renderErrors();
        }

        return $generator->generate();
    }
1242096
public static function initPdoDatabase($config, $name)
    {
        try {
            $pdo = static::createPdoConnectionByConfig($config);
        } catch (PDOException $e) {
            throw new Exception('Cannon instantiate database connection: ' . $e->getMessage());
        }

        $pdo->uniqueName = $config['host'] . "-" . $config['db'];

        static::checkDebugBar($pdo, $name);

        return new RepositoryPDO($pdo, $name);
    }