id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
220,700 | Seldaek/monolog | src/Monolog/Handler/ProcessHandler.php | ProcessHandler.handleStartupErrors | private function handleStartupErrors(): void
{
$selected = $this->selectErrorStream();
if (false === $selected) {
throw new \UnexpectedValueException('Something went wrong while selecting a stream.');
}
$errors = $this->readProcessErrors();
if (is_resource($this... | php | private function handleStartupErrors(): void
{
$selected = $this->selectErrorStream();
if (false === $selected) {
throw new \UnexpectedValueException('Something went wrong while selecting a stream.');
}
$errors = $this->readProcessErrors();
if (is_resource($this... | [
"private",
"function",
"handleStartupErrors",
"(",
")",
":",
"void",
"{",
"$",
"selected",
"=",
"$",
"this",
"->",
"selectErrorStream",
"(",
")",
";",
"if",
"(",
"false",
"===",
"$",
"selected",
")",
"{",
"throw",
"new",
"\\",
"UnexpectedValueException",
"... | Selects the STDERR stream, handles upcoming startup errors, and throws an exception, if any.
@throws \UnexpectedValueException | [
"Selects",
"the",
"STDERR",
"stream",
"handles",
"upcoming",
"startup",
"errors",
"and",
"throws",
"an",
"exception",
"if",
"any",
"."
] | ebb804e432e8fe0fe96828f30d89c45581d36d07 | https://github.com/Seldaek/monolog/blob/ebb804e432e8fe0fe96828f30d89c45581d36d07/src/Monolog/Handler/ProcessHandler.php#L130-L144 |
220,701 | Seldaek/monolog | src/Monolog/Handler/ChromePHPHandler.php | ChromePHPHandler.write | protected function write(array $record): void
{
if (!$this->isWebRequest()) {
return;
}
self::$json['rows'][] = $record['formatted'];
$this->send();
} | php | protected function write(array $record): void
{
if (!$this->isWebRequest()) {
return;
}
self::$json['rows'][] = $record['formatted'];
$this->send();
} | [
"protected",
"function",
"write",
"(",
"array",
"$",
"record",
")",
":",
"void",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isWebRequest",
"(",
")",
")",
"{",
"return",
";",
"}",
"self",
"::",
"$",
"json",
"[",
"'rows'",
"]",
"[",
"]",
"=",
"$",
... | Creates & sends header for a record
@see sendHeader()
@see send() | [
"Creates",
"&",
"sends",
"header",
"for",
"a",
"record"
] | ebb804e432e8fe0fe96828f30d89c45581d36d07 | https://github.com/Seldaek/monolog/blob/ebb804e432e8fe0fe96828f30d89c45581d36d07/src/Monolog/Handler/ChromePHPHandler.php#L114-L123 |
220,702 | Seldaek/monolog | src/Monolog/Handler/ChromePHPHandler.php | ChromePHPHandler.send | protected function send(): void
{
if (self::$overflowed || !self::$sendHeaders) {
return;
}
if (!self::$initialized) {
self::$initialized = true;
self::$sendHeaders = $this->headersAccepted();
if (!self::$sendHeaders) {
return... | php | protected function send(): void
{
if (self::$overflowed || !self::$sendHeaders) {
return;
}
if (!self::$initialized) {
self::$initialized = true;
self::$sendHeaders = $this->headersAccepted();
if (!self::$sendHeaders) {
return... | [
"protected",
"function",
"send",
"(",
")",
":",
"void",
"{",
"if",
"(",
"self",
"::",
"$",
"overflowed",
"||",
"!",
"self",
"::",
"$",
"sendHeaders",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"self",
"::",
"$",
"initialized",
")",
"{",
"self",
... | Sends the log header
@see sendHeader() | [
"Sends",
"the",
"log",
"header"
] | ebb804e432e8fe0fe96828f30d89c45581d36d07 | https://github.com/Seldaek/monolog/blob/ebb804e432e8fe0fe96828f30d89c45581d36d07/src/Monolog/Handler/ChromePHPHandler.php#L130-L169 |
220,703 | Seldaek/monolog | src/Monolog/Handler/FirePHPHandler.php | FirePHPHandler.getInitHeaders | protected function getInitHeaders(): array
{
// Initial payload consists of required headers for Wildfire
return array_merge(
$this->createHeader(['Protocol', 1], static::PROTOCOL_URI),
$this->createHeader([1, 'Structure', 1], static::STRUCTURE_URI),
$this->create... | php | protected function getInitHeaders(): array
{
// Initial payload consists of required headers for Wildfire
return array_merge(
$this->createHeader(['Protocol', 1], static::PROTOCOL_URI),
$this->createHeader([1, 'Structure', 1], static::STRUCTURE_URI),
$this->create... | [
"protected",
"function",
"getInitHeaders",
"(",
")",
":",
"array",
"{",
"// Initial payload consists of required headers for Wildfire",
"return",
"array_merge",
"(",
"$",
"this",
"->",
"createHeader",
"(",
"[",
"'Protocol'",
",",
"1",
"]",
",",
"static",
"::",
"PROT... | Wildfire initialization headers to enable message parsing
@see createHeader()
@see sendHeader() | [
"Wildfire",
"initialization",
"headers",
"to",
"enable",
"message",
"parsing"
] | ebb804e432e8fe0fe96828f30d89c45581d36d07 | https://github.com/Seldaek/monolog/blob/ebb804e432e8fe0fe96828f30d89c45581d36d07/src/Monolog/Handler/FirePHPHandler.php#L102-L110 |
220,704 | Seldaek/monolog | src/Monolog/Handler/SocketHandler.php | SocketHandler.setConnectionTimeout | public function setConnectionTimeout(float $seconds): self
{
$this->validateTimeout($seconds);
$this->connectionTimeout = $seconds;
return $this;
} | php | public function setConnectionTimeout(float $seconds): self
{
$this->validateTimeout($seconds);
$this->connectionTimeout = $seconds;
return $this;
} | [
"public",
"function",
"setConnectionTimeout",
"(",
"float",
"$",
"seconds",
")",
":",
"self",
"{",
"$",
"this",
"->",
"validateTimeout",
"(",
"$",
"seconds",
")",
";",
"$",
"this",
"->",
"connectionTimeout",
"=",
"$",
"seconds",
";",
"return",
"$",
"this",... | Set connection timeout. Only has effect before we connect.
@see http://php.net/manual/en/function.fsockopen.php | [
"Set",
"connection",
"timeout",
".",
"Only",
"has",
"effect",
"before",
"we",
"connect",
"."
] | ebb804e432e8fe0fe96828f30d89c45581d36d07 | https://github.com/Seldaek/monolog/blob/ebb804e432e8fe0fe96828f30d89c45581d36d07/src/Monolog/Handler/SocketHandler.php#L103-L109 |
220,705 | Seldaek/monolog | src/Monolog/Handler/SocketHandler.php | SocketHandler.setTimeout | public function setTimeout(float $seconds): self
{
$this->validateTimeout($seconds);
$this->timeout = $seconds;
return $this;
} | php | public function setTimeout(float $seconds): self
{
$this->validateTimeout($seconds);
$this->timeout = $seconds;
return $this;
} | [
"public",
"function",
"setTimeout",
"(",
"float",
"$",
"seconds",
")",
":",
"self",
"{",
"$",
"this",
"->",
"validateTimeout",
"(",
"$",
"seconds",
")",
";",
"$",
"this",
"->",
"timeout",
"=",
"$",
"seconds",
";",
"return",
"$",
"this",
";",
"}"
] | Set write timeout. Only has effect before we connect.
@see http://php.net/manual/en/function.stream-set-timeout.php | [
"Set",
"write",
"timeout",
".",
"Only",
"has",
"effect",
"before",
"we",
"connect",
"."
] | ebb804e432e8fe0fe96828f30d89c45581d36d07 | https://github.com/Seldaek/monolog/blob/ebb804e432e8fe0fe96828f30d89c45581d36d07/src/Monolog/Handler/SocketHandler.php#L116-L122 |
220,706 | Seldaek/monolog | src/Monolog/Handler/SocketHandler.php | SocketHandler.setWritingTimeout | public function setWritingTimeout(float $seconds): self
{
$this->validateTimeout($seconds);
$this->writingTimeout = $seconds;
return $this;
} | php | public function setWritingTimeout(float $seconds): self
{
$this->validateTimeout($seconds);
$this->writingTimeout = $seconds;
return $this;
} | [
"public",
"function",
"setWritingTimeout",
"(",
"float",
"$",
"seconds",
")",
":",
"self",
"{",
"$",
"this",
"->",
"validateTimeout",
"(",
"$",
"seconds",
")",
";",
"$",
"this",
"->",
"writingTimeout",
"=",
"$",
"seconds",
";",
"return",
"$",
"this",
";"... | Set writing timeout. Only has effect during connection in the writing cycle.
@param float $seconds 0 for no timeout | [
"Set",
"writing",
"timeout",
".",
"Only",
"has",
"effect",
"during",
"connection",
"in",
"the",
"writing",
"cycle",
"."
] | ebb804e432e8fe0fe96828f30d89c45581d36d07 | https://github.com/Seldaek/monolog/blob/ebb804e432e8fe0fe96828f30d89c45581d36d07/src/Monolog/Handler/SocketHandler.php#L129-L135 |
220,707 | CachetHQ/Cachet | app/Http/Controllers/Api/MetricPointController.php | MetricPointController.index | public function index(Metric $metric, MetricPoint $metricPoint)
{
$points = $metric->points()->paginate(Binput::get('per_page', 20));
return $this->paginator($points, Request::instance());
} | php | public function index(Metric $metric, MetricPoint $metricPoint)
{
$points = $metric->points()->paginate(Binput::get('per_page', 20));
return $this->paginator($points, Request::instance());
} | [
"public",
"function",
"index",
"(",
"Metric",
"$",
"metric",
",",
"MetricPoint",
"$",
"metricPoint",
")",
"{",
"$",
"points",
"=",
"$",
"metric",
"->",
"points",
"(",
")",
"->",
"paginate",
"(",
"Binput",
"::",
"get",
"(",
"'per_page'",
",",
"20",
")",... | Get a single metric point.
@param \CachetHQ\Cachet\Models\Metric $metric
@param \CachetHQ\Cachet\Models\MetricPoint $metricPoint
@return \Illuminate\Http\JsonResponse | [
"Get",
"a",
"single",
"metric",
"point",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Api/MetricPointController.php#L34-L39 |
220,708 | CachetHQ/Cachet | app/Http/Controllers/Api/MetricPointController.php | MetricPointController.store | public function store(Metric $metric)
{
try {
$metricPoint = execute(new CreateMetricPointCommand(
$metric,
Binput::get('value'),
Binput::get('timestamp')
));
} catch (QueryException $e) {
throw new BadRequestHttpExc... | php | public function store(Metric $metric)
{
try {
$metricPoint = execute(new CreateMetricPointCommand(
$metric,
Binput::get('value'),
Binput::get('timestamp')
));
} catch (QueryException $e) {
throw new BadRequestHttpExc... | [
"public",
"function",
"store",
"(",
"Metric",
"$",
"metric",
")",
"{",
"try",
"{",
"$",
"metricPoint",
"=",
"execute",
"(",
"new",
"CreateMetricPointCommand",
"(",
"$",
"metric",
",",
"Binput",
"::",
"get",
"(",
"'value'",
")",
",",
"Binput",
"::",
"get"... | Create a new metric point.
@param \CachetHQ\Cachet\Models\Metric $metric
@return \Illuminate\Http\JsonResponse | [
"Create",
"a",
"new",
"metric",
"point",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Api/MetricPointController.php#L48-L61 |
220,709 | CachetHQ/Cachet | app/Http/Controllers/Api/MetricPointController.php | MetricPointController.update | public function update(Metric $metric, MetricPoint $metricPoint)
{
$metricPoint = execute(new UpdateMetricPointCommand(
$metricPoint,
$metric,
Binput::get('value'),
Binput::get('timestamp')
));
return $this->item($metricPoint);
} | php | public function update(Metric $metric, MetricPoint $metricPoint)
{
$metricPoint = execute(new UpdateMetricPointCommand(
$metricPoint,
$metric,
Binput::get('value'),
Binput::get('timestamp')
));
return $this->item($metricPoint);
} | [
"public",
"function",
"update",
"(",
"Metric",
"$",
"metric",
",",
"MetricPoint",
"$",
"metricPoint",
")",
"{",
"$",
"metricPoint",
"=",
"execute",
"(",
"new",
"UpdateMetricPointCommand",
"(",
"$",
"metricPoint",
",",
"$",
"metric",
",",
"Binput",
"::",
"get... | Updates a metric point.
@param \CachetHQ\Cachet\Models\Metric $metric
@param \CachetHQ\Cachet\Models\MetricPoint $metricPoint
@return \Illuminate\Http\JsonResponse | [
"Updates",
"a",
"metric",
"point",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Api/MetricPointController.php#L71-L81 |
220,710 | CachetHQ/Cachet | app/Http/Controllers/Api/MetricPointController.php | MetricPointController.destroy | public function destroy(Metric $metric, MetricPoint $metricPoint)
{
execute(new RemoveMetricPointCommand($metricPoint));
return $this->noContent();
} | php | public function destroy(Metric $metric, MetricPoint $metricPoint)
{
execute(new RemoveMetricPointCommand($metricPoint));
return $this->noContent();
} | [
"public",
"function",
"destroy",
"(",
"Metric",
"$",
"metric",
",",
"MetricPoint",
"$",
"metricPoint",
")",
"{",
"execute",
"(",
"new",
"RemoveMetricPointCommand",
"(",
"$",
"metricPoint",
")",
")",
";",
"return",
"$",
"this",
"->",
"noContent",
"(",
")",
... | Destroys a metric point.
@param \CachetHQ\Cachet\Models\Metric $metric
@param \CachetHQ\Cachet\Models\MetricPoint $metricPoint
@return \Illuminate\Http\JsonResponse | [
"Destroys",
"a",
"metric",
"point",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Api/MetricPointController.php#L91-L96 |
220,711 | CachetHQ/Cachet | app/Bus/Middleware/UseDatabaseTransactions.php | UseDatabaseTransactions.handle | public function handle($command, Closure $next)
{
return DB::transaction(function () use ($command, $next) {
return $next($command);
});
} | php | public function handle($command, Closure $next)
{
return DB::transaction(function () use ($command, $next) {
return $next($command);
});
} | [
"public",
"function",
"handle",
"(",
"$",
"command",
",",
"Closure",
"$",
"next",
")",
"{",
"return",
"DB",
"::",
"transaction",
"(",
"function",
"(",
")",
"use",
"(",
"$",
"command",
",",
"$",
"next",
")",
"{",
"return",
"$",
"next",
"(",
"$",
"co... | Handle the current command in the pipeline.
@param mixed $command
@param \Closure $next
@return bool | [
"Handle",
"the",
"current",
"command",
"in",
"the",
"pipeline",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Bus/Middleware/UseDatabaseTransactions.php#L32-L37 |
220,712 | CachetHQ/Cachet | app/Bus/Handlers/Commands/User/GenerateApiTokenCommandHandler.php | GenerateApiTokenCommandHandler.handle | public function handle(GenerateApiTokenCommand $command)
{
$user = $command->user;
$user->update(['api_key' => User::generateApiKey()]);
event(new UserRegeneratedApiTokenEvent($user));
} | php | public function handle(GenerateApiTokenCommand $command)
{
$user = $command->user;
$user->update(['api_key' => User::generateApiKey()]);
event(new UserRegeneratedApiTokenEvent($user));
} | [
"public",
"function",
"handle",
"(",
"GenerateApiTokenCommand",
"$",
"command",
")",
"{",
"$",
"user",
"=",
"$",
"command",
"->",
"user",
";",
"$",
"user",
"->",
"update",
"(",
"[",
"'api_key'",
"=>",
"User",
"::",
"generateApiKey",
"(",
")",
"]",
")",
... | Handle the generate api key command.
@param \CachetHQ\Cachet\Bus\Commands\User\GenerateApiTokenCommand $command
@return void | [
"Handle",
"the",
"generate",
"api",
"key",
"command",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Bus/Handlers/Commands/User/GenerateApiTokenCommandHandler.php#L27-L34 |
220,713 | CachetHQ/Cachet | app/Http/Controllers/Api/ScheduleController.php | ScheduleController.index | public function index()
{
$schedule = Schedule::query();
if ($sortBy = Binput::get('sort')) {
$direction = Binput::has('order') && Binput::get('order') == 'desc';
$schedule->sort($sortBy, $direction);
}
$schedule = $schedule->paginate(Binput::get('per_page'... | php | public function index()
{
$schedule = Schedule::query();
if ($sortBy = Binput::get('sort')) {
$direction = Binput::has('order') && Binput::get('order') == 'desc';
$schedule->sort($sortBy, $direction);
}
$schedule = $schedule->paginate(Binput::get('per_page'... | [
"public",
"function",
"index",
"(",
")",
"{",
"$",
"schedule",
"=",
"Schedule",
"::",
"query",
"(",
")",
";",
"if",
"(",
"$",
"sortBy",
"=",
"Binput",
"::",
"get",
"(",
"'sort'",
")",
")",
"{",
"$",
"direction",
"=",
"Binput",
"::",
"has",
"(",
"... | Return all schedules.
@return \Illuminate\Http\JsonResponse | [
"Return",
"all",
"schedules",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Api/ScheduleController.php#L35-L48 |
220,714 | CachetHQ/Cachet | app/Http/Controllers/Api/ScheduleController.php | ScheduleController.store | public function store()
{
try {
$schedule = execute(new CreateScheduleCommand(
Binput::get('name'),
Binput::get('message', null, false, false),
Binput::get('status'),
Binput::get('scheduled_at'),
Binput::get('complet... | php | public function store()
{
try {
$schedule = execute(new CreateScheduleCommand(
Binput::get('name'),
Binput::get('message', null, false, false),
Binput::get('status'),
Binput::get('scheduled_at'),
Binput::get('complet... | [
"public",
"function",
"store",
"(",
")",
"{",
"try",
"{",
"$",
"schedule",
"=",
"execute",
"(",
"new",
"CreateScheduleCommand",
"(",
"Binput",
"::",
"get",
"(",
"'name'",
")",
",",
"Binput",
"::",
"get",
"(",
"'message'",
",",
"null",
",",
"false",
","... | Create a new schedule.
@return \Illuminate\Http\JsonResponse | [
"Create",
"a",
"new",
"schedule",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Api/ScheduleController.php#L67-L83 |
220,715 | CachetHQ/Cachet | app/Http/Controllers/Api/ScheduleController.php | ScheduleController.update | public function update(Schedule $schedule)
{
try {
$schedule = execute(new UpdateScheduleCommand(
$schedule,
Binput::get('name'),
Binput::get('message'),
Binput::get('status'),
Binput::get('scheduled_at'),
... | php | public function update(Schedule $schedule)
{
try {
$schedule = execute(new UpdateScheduleCommand(
$schedule,
Binput::get('name'),
Binput::get('message'),
Binput::get('status'),
Binput::get('scheduled_at'),
... | [
"public",
"function",
"update",
"(",
"Schedule",
"$",
"schedule",
")",
"{",
"try",
"{",
"$",
"schedule",
"=",
"execute",
"(",
"new",
"UpdateScheduleCommand",
"(",
"$",
"schedule",
",",
"Binput",
"::",
"get",
"(",
"'name'",
")",
",",
"Binput",
"::",
"get"... | Update a schedule.
@param \CachetHQ\Cachet\Models\Schedule $schedule
@return \Illuminate\Http\JsonResponse | [
"Update",
"a",
"schedule",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Api/ScheduleController.php#L92-L109 |
220,716 | CachetHQ/Cachet | app/Http/Controllers/Api/ScheduleController.php | ScheduleController.destroy | public function destroy(Schedule $schedule)
{
try {
execute(new DeleteScheduleCommand($schedule));
} catch (QueryException $e) {
throw new BadRequestHttpException();
}
return $this->noContent();
} | php | public function destroy(Schedule $schedule)
{
try {
execute(new DeleteScheduleCommand($schedule));
} catch (QueryException $e) {
throw new BadRequestHttpException();
}
return $this->noContent();
} | [
"public",
"function",
"destroy",
"(",
"Schedule",
"$",
"schedule",
")",
"{",
"try",
"{",
"execute",
"(",
"new",
"DeleteScheduleCommand",
"(",
"$",
"schedule",
")",
")",
";",
"}",
"catch",
"(",
"QueryException",
"$",
"e",
")",
"{",
"throw",
"new",
"BadReq... | Delete a schedule.
@param \CachetHQ\Cachet\Models\Schedule $schedule
@return \Illuminate\Http\JsonResponse | [
"Delete",
"a",
"schedule",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Api/ScheduleController.php#L118-L127 |
220,717 | CachetHQ/Cachet | app/Bus/Handlers/Commands/Metric/UpdateMetricPointCommandHandler.php | UpdateMetricPointCommandHandler.handle | public function handle(UpdateMetricPointCommand $command)
{
$point = $command->point;
$metric = $command->metric;
$createdAt = $command->created_at;
$data = [
'metric_id' => $metric->id,
'value' => (float) $command->value,
];
if ($created... | php | public function handle(UpdateMetricPointCommand $command)
{
$point = $command->point;
$metric = $command->metric;
$createdAt = $command->created_at;
$data = [
'metric_id' => $metric->id,
'value' => (float) $command->value,
];
if ($created... | [
"public",
"function",
"handle",
"(",
"UpdateMetricPointCommand",
"$",
"command",
")",
"{",
"$",
"point",
"=",
"$",
"command",
"->",
"point",
";",
"$",
"metric",
"=",
"$",
"command",
"->",
"metric",
";",
"$",
"createdAt",
"=",
"$",
"command",
"->",
"creat... | Handle the update metric point command.
@param \CachetHQ\Cachet\Bus\Commands\Metric\UpdateMetricPointCommand $command
@return \CachetHQ\Cachet\Models\MetricPoint | [
"Handle",
"the",
"update",
"metric",
"point",
"command",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Bus/Handlers/Commands/Metric/UpdateMetricPointCommandHandler.php#L56-L76 |
220,718 | CachetHQ/Cachet | app/Bus/Handlers/Commands/User/InviteUserCommandHandler.php | InviteUserCommandHandler.handle | public function handle(InviteUserCommand $command)
{
foreach ($command->emails as $email) {
$invite = Invite::create([
'email' => $email,
]);
$invite->notify(new InviteUserNotification());
event(new UserWasInvitedEvent($invite));
}
... | php | public function handle(InviteUserCommand $command)
{
foreach ($command->emails as $email) {
$invite = Invite::create([
'email' => $email,
]);
$invite->notify(new InviteUserNotification());
event(new UserWasInvitedEvent($invite));
}
... | [
"public",
"function",
"handle",
"(",
"InviteUserCommand",
"$",
"command",
")",
"{",
"foreach",
"(",
"$",
"command",
"->",
"emails",
"as",
"$",
"email",
")",
"{",
"$",
"invite",
"=",
"Invite",
"::",
"create",
"(",
"[",
"'email'",
"=>",
"$",
"email",
","... | Handle the invite team member command.
@param \CachetHQ\Cachet\Bus\Commands\User\InviteUserCommand $command
@return void | [
"Handle",
"the",
"invite",
"team",
"member",
"command",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Bus/Handlers/Commands/User/InviteUserCommandHandler.php#L33-L44 |
220,719 | CachetHQ/Cachet | app/Subscribers/CommandSubscriber.php | CommandSubscriber.fireInstallingCommand | public function fireInstallingCommand(Command $command)
{
$this->handleMainCommand($command);
event(new SystemWasInstalledEvent());
$command->info('System was installed!');
} | php | public function fireInstallingCommand(Command $command)
{
$this->handleMainCommand($command);
event(new SystemWasInstalledEvent());
$command->info('System was installed!');
} | [
"public",
"function",
"fireInstallingCommand",
"(",
"Command",
"$",
"command",
")",
"{",
"$",
"this",
"->",
"handleMainCommand",
"(",
"$",
"command",
")",
";",
"event",
"(",
"new",
"SystemWasInstalledEvent",
"(",
")",
")",
";",
"$",
"command",
"->",
"info",
... | Fire the installing command.
@param \Illuminate\Console\Command $command
@return void | [
"Fire",
"the",
"installing",
"command",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Subscribers/CommandSubscriber.php#L78-L85 |
220,720 | CachetHQ/Cachet | app/Subscribers/CommandSubscriber.php | CommandSubscriber.fireUpdatingCommand | public function fireUpdatingCommand(Command $command)
{
$this->handleMainCommand($command);
event(new SystemWasUpdatedEvent());
$command->info('System was updated!');
} | php | public function fireUpdatingCommand(Command $command)
{
$this->handleMainCommand($command);
event(new SystemWasUpdatedEvent());
$command->info('System was updated!');
} | [
"public",
"function",
"fireUpdatingCommand",
"(",
"Command",
"$",
"command",
")",
"{",
"$",
"this",
"->",
"handleMainCommand",
"(",
"$",
"command",
")",
";",
"event",
"(",
"new",
"SystemWasUpdatedEvent",
"(",
")",
")",
";",
"$",
"command",
"->",
"info",
"(... | Fire the updating command.
@param \Illuminate\Console\Command $command
@return void | [
"Fire",
"the",
"updating",
"command",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Subscribers/CommandSubscriber.php#L94-L101 |
220,721 | CachetHQ/Cachet | app/Subscribers/CommandSubscriber.php | CommandSubscriber.fireResettingCommand | public function fireResettingCommand(Command $command)
{
$this->handleMainCommand($command);
event(new SystemWasResetEvent());
$command->info('System was reset!');
} | php | public function fireResettingCommand(Command $command)
{
$this->handleMainCommand($command);
event(new SystemWasResetEvent());
$command->info('System was reset!');
} | [
"public",
"function",
"fireResettingCommand",
"(",
"Command",
"$",
"command",
")",
"{",
"$",
"this",
"->",
"handleMainCommand",
"(",
"$",
"command",
")",
";",
"event",
"(",
"new",
"SystemWasResetEvent",
"(",
")",
")",
";",
"$",
"command",
"->",
"info",
"("... | Fire the resetting command.
@param \Illuminate\Console\Command $command
@return void | [
"Fire",
"the",
"resetting",
"command",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Subscribers/CommandSubscriber.php#L110-L117 |
220,722 | CachetHQ/Cachet | app/Subscribers/CommandSubscriber.php | CommandSubscriber.handleMainCommand | protected function handleMainCommand(Command $command)
{
$command->line('Clearing settings cache...');
$this->cache->clear();
$command->line('Settings cache cleared!');
} | php | protected function handleMainCommand(Command $command)
{
$command->line('Clearing settings cache...');
$this->cache->clear();
$command->line('Settings cache cleared!');
} | [
"protected",
"function",
"handleMainCommand",
"(",
"Command",
"$",
"command",
")",
"{",
"$",
"command",
"->",
"line",
"(",
"'Clearing settings cache...'",
")",
";",
"$",
"this",
"->",
"cache",
"->",
"clear",
"(",
")",
";",
"$",
"command",
"->",
"line",
"("... | Handle the main bulk of the command, clear the settings.
@param \Illuminate\Console\Command $command
@return void | [
"Handle",
"the",
"main",
"bulk",
"of",
"the",
"command",
"clear",
"the",
"settings",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Subscribers/CommandSubscriber.php#L126-L133 |
220,723 | CachetHQ/Cachet | app/Bus/Handlers/Commands/Component/UpdateComponentCommandHandler.php | UpdateComponentCommandHandler.handle | public function handle(UpdateComponentCommand $command)
{
$component = $command->component;
$originalStatus = $component->status;
if ($command->status && (int) $originalStatus !== (int) $command->status) {
event(new ComponentStatusWasChangedEvent($this->auth->user(), $component,... | php | public function handle(UpdateComponentCommand $command)
{
$component = $command->component;
$originalStatus = $component->status;
if ($command->status && (int) $originalStatus !== (int) $command->status) {
event(new ComponentStatusWasChangedEvent($this->auth->user(), $component,... | [
"public",
"function",
"handle",
"(",
"UpdateComponentCommand",
"$",
"command",
")",
"{",
"$",
"component",
"=",
"$",
"command",
"->",
"component",
";",
"$",
"originalStatus",
"=",
"$",
"component",
"->",
"status",
";",
"if",
"(",
"$",
"command",
"->",
"sta... | Handle the update component command.
@param \CachetHQ\Cachet\Bus\Commands\Component\UpdateComponentCommand $command
@return \CachetHQ\Cachet\Models\Component | [
"Handle",
"the",
"update",
"component",
"command",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Bus/Handlers/Commands/Component/UpdateComponentCommandHandler.php#L48-L62 |
220,724 | CachetHQ/Cachet | app/Models/Incident.php | Incident.getIsResolvedAttribute | public function getIsResolvedAttribute()
{
if ($updates = $this->updates->first()) {
return (int) $updates->status === self::FIXED;
}
return (int) $this->status === self::FIXED;
} | php | public function getIsResolvedAttribute()
{
if ($updates = $this->updates->first()) {
return (int) $updates->status === self::FIXED;
}
return (int) $this->status === self::FIXED;
} | [
"public",
"function",
"getIsResolvedAttribute",
"(",
")",
"{",
"if",
"(",
"$",
"updates",
"=",
"$",
"this",
"->",
"updates",
"->",
"first",
"(",
")",
")",
"{",
"return",
"(",
"int",
")",
"$",
"updates",
"->",
"status",
"===",
"self",
"::",
"FIXED",
"... | Is the incident resolved?
@return bool | [
"Is",
"the",
"incident",
"resolved?"
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Models/Incident.php#L239-L246 |
220,725 | CachetHQ/Cachet | app/Bus/Handlers/Commands/Incident/UpdateIncidentCommandHandler.php | UpdateIncidentCommandHandler.handle | public function handle(UpdateIncidentCommand $command)
{
if ($template = IncidentTemplate::where('slug', '=', $command->template)->first()) {
$command->message = $this->parseTemplate($template, $command);
}
$incident = $command->incident;
$incident->fill($this->filter($c... | php | public function handle(UpdateIncidentCommand $command)
{
if ($template = IncidentTemplate::where('slug', '=', $command->template)->first()) {
$command->message = $this->parseTemplate($template, $command);
}
$incident = $command->incident;
$incident->fill($this->filter($c... | [
"public",
"function",
"handle",
"(",
"UpdateIncidentCommand",
"$",
"command",
")",
"{",
"if",
"(",
"$",
"template",
"=",
"IncidentTemplate",
"::",
"where",
"(",
"'slug'",
",",
"'='",
",",
"$",
"command",
"->",
"template",
")",
"->",
"first",
"(",
")",
")... | Handle the update incident command.
@param \CachetHQ\Cachet\Bus\Commands\Incident\UpdateIncidentCommand $command
@return \CachetHQ\Cachet\Models\Incident | [
"Handle",
"the",
"update",
"incident",
"command",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Bus/Handlers/Commands/Incident/UpdateIncidentCommandHandler.php#L71-L116 |
220,726 | CachetHQ/Cachet | app/Bus/Handlers/Commands/Incident/UpdateIncidentCommandHandler.php | UpdateIncidentCommandHandler.parseTemplate | protected function parseTemplate(IncidentTemplate $template, UpdateIncidentCommand $command)
{
$env = new Twig_Environment(new Twig_Loader_Array([]));
$template = $env->createTemplate($template->template);
$vars = array_merge($command->template_vars, [
'incident' => [
... | php | protected function parseTemplate(IncidentTemplate $template, UpdateIncidentCommand $command)
{
$env = new Twig_Environment(new Twig_Loader_Array([]));
$template = $env->createTemplate($template->template);
$vars = array_merge($command->template_vars, [
'incident' => [
... | [
"protected",
"function",
"parseTemplate",
"(",
"IncidentTemplate",
"$",
"template",
",",
"UpdateIncidentCommand",
"$",
"command",
")",
"{",
"$",
"env",
"=",
"new",
"Twig_Environment",
"(",
"new",
"Twig_Loader_Array",
"(",
"[",
"]",
")",
")",
";",
"$",
"templat... | Compiles an incident template into an incident message.
@param \CachetHQ\Cachet\Models\IncidentTemplate $template
@param \CachetHQ\Cachet\Bus\Commands\Incident\UpdateIncidentCommand $command
@return string | [
"Compiles",
"an",
"incident",
"template",
"into",
"an",
"incident",
"message",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Bus/Handlers/Commands/Incident/UpdateIncidentCommandHandler.php#L151-L171 |
220,727 | CachetHQ/Cachet | app/Models/Schedule.php | Schedule.scopeInProgress | public function scopeInProgress(Builder $query)
{
return $query->where('scheduled_at', '<=', Carbon::now())->where('status', '<>', self::COMPLETE)->where(function ($query) {
$query->whereNull('completed_at')->orWhere('completed_at', '>', Carbon::now());
});
} | php | public function scopeInProgress(Builder $query)
{
return $query->where('scheduled_at', '<=', Carbon::now())->where('status', '<>', self::COMPLETE)->where(function ($query) {
$query->whereNull('completed_at')->orWhere('completed_at', '>', Carbon::now());
});
} | [
"public",
"function",
"scopeInProgress",
"(",
"Builder",
"$",
"query",
")",
"{",
"return",
"$",
"query",
"->",
"where",
"(",
"'scheduled_at'",
",",
"'<='",
",",
"Carbon",
"::",
"now",
"(",
")",
")",
"->",
"where",
"(",
"'status'",
",",
"'<>'",
",",
"se... | Scope schedules that are in progress.
@param \Illuminate\Database\Eloquent\Builder $query
@return \Illuminate\Database\Eloquent\Builder | [
"Scope",
"schedules",
"that",
"are",
"in",
"progress",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Models/Schedule.php#L158-L163 |
220,728 | CachetHQ/Cachet | app/Models/Schedule.php | Schedule.scopeFutureSchedules | public function scopeFutureSchedules($query)
{
return $query->whereIn('status', [self::UPCOMING, self::IN_PROGRESS])->where('scheduled_at', '>=', Carbon::now());
} | php | public function scopeFutureSchedules($query)
{
return $query->whereIn('status', [self::UPCOMING, self::IN_PROGRESS])->where('scheduled_at', '>=', Carbon::now());
} | [
"public",
"function",
"scopeFutureSchedules",
"(",
"$",
"query",
")",
"{",
"return",
"$",
"query",
"->",
"whereIn",
"(",
"'status'",
",",
"[",
"self",
"::",
"UPCOMING",
",",
"self",
"::",
"IN_PROGRESS",
"]",
")",
"->",
"where",
"(",
"'scheduled_at'",
",",
... | Scopes schedules to those in the future.
@param \Illuminate\Database\Eloquent\Builder $query
@return \Illuminate\Database\Eloquent\Builder | [
"Scopes",
"schedules",
"to",
"those",
"in",
"the",
"future",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Models/Schedule.php#L172-L175 |
220,729 | CachetHQ/Cachet | app/Bus/Handlers/Commands/Metric/RemoveMetricCommandHandler.php | RemoveMetricCommandHandler.handle | public function handle(RemoveMetricCommand $command)
{
$metric = $command->metric;
event(new MetricWasRemovedEvent($this->auth->user(), $metric));
$metric->delete();
} | php | public function handle(RemoveMetricCommand $command)
{
$metric = $command->metric;
event(new MetricWasRemovedEvent($this->auth->user(), $metric));
$metric->delete();
} | [
"public",
"function",
"handle",
"(",
"RemoveMetricCommand",
"$",
"command",
")",
"{",
"$",
"metric",
"=",
"$",
"command",
"->",
"metric",
";",
"event",
"(",
"new",
"MetricWasRemovedEvent",
"(",
"$",
"this",
"->",
"auth",
"->",
"user",
"(",
")",
",",
"$",... | Handle the remove metric command.
@param \CachetHQ\Cachet\Bus\Commands\Metric\RemoveMetricCommand $command
@return void | [
"Handle",
"the",
"remove",
"metric",
"command",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Bus/Handlers/Commands/Metric/RemoveMetricCommandHandler.php#L47-L54 |
220,730 | CachetHQ/Cachet | app/Bus/Handlers/Commands/User/SignupUserCommandHandler.php | SignupUserCommandHandler.handle | public function handle(SignupUserCommand $command)
{
$user = User::create([
'username' => $command->username,
'password' => $command->password,
'email' => $command->email,
'level' => User::LEVEL_USER,
]);
event(new UserWasCreatedEvent($u... | php | public function handle(SignupUserCommand $command)
{
$user = User::create([
'username' => $command->username,
'password' => $command->password,
'email' => $command->email,
'level' => User::LEVEL_USER,
]);
event(new UserWasCreatedEvent($u... | [
"public",
"function",
"handle",
"(",
"SignupUserCommand",
"$",
"command",
")",
"{",
"$",
"user",
"=",
"User",
"::",
"create",
"(",
"[",
"'username'",
"=>",
"$",
"command",
"->",
"username",
",",
"'password'",
"=>",
"$",
"command",
"->",
"password",
",",
... | Handle the signup user command.
@param \CachetHQ\Cachet\Bus\Commands\User\SignupUserCommand $command
@return \CachetHQ\Cachet\Models\User | [
"Handle",
"the",
"signup",
"user",
"command",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Bus/Handlers/Commands/User/SignupUserCommandHandler.php#L27-L39 |
220,731 | CachetHQ/Cachet | app/Presenters/UserPresenter.php | UserPresenter.avatar | public function avatar()
{
if (Config::get('setting.enable_external_dependencies')) {
return sprintf('https://www.gravatar.com/avatar/%s?size=%d', md5(strtolower($this->email)), 200);
}
return Avatar::create($this->username)->toBase64();
} | php | public function avatar()
{
if (Config::get('setting.enable_external_dependencies')) {
return sprintf('https://www.gravatar.com/avatar/%s?size=%d', md5(strtolower($this->email)), 200);
}
return Avatar::create($this->username)->toBase64();
} | [
"public",
"function",
"avatar",
"(",
")",
"{",
"if",
"(",
"Config",
"::",
"get",
"(",
"'setting.enable_external_dependencies'",
")",
")",
"{",
"return",
"sprintf",
"(",
"'https://www.gravatar.com/avatar/%s?size=%d'",
",",
"md5",
"(",
"strtolower",
"(",
"$",
"this"... | Returns the users avatar.
@return string | [
"Returns",
"the",
"users",
"avatar",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Presenters/UserPresenter.php#L31-L38 |
220,732 | CachetHQ/Cachet | app/Bus/Handlers/Commands/User/WelcomeUserCommandHandler.php | WelcomeUserCommandHandler.handle | public function handle(WelcomeUserCommand $command)
{
$command->user->update(['welcomed' => true]);
event(new UserWasWelcomedEvent($command->user));
} | php | public function handle(WelcomeUserCommand $command)
{
$command->user->update(['welcomed' => true]);
event(new UserWasWelcomedEvent($command->user));
} | [
"public",
"function",
"handle",
"(",
"WelcomeUserCommand",
"$",
"command",
")",
"{",
"$",
"command",
"->",
"user",
"->",
"update",
"(",
"[",
"'welcomed'",
"=>",
"true",
"]",
")",
";",
"event",
"(",
"new",
"UserWasWelcomedEvent",
"(",
"$",
"command",
"->",
... | Handle the welcome user command.
@param \CachetHQ\Cachet\Bus\Commands\User\WelcomeUserCommand $command
@return void | [
"Handle",
"the",
"welcome",
"user",
"command",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Bus/Handlers/Commands/User/WelcomeUserCommandHandler.php#L31-L36 |
220,733 | CachetHQ/Cachet | app/Http/Controllers/Dashboard/IncidentUpdateController.php | IncidentUpdateController.showCreateIncidentUpdateAction | public function showCreateIncidentUpdateAction(Incident $incident)
{
return View::make('dashboard.incidents.updates.add')
->withIncident($incident)
->withNotificationsEnabled($this->system->canNotifySubscribers());
} | php | public function showCreateIncidentUpdateAction(Incident $incident)
{
return View::make('dashboard.incidents.updates.add')
->withIncident($incident)
->withNotificationsEnabled($this->system->canNotifySubscribers());
} | [
"public",
"function",
"showCreateIncidentUpdateAction",
"(",
"Incident",
"$",
"incident",
")",
"{",
"return",
"View",
"::",
"make",
"(",
"'dashboard.incidents.updates.add'",
")",
"->",
"withIncident",
"(",
"$",
"incident",
")",
"->",
"withNotificationsEnabled",
"(",
... | Shows the incident update form.
@param \CachetHQ\Cachet\Models\Incident $incident
@return \Illuminate\View\View | [
"Shows",
"the",
"incident",
"update",
"form",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/IncidentUpdateController.php#L87-L92 |
220,734 | CachetHQ/Cachet | app/Http/Controllers/Dashboard/IncidentUpdateController.php | IncidentUpdateController.createIncidentUpdateAction | public function createIncidentUpdateAction(Incident $incident)
{
try {
$incidentUpdate = execute(new CreateIncidentUpdateCommand(
$incident,
Binput::get('status'),
Binput::get('message'),
Binput::get('component_id'),
... | php | public function createIncidentUpdateAction(Incident $incident)
{
try {
$incidentUpdate = execute(new CreateIncidentUpdateCommand(
$incident,
Binput::get('status'),
Binput::get('message'),
Binput::get('component_id'),
... | [
"public",
"function",
"createIncidentUpdateAction",
"(",
"Incident",
"$",
"incident",
")",
"{",
"try",
"{",
"$",
"incidentUpdate",
"=",
"execute",
"(",
"new",
"CreateIncidentUpdateCommand",
"(",
"$",
"incident",
",",
"Binput",
"::",
"get",
"(",
"'status'",
")",
... | Creates a new incident update.
@param \CachetHQ\Cachet\Models\Incident $incident
@return \Illuminate\Http\RedirectResponse | [
"Creates",
"a",
"new",
"incident",
"update",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/IncidentUpdateController.php#L101-L125 |
220,735 | CachetHQ/Cachet | app/Http/Controllers/Dashboard/IncidentUpdateController.php | IncidentUpdateController.editIncidentUpdateAction | public function editIncidentUpdateAction(Incident $incident, IncidentUpdate $incidentUpdate)
{
try {
$incidentUpdate = execute(new UpdateIncidentUpdateCommand(
$incidentUpdate,
Binput::get('status'),
Binput::get('message'),
$this->a... | php | public function editIncidentUpdateAction(Incident $incident, IncidentUpdate $incidentUpdate)
{
try {
$incidentUpdate = execute(new UpdateIncidentUpdateCommand(
$incidentUpdate,
Binput::get('status'),
Binput::get('message'),
$this->a... | [
"public",
"function",
"editIncidentUpdateAction",
"(",
"Incident",
"$",
"incident",
",",
"IncidentUpdate",
"$",
"incidentUpdate",
")",
"{",
"try",
"{",
"$",
"incidentUpdate",
"=",
"execute",
"(",
"new",
"UpdateIncidentUpdateCommand",
"(",
"$",
"incidentUpdate",
",",... | Edit an incident update.
@param \CachetHQ\Cachet\Models\Incident $incident
@param \CachetHQ\Cachet\Models\IncidentUpdate $incidentUpdate
@return \Illuminate\Http\RedirectResponse | [
"Edit",
"an",
"incident",
"update",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/IncidentUpdateController.php#L151-L169 |
220,736 | CachetHQ/Cachet | app/Bus/Handlers/Commands/Schedule/CreateScheduleCommandHandler.php | CreateScheduleCommandHandler.handle | public function handle(CreateScheduleCommand $command)
{
try {
$schedule = Schedule::create($this->filter($command));
event(new ScheduleWasCreatedEvent($this->auth->user(), $schedule));
} catch (InvalidArgumentException $e) {
throw new ValidationException(new Mes... | php | public function handle(CreateScheduleCommand $command)
{
try {
$schedule = Schedule::create($this->filter($command));
event(new ScheduleWasCreatedEvent($this->auth->user(), $schedule));
} catch (InvalidArgumentException $e) {
throw new ValidationException(new Mes... | [
"public",
"function",
"handle",
"(",
"CreateScheduleCommand",
"$",
"command",
")",
"{",
"try",
"{",
"$",
"schedule",
"=",
"Schedule",
"::",
"create",
"(",
"$",
"this",
"->",
"filter",
"(",
"$",
"command",
")",
")",
";",
"event",
"(",
"new",
"ScheduleWasC... | Handle the create schedule command.
@param \CachetHQ\Cachet\Bus\Commands\Schedule\CreateScheduleCommand $command
@return \CachetHQ\Cachet\Models\Schedule | [
"Handle",
"the",
"create",
"schedule",
"command",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Bus/Handlers/Commands/Schedule/CreateScheduleCommandHandler.php#L65-L76 |
220,737 | CachetHQ/Cachet | app/Models/Traits/HasTags.php | HasTags.convertToTags | protected static function convertToTags($values)
{
return collect($values)->map(function ($value) {
if ($value instanceof Tag) {
return $value;
}
return Tag::where('slug', '=', $value)->first();
});
} | php | protected static function convertToTags($values)
{
return collect($values)->map(function ($value) {
if ($value instanceof Tag) {
return $value;
}
return Tag::where('slug', '=', $value)->first();
});
} | [
"protected",
"static",
"function",
"convertToTags",
"(",
"$",
"values",
")",
"{",
"return",
"collect",
"(",
"$",
"values",
")",
"->",
"map",
"(",
"function",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"instanceof",
"Tag",
")",
"{",
"return",... | Convert a list of tags into a collection of \CachetHQ\Cachet\Models\Tag.
@param array|\ArrayAccess $values
@return \Illuminate\Support\Collection | [
"Convert",
"a",
"list",
"of",
"tags",
"into",
"a",
"collection",
"of",
"\\",
"CachetHQ",
"\\",
"Cachet",
"\\",
"Models",
"\\",
"Tag",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Models/Traits/HasTags.php#L77-L86 |
220,738 | CachetHQ/Cachet | app/Integrations/Core/System.php | System.getStatus | public function getStatus()
{
$includePrivate = $this->auth->check();
$totalComponents = Component::enabled()->authenticated($includePrivate)->count();
$majorOutages = Component::enabled()->authenticated($includePrivate)->status(4)->count();
$majorOutageRate = (int) $this->config->g... | php | public function getStatus()
{
$includePrivate = $this->auth->check();
$totalComponents = Component::enabled()->authenticated($includePrivate)->count();
$majorOutages = Component::enabled()->authenticated($includePrivate)->status(4)->count();
$majorOutageRate = (int) $this->config->g... | [
"public",
"function",
"getStatus",
"(",
")",
"{",
"$",
"includePrivate",
"=",
"$",
"this",
"->",
"auth",
"->",
"check",
"(",
")",
";",
"$",
"totalComponents",
"=",
"Component",
"::",
"enabled",
"(",
")",
"->",
"authenticated",
"(",
"$",
"includePrivate",
... | Get the entire system status.
@return array | [
"Get",
"the",
"entire",
"system",
"status",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Integrations/Core/System.php#L61-L105 |
220,739 | CachetHQ/Cachet | app/Integrations/Core/System.php | System.canNotifySubscribers | public function canNotifySubscribers()
{
$maintenancePeriods = Schedule::inProgress()->count();
if ($maintenancePeriods === 0) {
return true;
}
return !$this->config->get('setting.suppress_notifications_in_maintenance');
} | php | public function canNotifySubscribers()
{
$maintenancePeriods = Schedule::inProgress()->count();
if ($maintenancePeriods === 0) {
return true;
}
return !$this->config->get('setting.suppress_notifications_in_maintenance');
} | [
"public",
"function",
"canNotifySubscribers",
"(",
")",
"{",
"$",
"maintenancePeriods",
"=",
"Schedule",
"::",
"inProgress",
"(",
")",
"->",
"count",
"(",
")",
";",
"if",
"(",
"$",
"maintenancePeriods",
"===",
"0",
")",
"{",
"return",
"true",
";",
"}",
"... | Determine if Cachet is allowed to send notifications to users, subscribers or third party tools.
@return bool | [
"Determine",
"if",
"Cachet",
"is",
"allowed",
"to",
"send",
"notifications",
"to",
"users",
"subscribers",
"or",
"third",
"party",
"tools",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Integrations/Core/System.php#L112-L120 |
220,740 | CachetHQ/Cachet | app/Composers/TimezoneLocaleComposer.php | TimezoneLocaleComposer.compose | public function compose(View $view)
{
$enabledLangs = $this->config->get('langs');
$langs = array_map(function ($lang) use ($enabledLangs) {
$locale = basename($lang);
return [$locale => Arr::get($enabledLangs, $locale, [
'name' => $locale,
... | php | public function compose(View $view)
{
$enabledLangs = $this->config->get('langs');
$langs = array_map(function ($lang) use ($enabledLangs) {
$locale = basename($lang);
return [$locale => Arr::get($enabledLangs, $locale, [
'name' => $locale,
... | [
"public",
"function",
"compose",
"(",
"View",
"$",
"view",
")",
"{",
"$",
"enabledLangs",
"=",
"$",
"this",
"->",
"config",
"->",
"get",
"(",
"'langs'",
")",
";",
"$",
"langs",
"=",
"array_map",
"(",
"function",
"(",
"$",
"lang",
")",
"use",
"(",
"... | Timezones and Locales composer.
@param \Illuminate\Contracts\View\View $view
@return void | [
"Timezones",
"and",
"Locales",
"composer",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Composers/TimezoneLocaleComposer.php#L55-L106 |
220,741 | CachetHQ/Cachet | app/Bus/Handlers/Commands/ComponentGroup/UpdateComponentGroupCommandHandler.php | UpdateComponentGroupCommandHandler.handle | public function handle(UpdateComponentGroupCommand $command)
{
$group = $command->group;
$group->update($this->filter($command));
event(new ComponentGroupWasUpdatedEvent($this->auth->user(), $group));
return $group;
} | php | public function handle(UpdateComponentGroupCommand $command)
{
$group = $command->group;
$group->update($this->filter($command));
event(new ComponentGroupWasUpdatedEvent($this->auth->user(), $group));
return $group;
} | [
"public",
"function",
"handle",
"(",
"UpdateComponentGroupCommand",
"$",
"command",
")",
"{",
"$",
"group",
"=",
"$",
"command",
"->",
"group",
";",
"$",
"group",
"->",
"update",
"(",
"$",
"this",
"->",
"filter",
"(",
"$",
"command",
")",
")",
";",
"ev... | Handle the update component group command.
@param \CachetHQ\Cachet\Bus\Commands\ComponentGroup\UpdateComponentGroupCommand $command
@return \CachetHQ\Cachet\Models\ComponentGroup | [
"Handle",
"the",
"update",
"component",
"group",
"command",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Bus/Handlers/Commands/ComponentGroup/UpdateComponentGroupCommandHandler.php#L46-L54 |
220,742 | CachetHQ/Cachet | app/Foundation/Providers/RepositoryServiceProvider.php | RepositoryServiceProvider.registerMetricRepository | protected function registerMetricRepository()
{
$this->app->singleton(MetricRepository::class, function (Container $app) {
$config = $app->make(ConfigRepository::class);
switch ($config->get('database.default')) {
case 'mysql': $repository = new MySqlRepository($conf... | php | protected function registerMetricRepository()
{
$this->app->singleton(MetricRepository::class, function (Container $app) {
$config = $app->make(ConfigRepository::class);
switch ($config->get('database.default')) {
case 'mysql': $repository = new MySqlRepository($conf... | [
"protected",
"function",
"registerMetricRepository",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"singleton",
"(",
"MetricRepository",
"::",
"class",
",",
"function",
"(",
"Container",
"$",
"app",
")",
"{",
"$",
"config",
"=",
"$",
"app",
"->",
"make",
... | Register the metric repository.
@return void | [
"Register",
"the",
"metric",
"repository",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Foundation/Providers/RepositoryServiceProvider.php#L45-L60 |
220,743 | CachetHQ/Cachet | app/Http/Routes/Dashboard/IncidentRoutes.php | IncidentRoutes.map | public function map(Registrar $router)
{
$router->group([
'middleware' => ['auth'],
'namespace' => 'Dashboard',
'prefix' => 'dashboard/incidents',
], function (Registrar $router) {
$router->get('/', [
'as' => 'get:dashboard.incid... | php | public function map(Registrar $router)
{
$router->group([
'middleware' => ['auth'],
'namespace' => 'Dashboard',
'prefix' => 'dashboard/incidents',
], function (Registrar $router) {
$router->get('/', [
'as' => 'get:dashboard.incid... | [
"public",
"function",
"map",
"(",
"Registrar",
"$",
"router",
")",
"{",
"$",
"router",
"->",
"group",
"(",
"[",
"'middleware'",
"=>",
"[",
"'auth'",
"]",
",",
"'namespace'",
"=>",
"'Dashboard'",
",",
"'prefix'",
"=>",
"'dashboard/incidents'",
",",
"]",
","... | Define the dashboard incident routes.
@param \Illuminate\Contracts\Routing\Registrar $router
@return void | [
"Define",
"the",
"dashboard",
"incident",
"routes",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Routes/Dashboard/IncidentRoutes.php#L38-L93 |
220,744 | CachetHQ/Cachet | app/Http/Controllers/Api/ComponentGroupController.php | ComponentGroupController.index | public function index()
{
$groups = ComponentGroup::query();
if (!$this->guard->check()) {
$groups = ComponentGroup::visible();
}
$groups->search(Binput::except(['sort', 'order', 'per_page']));
if ($sortBy = Binput::get('sort')) {
$direction = Binput... | php | public function index()
{
$groups = ComponentGroup::query();
if (!$this->guard->check()) {
$groups = ComponentGroup::visible();
}
$groups->search(Binput::except(['sort', 'order', 'per_page']));
if ($sortBy = Binput::get('sort')) {
$direction = Binput... | [
"public",
"function",
"index",
"(",
")",
"{",
"$",
"groups",
"=",
"ComponentGroup",
"::",
"query",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"guard",
"->",
"check",
"(",
")",
")",
"{",
"$",
"groups",
"=",
"ComponentGroup",
"::",
"visible",
... | Get all groups.
@return \Illuminate\Http\JsonResponse | [
"Get",
"all",
"groups",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Api/ComponentGroupController.php#L55-L73 |
220,745 | CachetHQ/Cachet | app/Http/Controllers/Api/ComponentGroupController.php | ComponentGroupController.store | public function store()
{
try {
$group = execute(new CreateComponentGroupCommand(
Binput::get('name'),
Binput::get('order', 0),
Binput::get('collapsed', 0),
Binput::get('visible', ComponentGroup::VISIBLE_AUTHENTICATED)
)... | php | public function store()
{
try {
$group = execute(new CreateComponentGroupCommand(
Binput::get('name'),
Binput::get('order', 0),
Binput::get('collapsed', 0),
Binput::get('visible', ComponentGroup::VISIBLE_AUTHENTICATED)
)... | [
"public",
"function",
"store",
"(",
")",
"{",
"try",
"{",
"$",
"group",
"=",
"execute",
"(",
"new",
"CreateComponentGroupCommand",
"(",
"Binput",
"::",
"get",
"(",
"'name'",
")",
",",
"Binput",
"::",
"get",
"(",
"'order'",
",",
"0",
")",
",",
"Binput",... | Create a new component group.
@return \Illuminate\Http\JsonResponse | [
"Create",
"a",
"new",
"component",
"group",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Api/ComponentGroupController.php#L92-L106 |
220,746 | CachetHQ/Cachet | app/Http/Controllers/Api/ComponentGroupController.php | ComponentGroupController.update | public function update(ComponentGroup $group)
{
try {
$group = execute(new UpdateComponentGroupCommand(
$group,
Binput::get('name'),
Binput::get('order'),
Binput::get('collapsed'),
Binput::get('visible')
... | php | public function update(ComponentGroup $group)
{
try {
$group = execute(new UpdateComponentGroupCommand(
$group,
Binput::get('name'),
Binput::get('order'),
Binput::get('collapsed'),
Binput::get('visible')
... | [
"public",
"function",
"update",
"(",
"ComponentGroup",
"$",
"group",
")",
"{",
"try",
"{",
"$",
"group",
"=",
"execute",
"(",
"new",
"UpdateComponentGroupCommand",
"(",
"$",
"group",
",",
"Binput",
"::",
"get",
"(",
"'name'",
")",
",",
"Binput",
"::",
"g... | Update an existing group.
@param \CachetHQ\Cachet\Models\ComponentGroup $group
@return \Illuminate\Http\JsonResponse | [
"Update",
"an",
"existing",
"group",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Api/ComponentGroupController.php#L115-L130 |
220,747 | CachetHQ/Cachet | app/Repositories/Metric/AbstractMetricRepository.php | AbstractMetricRepository.getQueryType | protected function getQueryType(Metric $metric)
{
if (!isset($metric->calc_type) || $metric->calc_type == Metric::CALC_SUM) {
return "sum({$this->getMetricPointsTable()}.value * {$this->getMetricPointsTable()}.counter) AS value";
} elseif ($metric->calc_type == Metric::CALC_AVG) {
... | php | protected function getQueryType(Metric $metric)
{
if (!isset($metric->calc_type) || $metric->calc_type == Metric::CALC_SUM) {
return "sum({$this->getMetricPointsTable()}.value * {$this->getMetricPointsTable()}.counter) AS value";
} elseif ($metric->calc_type == Metric::CALC_AVG) {
... | [
"protected",
"function",
"getQueryType",
"(",
"Metric",
"$",
"metric",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"metric",
"->",
"calc_type",
")",
"||",
"$",
"metric",
"->",
"calc_type",
"==",
"Metric",
"::",
"CALC_SUM",
")",
"{",
"return",
"\"sum({$t... | Return the query type.
@param \CachetHQ\Cachet\Models\Metric $metric
@return string | [
"Return",
"the",
"query",
"type",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Repositories/Metric/AbstractMetricRepository.php#L83-L92 |
220,748 | CachetHQ/Cachet | app/Repositories/Metric/AbstractMetricRepository.php | AbstractMetricRepository.mapResults | protected function mapResults(Metric $metric, array $results)
{
$results = Collection::make($results);
return $results->map(function ($point) use ($metric) {
if (!$point->value) {
$point->value = $metric->default_value;
}
if ($point->value === 0 ... | php | protected function mapResults(Metric $metric, array $results)
{
$results = Collection::make($results);
return $results->map(function ($point) use ($metric) {
if (!$point->value) {
$point->value = $metric->default_value;
}
if ($point->value === 0 ... | [
"protected",
"function",
"mapResults",
"(",
"Metric",
"$",
"metric",
",",
"array",
"$",
"results",
")",
"{",
"$",
"results",
"=",
"Collection",
"::",
"make",
"(",
"$",
"results",
")",
";",
"return",
"$",
"results",
"->",
"map",
"(",
"function",
"(",
"$... | Map the result set.
@param \CachetHQ\Cachet\Models\Metric $metric
@param array $results
@return \Illuminate\Support\Collection | [
"Map",
"the",
"result",
"set",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Repositories/Metric/AbstractMetricRepository.php#L102-L119 |
220,749 | CachetHQ/Cachet | app/Http/Controllers/SubscribeController.php | SubscribeController.postSubscribe | public function postSubscribe()
{
$email = Binput::get('email');
$subscriptions = Binput::get('subscriptions');
$verified = app(Repository::class)->get('setting.skip_subscriber_verification');
try {
$subscription = execute(new SubscribeSubscriberCommand($email, $verified... | php | public function postSubscribe()
{
$email = Binput::get('email');
$subscriptions = Binput::get('subscriptions');
$verified = app(Repository::class)->get('setting.skip_subscriber_verification');
try {
$subscription = execute(new SubscribeSubscriberCommand($email, $verified... | [
"public",
"function",
"postSubscribe",
"(",
")",
"{",
"$",
"email",
"=",
"Binput",
"::",
"get",
"(",
"'email'",
")",
";",
"$",
"subscriptions",
"=",
"Binput",
"::",
"get",
"(",
"'subscriptions'",
")",
";",
"$",
"verified",
"=",
"app",
"(",
"Repository",
... | Handle the subscribe user.
@return \Illuminate\View\View | [
"Handle",
"the",
"subscribe",
"user",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/SubscribeController.php#L76-L97 |
220,750 | CachetHQ/Cachet | app/Http/Controllers/SubscribeController.php | SubscribeController.getVerify | public function getVerify($code = null)
{
if ($code === null) {
throw new NotFoundHttpException();
}
$subscriber = Subscriber::where('verify_code', '=', $code)->first();
if (!$subscriber) {
throw new BadRequestHttpException();
}
if (!$subscr... | php | public function getVerify($code = null)
{
if ($code === null) {
throw new NotFoundHttpException();
}
$subscriber = Subscriber::where('verify_code', '=', $code)->first();
if (!$subscriber) {
throw new BadRequestHttpException();
}
if (!$subscr... | [
"public",
"function",
"getVerify",
"(",
"$",
"code",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"code",
"===",
"null",
")",
"{",
"throw",
"new",
"NotFoundHttpException",
"(",
")",
";",
"}",
"$",
"subscriber",
"=",
"Subscriber",
"::",
"where",
"(",
"'verify... | Handle the verify subscriber email.
@param string|null $code
@return \Illuminate\View\View | [
"Handle",
"the",
"verify",
"subscriber",
"email",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/SubscribeController.php#L106-L124 |
220,751 | CachetHQ/Cachet | app/Http/Controllers/SubscribeController.php | SubscribeController.getUnsubscribe | public function getUnsubscribe($code = null, $subscription = null)
{
if ($code === null) {
throw new NotFoundHttpException();
}
$subscriber = Subscriber::where('verify_code', '=', $code)->first();
if (!$subscriber || !$subscriber->is_verified) {
throw new Ba... | php | public function getUnsubscribe($code = null, $subscription = null)
{
if ($code === null) {
throw new NotFoundHttpException();
}
$subscriber = Subscriber::where('verify_code', '=', $code)->first();
if (!$subscriber || !$subscriber->is_verified) {
throw new Ba... | [
"public",
"function",
"getUnsubscribe",
"(",
"$",
"code",
"=",
"null",
",",
"$",
"subscription",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"code",
"===",
"null",
")",
"{",
"throw",
"new",
"NotFoundHttpException",
"(",
")",
";",
"}",
"$",
"subscriber",
"="... | Handle the unsubscribe.
@param string|null $code
@param int|null $subscription
@return \Illuminate\View\View | [
"Handle",
"the",
"unsubscribe",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/SubscribeController.php#L134-L154 |
220,752 | CachetHQ/Cachet | app/Http/Controllers/SubscribeController.php | SubscribeController.showManage | public function showManage($code = null)
{
if ($code === null) {
throw new NotFoundHttpException();
}
$includePrivate = $this->auth->check();
$subscriber = Subscriber::where('verify_code', '=', $code)->first();
$usedComponentGroups = Component::enabled()->authen... | php | public function showManage($code = null)
{
if ($code === null) {
throw new NotFoundHttpException();
}
$includePrivate = $this->auth->check();
$subscriber = Subscriber::where('verify_code', '=', $code)->first();
$usedComponentGroups = Component::enabled()->authen... | [
"public",
"function",
"showManage",
"(",
"$",
"code",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"code",
"===",
"null",
")",
"{",
"throw",
"new",
"NotFoundHttpException",
"(",
")",
";",
"}",
"$",
"includePrivate",
"=",
"$",
"this",
"->",
"auth",
"->",
"c... | Shows the subscription manager page.
@param string|null $code
@return \Illuminate\View\View | [
"Shows",
"the",
"subscription",
"manager",
"page",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/SubscribeController.php#L163-L185 |
220,753 | CachetHQ/Cachet | app/Http/Controllers/SubscribeController.php | SubscribeController.postManage | public function postManage($code = null)
{
if ($code === null) {
throw new NotFoundHttpException();
}
$subscriber = Subscriber::where('verify_code', '=', $code)->first();
if (!$subscriber) {
throw new BadRequestHttpException();
}
try {
... | php | public function postManage($code = null)
{
if ($code === null) {
throw new NotFoundHttpException();
}
$subscriber = Subscriber::where('verify_code', '=', $code)->first();
if (!$subscriber) {
throw new BadRequestHttpException();
}
try {
... | [
"public",
"function",
"postManage",
"(",
"$",
"code",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"code",
"===",
"null",
")",
"{",
"throw",
"new",
"NotFoundHttpException",
"(",
")",
";",
"}",
"$",
"subscriber",
"=",
"Subscriber",
"::",
"where",
"(",
"'verif... | Updates the subscription manager for a subscriber.
@param string|null $code
@return \Illuminate\View\View | [
"Updates",
"the",
"subscription",
"manager",
"for",
"a",
"subscriber",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/SubscribeController.php#L194-L217 |
220,754 | CachetHQ/Cachet | app/Bus/Handlers/Commands/User/CreateUserCommandHandler.php | CreateUserCommandHandler.handle | public function handle(CreateUserCommand $command)
{
$user = User::create([
'username' => $command->username,
'password' => $command->password,
'email' => $command->email,
'level' => $command->level,
]);
event(new UserWasCreatedEvent($us... | php | public function handle(CreateUserCommand $command)
{
$user = User::create([
'username' => $command->username,
'password' => $command->password,
'email' => $command->email,
'level' => $command->level,
]);
event(new UserWasCreatedEvent($us... | [
"public",
"function",
"handle",
"(",
"CreateUserCommand",
"$",
"command",
")",
"{",
"$",
"user",
"=",
"User",
"::",
"create",
"(",
"[",
"'username'",
"=>",
"$",
"command",
"->",
"username",
",",
"'password'",
"=>",
"$",
"command",
"->",
"password",
",",
... | Handle the add user command.
@param \CachetHQ\Cachet\Bus\Commands\User\CreateUserCommand $command
@return \CachetHQ\Cachet\Models\User | [
"Handle",
"the",
"add",
"user",
"command",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Bus/Handlers/Commands/User/CreateUserCommandHandler.php#L32-L44 |
220,755 | CachetHQ/Cachet | app/Bus/Handlers/Commands/Schedule/UpdateScheduleCommandHandler.php | UpdateScheduleCommandHandler.handle | public function handle(UpdateScheduleCommand $command)
{
$schedule = $command->schedule;
$schedule->update($this->filter($command));
event(new ScheduleWasUpdatedEvent($this->auth->user(), $schedule));
return $schedule;
} | php | public function handle(UpdateScheduleCommand $command)
{
$schedule = $command->schedule;
$schedule->update($this->filter($command));
event(new ScheduleWasUpdatedEvent($this->auth->user(), $schedule));
return $schedule;
} | [
"public",
"function",
"handle",
"(",
"UpdateScheduleCommand",
"$",
"command",
")",
"{",
"$",
"schedule",
"=",
"$",
"command",
"->",
"schedule",
";",
"$",
"schedule",
"->",
"update",
"(",
"$",
"this",
"->",
"filter",
"(",
"$",
"command",
")",
")",
";",
... | Handle the update schedule command.
@param \CachetHQ\Cachet\Bus\Commands\Schedule\UpdateScheduleCommand $command
@return \CachetHQ\Cachet\Models\Schedule | [
"Handle",
"the",
"update",
"schedule",
"command",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Bus/Handlers/Commands/Schedule/UpdateScheduleCommandHandler.php#L62-L71 |
220,756 | CachetHQ/Cachet | app/Presenters/SchedulePresenter.php | SchedulePresenter.completed_at_datetimepicker | public function completed_at_datetimepicker()
{
if ($this->wrappedObject->completed_at) {
return $this->dates->make($this->wrappedObject->completed_at)->format('Y-m-d H:i');
}
} | php | public function completed_at_datetimepicker()
{
if ($this->wrappedObject->completed_at) {
return $this->dates->make($this->wrappedObject->completed_at)->format('Y-m-d H:i');
}
} | [
"public",
"function",
"completed_at_datetimepicker",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"wrappedObject",
"->",
"completed_at",
")",
"{",
"return",
"$",
"this",
"->",
"dates",
"->",
"make",
"(",
"$",
"this",
"->",
"wrappedObject",
"->",
"completed_a... | Formats the completed_at time ready to be used by bootstrap-datetimepicker.
@return string|void | [
"Formats",
"the",
"completed_at",
"time",
"ready",
"to",
"be",
"used",
"by",
"bootstrap",
"-",
"datetimepicker",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Presenters/SchedulePresenter.php#L209-L214 |
220,757 | CachetHQ/Cachet | app/Bus/Handlers/Commands/Component/CreateComponentCommandHandler.php | CreateComponentCommandHandler.handle | public function handle(CreateComponentCommand $command)
{
$component = Component::create($this->filter($command));
event(new ComponentWasCreatedEvent($this->auth->user(), $component));
return $component;
} | php | public function handle(CreateComponentCommand $command)
{
$component = Component::create($this->filter($command));
event(new ComponentWasCreatedEvent($this->auth->user(), $component));
return $component;
} | [
"public",
"function",
"handle",
"(",
"CreateComponentCommand",
"$",
"command",
")",
"{",
"$",
"component",
"=",
"Component",
"::",
"create",
"(",
"$",
"this",
"->",
"filter",
"(",
"$",
"command",
")",
")",
";",
"event",
"(",
"new",
"ComponentWasCreatedEvent"... | Handle the add component command.
@param \CachetHQ\Cachet\Bus\Commands\Component\CreateComponentCommand $command
@return \CachetHQ\Cachet\Models\Component | [
"Handle",
"the",
"add",
"component",
"command",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Bus/Handlers/Commands/Component/CreateComponentCommandHandler.php#L52-L59 |
220,758 | CachetHQ/Cachet | app/Integrations/Core/Beacon.php | Beacon.send | public function send()
{
// We don't want any accidental sending of beacons if the installation has explicitly said no.
if (!$this->enabled()) {
return;
}
$setting = app(Setting::class);
if (!$installId = $setting->get('install_id', null)) {
$install... | php | public function send()
{
// We don't want any accidental sending of beacons if the installation has explicitly said no.
if (!$this->enabled()) {
return;
}
$setting = app(Setting::class);
if (!$installId = $setting->get('install_id', null)) {
$install... | [
"public",
"function",
"send",
"(",
")",
"{",
"// We don't want any accidental sending of beacons if the installation has explicitly said no.",
"if",
"(",
"!",
"$",
"this",
"->",
"enabled",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"setting",
"=",
"app",
"(",
"S... | Send a beacon to our server.
@return void | [
"Send",
"a",
"beacon",
"to",
"our",
"server",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Integrations/Core/Beacon.php#L78-L122 |
220,759 | CachetHQ/Cachet | app/Console/Commands/InstallCommand.php | InstallCommand.configureEnvironmentFile | protected function configureEnvironmentFile()
{
$dir = app()->environmentPath();
$file = app()->environmentFile();
$path = "{$dir}/{$file}";
if (file_exists($path)) {
$this->line('Environment file already exists. Moving on.');
return;
}
copy... | php | protected function configureEnvironmentFile()
{
$dir = app()->environmentPath();
$file = app()->environmentFile();
$path = "{$dir}/{$file}";
if (file_exists($path)) {
$this->line('Environment file already exists. Moving on.');
return;
}
copy... | [
"protected",
"function",
"configureEnvironmentFile",
"(",
")",
"{",
"$",
"dir",
"=",
"app",
"(",
")",
"->",
"environmentPath",
"(",
")",
";",
"$",
"file",
"=",
"app",
"(",
")",
"->",
"environmentFile",
"(",
")",
";",
"$",
"path",
"=",
"\"{$dir}/{$file}\"... | Copy the environment file.
@return void | [
"Copy",
"the",
"environment",
"file",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Console/Commands/InstallCommand.php#L100-L113 |
220,760 | CachetHQ/Cachet | app/Console/Commands/InstallCommand.php | InstallCommand.configureDatabase | protected function configureDatabase(array $default = [])
{
$config = array_merge([
'DB_DRIVER' => null,
'DB_HOST' => null,
'DB_DATABASE' => null,
'DB_USERNAME' => null,
'DB_PASSWORD' => null,
'DB_PORT' => null,
'D... | php | protected function configureDatabase(array $default = [])
{
$config = array_merge([
'DB_DRIVER' => null,
'DB_HOST' => null,
'DB_DATABASE' => null,
'DB_USERNAME' => null,
'DB_PASSWORD' => null,
'DB_PORT' => null,
'D... | [
"protected",
"function",
"configureDatabase",
"(",
"array",
"$",
"default",
"=",
"[",
"]",
")",
"{",
"$",
"config",
"=",
"array_merge",
"(",
"[",
"'DB_DRIVER'",
"=>",
"null",
",",
"'DB_HOST'",
"=>",
"null",
",",
"'DB_DATABASE'",
"=>",
"null",
",",
"'DB_USE... | Configure the database.
@param array $default
@return void | [
"Configure",
"the",
"database",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Console/Commands/InstallCommand.php#L132-L184 |
220,761 | CachetHQ/Cachet | app/Console/Commands/InstallCommand.php | InstallCommand.configureDrivers | protected function configureDrivers(array $default = [])
{
$config = array_merge([
'CACHE_DRIVER' => null,
'SESSION_DRIVER' => null,
'QUEUE_DRIVER' => null,
], $default);
// Format the settings ready to display them in the table.
$this->format... | php | protected function configureDrivers(array $default = [])
{
$config = array_merge([
'CACHE_DRIVER' => null,
'SESSION_DRIVER' => null,
'QUEUE_DRIVER' => null,
], $default);
// Format the settings ready to display them in the table.
$this->format... | [
"protected",
"function",
"configureDrivers",
"(",
"array",
"$",
"default",
"=",
"[",
"]",
")",
"{",
"$",
"config",
"=",
"array_merge",
"(",
"[",
"'CACHE_DRIVER'",
"=>",
"null",
",",
"'SESSION_DRIVER'",
"=>",
"null",
",",
"'QUEUE_DRIVER'",
"=>",
"null",
",",
... | Configure other drivers.
@param array $default
@return void | [
"Configure",
"other",
"drivers",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Console/Commands/InstallCommand.php#L193-L256 |
220,762 | CachetHQ/Cachet | app/Console/Commands/InstallCommand.php | InstallCommand.configureMail | protected function configureMail(array $config = [])
{
$config = array_merge([
'MAIL_DRIVER' => null,
'MAIL_HOST' => null,
'MAIL_PORT' => null,
'MAIL_USERNAME' => null,
'MAIL_PASSWORD' => null,
'MAIL_ADDRESS' => n... | php | protected function configureMail(array $config = [])
{
$config = array_merge([
'MAIL_DRIVER' => null,
'MAIL_HOST' => null,
'MAIL_PORT' => null,
'MAIL_USERNAME' => null,
'MAIL_PASSWORD' => null,
'MAIL_ADDRESS' => n... | [
"protected",
"function",
"configureMail",
"(",
"array",
"$",
"config",
"=",
"[",
"]",
")",
"{",
"$",
"config",
"=",
"array_merge",
"(",
"[",
"'MAIL_DRIVER'",
"=>",
"null",
",",
"'MAIL_HOST'",
"=>",
"null",
",",
"'MAIL_PORT'",
"=>",
"null",
",",
"'MAIL_USER... | Configure mail.
@param array $config
@return void | [
"Configure",
"mail",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Console/Commands/InstallCommand.php#L265-L314 |
220,763 | CachetHQ/Cachet | app/Console/Commands/InstallCommand.php | InstallCommand.configureCachet | protected function configureCachet(array $config = [])
{
$config = [];
if ($this->confirm('Do you wish to use Cachet Beacon?')) {
$config['CACHET_BEACON'] = 'true';
}
if ($this->confirm('Do you wish to use Emoji? This requires a GitHub oAuth Token!')) {
$conf... | php | protected function configureCachet(array $config = [])
{
$config = [];
if ($this->confirm('Do you wish to use Cachet Beacon?')) {
$config['CACHET_BEACON'] = 'true';
}
if ($this->confirm('Do you wish to use Emoji? This requires a GitHub oAuth Token!')) {
$conf... | [
"protected",
"function",
"configureCachet",
"(",
"array",
"$",
"config",
"=",
"[",
"]",
")",
"{",
"$",
"config",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"this",
"->",
"confirm",
"(",
"'Do you wish to use Cachet Beacon?'",
")",
")",
"{",
"$",
"config",
"[",
... | Configure Cachet.
@param array $config
@return void | [
"Configure",
"Cachet",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Console/Commands/InstallCommand.php#L323-L338 |
220,764 | CachetHQ/Cachet | app/Console/Commands/InstallCommand.php | InstallCommand.configureUser | protected function configureUser()
{
if (!$this->confirm('Do you want to create an admin user?')) {
return;
}
// We need to refresh the config to get access to the newly connected database.
$this->getFreshConfiguration();
// Now we need to install the applicatio... | php | protected function configureUser()
{
if (!$this->confirm('Do you want to create an admin user?')) {
return;
}
// We need to refresh the config to get access to the newly connected database.
$this->getFreshConfiguration();
// Now we need to install the applicatio... | [
"protected",
"function",
"configureUser",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"confirm",
"(",
"'Do you want to create an admin user?'",
")",
")",
"{",
"return",
";",
"}",
"// We need to refresh the config to get access to the newly connected database.",
"$",... | Configure the first user.
@return void | [
"Configure",
"the",
"first",
"user",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Console/Commands/InstallCommand.php#L345-L365 |
220,765 | CachetHQ/Cachet | app/Console/Commands/InstallCommand.php | InstallCommand.configureRedis | protected function configureRedis()
{
$config = [
'REDIS_HOST' => null,
'REDIS_DATABASE' => null,
'REDIS_PORT' => null,
];
$config['REDIS_HOST'] = $this->ask('What is the host of your redis server?');
$config['REDIS_DATABASE'] = $this->ask... | php | protected function configureRedis()
{
$config = [
'REDIS_HOST' => null,
'REDIS_DATABASE' => null,
'REDIS_PORT' => null,
];
$config['REDIS_HOST'] = $this->ask('What is the host of your redis server?');
$config['REDIS_DATABASE'] = $this->ask... | [
"protected",
"function",
"configureRedis",
"(",
")",
"{",
"$",
"config",
"=",
"[",
"'REDIS_HOST'",
"=>",
"null",
",",
"'REDIS_DATABASE'",
"=>",
"null",
",",
"'REDIS_PORT'",
"=>",
"null",
",",
"]",
";",
"$",
"config",
"[",
"'REDIS_HOST'",
"]",
"=",
"$",
"... | Configure the redis connection.
@return void | [
"Configure",
"the",
"redis",
"connection",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Console/Commands/InstallCommand.php#L372-L387 |
220,766 | CachetHQ/Cachet | app/Console/Commands/InstallCommand.php | InstallCommand.formatConfigsTable | protected function formatConfigsTable(array $config)
{
$configRows = [];
foreach ($config as $setting => $value) {
$configRows[] = compact('setting', 'value');
}
$this->table(['Setting', 'Value'], $configRows);
} | php | protected function formatConfigsTable(array $config)
{
$configRows = [];
foreach ($config as $setting => $value) {
$configRows[] = compact('setting', 'value');
}
$this->table(['Setting', 'Value'], $configRows);
} | [
"protected",
"function",
"formatConfigsTable",
"(",
"array",
"$",
"config",
")",
"{",
"$",
"configRows",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"config",
"as",
"$",
"setting",
"=>",
"$",
"value",
")",
"{",
"$",
"configRows",
"[",
"]",
"=",
"compact",... | Format the configs into a pretty table that we can easily read.
@param array $config
@return void | [
"Format",
"the",
"configs",
"into",
"a",
"pretty",
"table",
"that",
"we",
"can",
"easily",
"read",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Console/Commands/InstallCommand.php#L396-L405 |
220,767 | CachetHQ/Cachet | app/Http/Controllers/Dashboard/TeamController.php | TeamController.showTeamView | public function showTeamView()
{
$team = User::all();
return View::make('dashboard.team.index')
->withPageTitle(trans('dashboard.team.team').' - '.trans('dashboard.dashboard'))
->withTeamMembers($team);
} | php | public function showTeamView()
{
$team = User::all();
return View::make('dashboard.team.index')
->withPageTitle(trans('dashboard.team.team').' - '.trans('dashboard.dashboard'))
->withTeamMembers($team);
} | [
"public",
"function",
"showTeamView",
"(",
")",
"{",
"$",
"team",
"=",
"User",
"::",
"all",
"(",
")",
";",
"return",
"View",
"::",
"make",
"(",
"'dashboard.team.index'",
")",
"->",
"withPageTitle",
"(",
"trans",
"(",
"'dashboard.team.team'",
")",
".",
"' -... | Shows the team members view.
@return \Illuminate\View\View | [
"Shows",
"the",
"team",
"members",
"view",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/TeamController.php#L30-L37 |
220,768 | CachetHQ/Cachet | app/Http/Controllers/Dashboard/TeamController.php | TeamController.showTeamMemberView | public function showTeamMemberView(User $user)
{
return View::make('dashboard.team.edit')
->withPageTitle(trans('dashboard.team.edit.title').' - '.trans('dashboard.dashboard'))
->withUser($user);
} | php | public function showTeamMemberView(User $user)
{
return View::make('dashboard.team.edit')
->withPageTitle(trans('dashboard.team.edit.title').' - '.trans('dashboard.dashboard'))
->withUser($user);
} | [
"public",
"function",
"showTeamMemberView",
"(",
"User",
"$",
"user",
")",
"{",
"return",
"View",
"::",
"make",
"(",
"'dashboard.team.edit'",
")",
"->",
"withPageTitle",
"(",
"trans",
"(",
"'dashboard.team.edit.title'",
")",
".",
"' - '",
".",
"trans",
"(",
"'... | Shows the edit team member view.
@param \CachetHQ\Cachet\Models\User $user
@return \Illuminate\View\View | [
"Shows",
"the",
"edit",
"team",
"member",
"view",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/TeamController.php#L46-L51 |
220,769 | CachetHQ/Cachet | app/Http/Controllers/Api/AbstractApiController.php | AbstractApiController.paginator | protected function paginator(Paginator $paginator, Request $request)
{
foreach ($request->query as $key => $value) {
if ($key != 'page') {
$paginator->appends($key, $value);
}
}
$pagination = [
'pagination' => [
'total' ... | php | protected function paginator(Paginator $paginator, Request $request)
{
foreach ($request->query as $key => $value) {
if ($key != 'page') {
$paginator->appends($key, $value);
}
}
$pagination = [
'pagination' => [
'total' ... | [
"protected",
"function",
"paginator",
"(",
"Paginator",
"$",
"paginator",
",",
"Request",
"$",
"request",
")",
"{",
"foreach",
"(",
"$",
"request",
"->",
"query",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"key",
"!=",
"'page'",
... | Respond with a pagination response.
@param \Illuminate\Pagination\Paginator $paginator
@param \Illuminate\Http\Request $request
@return \Illuminate\Http\JsonResponse | [
"Respond",
"with",
"a",
"pagination",
"response",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Api/AbstractApiController.php#L140-L165 |
220,770 | CachetHQ/Cachet | app/Http/Controllers/Api/AbstractApiController.php | AbstractApiController.respond | protected function respond()
{
$response = [];
if (!empty($this->meta)) {
$response['meta'] = $this->meta;
}
$response['data'] = $this->data;
if ($this->data instanceof Arrayable) {
$response['data'] = $this->data->toArray();
}
retu... | php | protected function respond()
{
$response = [];
if (!empty($this->meta)) {
$response['meta'] = $this->meta;
}
$response['data'] = $this->data;
if ($this->data instanceof Arrayable) {
$response['data'] = $this->data->toArray();
}
retu... | [
"protected",
"function",
"respond",
"(",
")",
"{",
"$",
"response",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"meta",
")",
")",
"{",
"$",
"response",
"[",
"'meta'",
"]",
"=",
"$",
"this",
"->",
"meta",
";",
"}",
"$",
... | Build the response.
@return \Illuminate\Http\Response | [
"Build",
"the",
"response",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Api/AbstractApiController.php#L182-L197 |
220,771 | CachetHQ/Cachet | app/Services/Dates/DateFactory.php | DateFactory.getTimezone | public function getTimezone()
{
$dateTime = new Date();
$dateTime->setTimeZone(new DateTimeZone($this->cachetTimezone));
return $dateTime->format('T');
} | php | public function getTimezone()
{
$dateTime = new Date();
$dateTime->setTimeZone(new DateTimeZone($this->cachetTimezone));
return $dateTime->format('T');
} | [
"public",
"function",
"getTimezone",
"(",
")",
"{",
"$",
"dateTime",
"=",
"new",
"Date",
"(",
")",
";",
"$",
"dateTime",
"->",
"setTimeZone",
"(",
"new",
"DateTimeZone",
"(",
"$",
"this",
"->",
"cachetTimezone",
")",
")",
";",
"return",
"$",
"dateTime",
... | Return the abbreviated timezone.
@return string | [
"Return",
"the",
"abbreviated",
"timezone",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Services/Dates/DateFactory.php#L104-L110 |
220,772 | CachetHQ/Cachet | app/Composers/AppComposer.php | AppComposer.compose | public function compose(View $view)
{
$view->withAboutApp(Markdown::convertToHtml($this->config->get('setting.app_about')));
$view->withAppAnalytics($this->config->get('setting.app_analytics'));
$view->withAppAnalyticsGoSquared($this->config->get('setting.app_analytics_gs'));
$view->... | php | public function compose(View $view)
{
$view->withAboutApp(Markdown::convertToHtml($this->config->get('setting.app_about')));
$view->withAppAnalytics($this->config->get('setting.app_analytics'));
$view->withAppAnalyticsGoSquared($this->config->get('setting.app_analytics_gs'));
$view->... | [
"public",
"function",
"compose",
"(",
"View",
"$",
"view",
")",
"{",
"$",
"view",
"->",
"withAboutApp",
"(",
"Markdown",
"::",
"convertToHtml",
"(",
"$",
"this",
"->",
"config",
"->",
"get",
"(",
"'setting.app_about'",
")",
")",
")",
";",
"$",
"view",
... | Index page view composer.
@param \Illuminate\Contracts\View\View $view
@return void | [
"Index",
"page",
"view",
"composer",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Composers/AppComposer.php#L62-L91 |
220,773 | CachetHQ/Cachet | app/Http/Controllers/Api/IncidentUpdateController.php | IncidentUpdateController.index | public function index(Incident $incident)
{
$updates = $incident->updates()->orderBy('created_at', 'desc');
if ($sortBy = Binput::get('sort')) {
$direction = Binput::has('order') && Binput::get('order') == 'desc';
$updates->sort($sortBy, $direction);
}
$upd... | php | public function index(Incident $incident)
{
$updates = $incident->updates()->orderBy('created_at', 'desc');
if ($sortBy = Binput::get('sort')) {
$direction = Binput::has('order') && Binput::get('order') == 'desc';
$updates->sort($sortBy, $direction);
}
$upd... | [
"public",
"function",
"index",
"(",
"Incident",
"$",
"incident",
")",
"{",
"$",
"updates",
"=",
"$",
"incident",
"->",
"updates",
"(",
")",
"->",
"orderBy",
"(",
"'created_at'",
",",
"'desc'",
")",
";",
"if",
"(",
"$",
"sortBy",
"=",
"Binput",
"::",
... | Return all updates on the incident.
@param \CachetHQ\Cachet\Models\Incident $incident
@return \Illuminate\Http\JsonResponse | [
"Return",
"all",
"updates",
"on",
"the",
"incident",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Api/IncidentUpdateController.php#L39-L52 |
220,774 | CachetHQ/Cachet | app/Http/Controllers/Api/IncidentUpdateController.php | IncidentUpdateController.update | public function update(Incident $incident, IncidentUpdate $update)
{
try {
$update = execute(new UpdateIncidentUpdateCommand(
$update,
Binput::get('status'),
Binput::get('message'),
Auth::user()
));
} catch (Quer... | php | public function update(Incident $incident, IncidentUpdate $update)
{
try {
$update = execute(new UpdateIncidentUpdateCommand(
$update,
Binput::get('status'),
Binput::get('message'),
Auth::user()
));
} catch (Quer... | [
"public",
"function",
"update",
"(",
"Incident",
"$",
"incident",
",",
"IncidentUpdate",
"$",
"update",
")",
"{",
"try",
"{",
"$",
"update",
"=",
"execute",
"(",
"new",
"UpdateIncidentUpdateCommand",
"(",
"$",
"update",
",",
"Binput",
"::",
"get",
"(",
"'s... | Update an incident update.
@param \CachetHQ\Cachet\Models\Incident $incident
@param \CachetHQ\Cachet\Models\IncidentUpdate $update
@return \Illuminate\Http\JsonResponse | [
"Update",
"an",
"incident",
"update",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Api/IncidentUpdateController.php#L100-L114 |
220,775 | CachetHQ/Cachet | app/Http/Controllers/Api/IncidentTemplateController.php | IncidentTemplateController.index | public function index()
{
$templates = IncidentTemplate::query();
if ($sortBy = Binput::get('sort')) {
$direction = Binput::has('order') && Binput::get('order') == 'desc';
$templates->sort($sortBy, $direction);
}
$templates = $templates->paginate(Binput::ge... | php | public function index()
{
$templates = IncidentTemplate::query();
if ($sortBy = Binput::get('sort')) {
$direction = Binput::has('order') && Binput::get('order') == 'desc';
$templates->sort($sortBy, $direction);
}
$templates = $templates->paginate(Binput::ge... | [
"public",
"function",
"index",
"(",
")",
"{",
"$",
"templates",
"=",
"IncidentTemplate",
"::",
"query",
"(",
")",
";",
"if",
"(",
"$",
"sortBy",
"=",
"Binput",
"::",
"get",
"(",
"'sort'",
")",
")",
"{",
"$",
"direction",
"=",
"Binput",
"::",
"has",
... | Get all incident templates.
@return \Illuminate\Http\JsonResponse | [
"Get",
"all",
"incident",
"templates",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Api/IncidentTemplateController.php#L25-L38 |
220,776 | CachetHQ/Cachet | app/Models/Subscription.php | Subscription.scopeIsVerifiedForComponent | public function scopeIsVerifiedForComponent(Builder $query, $component_id)
{
return $query->select('subscriptions.*')
->join('subscribers', 'subscriptions.subscriber_id', '=', 'subscribers.id')
->where(function ($query) {
$query->where('subscriptions.component_id', '=... | php | public function scopeIsVerifiedForComponent(Builder $query, $component_id)
{
return $query->select('subscriptions.*')
->join('subscribers', 'subscriptions.subscriber_id', '=', 'subscribers.id')
->where(function ($query) {
$query->where('subscriptions.component_id', '=... | [
"public",
"function",
"scopeIsVerifiedForComponent",
"(",
"Builder",
"$",
"query",
",",
"$",
"component_id",
")",
"{",
"return",
"$",
"query",
"->",
"select",
"(",
"'subscriptions.*'",
")",
"->",
"join",
"(",
"'subscribers'",
",",
"'subscriptions.subscriber_id'",
... | Finds all verified subscriptions for a component.
@param \Illuminate\Database\Eloquent\Builder $query
@param int $component_id
@return \Illuminate\Database\Eloquent\Builder | [
"Finds",
"all",
"verified",
"subscriptions",
"for",
"a",
"component",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Models/Subscription.php#L106-L115 |
220,777 | CachetHQ/Cachet | app/Foundation/Providers/RouteServiceProvider.php | RouteServiceProvider.bind | public function bind(Router $router)
{
$router->model('component', 'CachetHQ\Cachet\Models\Component');
$router->model('component_group', 'CachetHQ\Cachet\Models\ComponentGroup');
$router->model('incident', 'CachetHQ\Cachet\Models\Incident');
$router->model('incident_template', 'Cach... | php | public function bind(Router $router)
{
$router->model('component', 'CachetHQ\Cachet\Models\Component');
$router->model('component_group', 'CachetHQ\Cachet\Models\ComponentGroup');
$router->model('incident', 'CachetHQ\Cachet\Models\Incident');
$router->model('incident_template', 'Cach... | [
"public",
"function",
"bind",
"(",
"Router",
"$",
"router",
")",
"{",
"$",
"router",
"->",
"model",
"(",
"'component'",
",",
"'CachetHQ\\Cachet\\Models\\Component'",
")",
";",
"$",
"router",
"->",
"model",
"(",
"'component_group'",
",",
"'CachetHQ\\Cachet\\Models\... | Define the bindings for the application.
@param \Illuminate\Routing\Router $router
@return void | [
"Define",
"the",
"bindings",
"for",
"the",
"application",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Foundation/Providers/RouteServiceProvider.php#L83-L98 |
220,778 | CachetHQ/Cachet | app/Foundation/Providers/RouteServiceProvider.php | RouteServiceProvider.mapForBrowser | protected function mapForBrowser(Router $router, $routes, $applyAlwaysAuthenticate)
{
$middleware = [
EncryptCookies::class,
AddQueuedCookiesToResponse::class,
StartSession::class,
ShareErrorsFromSession::class,
VerifyCsrfToken::class,
... | php | protected function mapForBrowser(Router $router, $routes, $applyAlwaysAuthenticate)
{
$middleware = [
EncryptCookies::class,
AddQueuedCookiesToResponse::class,
StartSession::class,
ShareErrorsFromSession::class,
VerifyCsrfToken::class,
... | [
"protected",
"function",
"mapForBrowser",
"(",
"Router",
"$",
"router",
",",
"$",
"routes",
",",
"$",
"applyAlwaysAuthenticate",
")",
"{",
"$",
"middleware",
"=",
"[",
"EncryptCookies",
"::",
"class",
",",
"AddQueuedCookiesToResponse",
"::",
"class",
",",
"Start... | Wrap the routes in the browser specific middleware.
@param \Illuminate\Routing\Router $router
@param object $routes
@param bool $applyAlwaysAuthenticate
@return void | [
"Wrap",
"the",
"routes",
"in",
"the",
"browser",
"specific",
"middleware",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Foundation/Providers/RouteServiceProvider.php#L141-L159 |
220,779 | CachetHQ/Cachet | app/Foundation/Providers/RouteServiceProvider.php | RouteServiceProvider.mapOtherwise | protected function mapOtherwise(Router $router, $routes, $applyAlwaysAuthenticate)
{
$middleware = [
SubstituteBindings::class,
Acceptable::class,
Timezone::class,
];
if ($applyAlwaysAuthenticate && !$this->isWhiteListedAuthRoute($routes)) {
$... | php | protected function mapOtherwise(Router $router, $routes, $applyAlwaysAuthenticate)
{
$middleware = [
SubstituteBindings::class,
Acceptable::class,
Timezone::class,
];
if ($applyAlwaysAuthenticate && !$this->isWhiteListedAuthRoute($routes)) {
$... | [
"protected",
"function",
"mapOtherwise",
"(",
"Router",
"$",
"router",
",",
"$",
"routes",
",",
"$",
"applyAlwaysAuthenticate",
")",
"{",
"$",
"middleware",
"=",
"[",
"SubstituteBindings",
"::",
"class",
",",
"Acceptable",
"::",
"class",
",",
"Timezone",
"::",... | Wrap the routes in the basic middleware.
@param \Illuminate\Routing\Router $router
@param object $routes
@param bool $applyAlwaysAuthenticate
@return void | [
"Wrap",
"the",
"routes",
"in",
"the",
"basic",
"middleware",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Foundation/Providers/RouteServiceProvider.php#L170-L185 |
220,780 | CachetHQ/Cachet | app/Foundation/Providers/RouteServiceProvider.php | RouteServiceProvider.isWhiteListedAuthRoute | private function isWhiteListedAuthRoute($routes)
{
foreach ($this->whitelistedAuthRoutes as $whitelistedRoute) {
if (is_a($routes, $whitelistedRoute)) {
return true;
}
}
return false;
} | php | private function isWhiteListedAuthRoute($routes)
{
foreach ($this->whitelistedAuthRoutes as $whitelistedRoute) {
if (is_a($routes, $whitelistedRoute)) {
return true;
}
}
return false;
} | [
"private",
"function",
"isWhiteListedAuthRoute",
"(",
"$",
"routes",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"whitelistedAuthRoutes",
"as",
"$",
"whitelistedRoute",
")",
"{",
"if",
"(",
"is_a",
"(",
"$",
"routes",
",",
"$",
"whitelistedRoute",
")",
")",... | Validates if the route object is an instance of the whitelisted routes.
A small workaround since we cant use multiple classes in a `instanceof` comparison.
@param object $routes
@return bool | [
"Validates",
"if",
"the",
"route",
"object",
"is",
"an",
"instance",
"of",
"the",
"whitelisted",
"routes",
".",
"A",
"small",
"workaround",
"since",
"we",
"cant",
"use",
"multiple",
"classes",
"in",
"a",
"instanceof",
"comparison",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Foundation/Providers/RouteServiceProvider.php#L195-L204 |
220,781 | CachetHQ/Cachet | app/Bus/Handlers/Commands/Invite/ClaimInviteCommandHandler.php | ClaimInviteCommandHandler.handle | public function handle(ClaimInviteCommand $command)
{
$invite = $command->invite;
$invite->update(['claimed_at' => Carbon::now()]);
event(new InviteWasClaimedEvent($invite));
} | php | public function handle(ClaimInviteCommand $command)
{
$invite = $command->invite;
$invite->update(['claimed_at' => Carbon::now()]);
event(new InviteWasClaimedEvent($invite));
} | [
"public",
"function",
"handle",
"(",
"ClaimInviteCommand",
"$",
"command",
")",
"{",
"$",
"invite",
"=",
"$",
"command",
"->",
"invite",
";",
"$",
"invite",
"->",
"update",
"(",
"[",
"'claimed_at'",
"=>",
"Carbon",
"::",
"now",
"(",
")",
"]",
")",
";",... | Handle the claim invite command.
@param \CachetHQ\Cachet\Bus\Commands\Invite\ClaimInviteCommand $command
@return void | [
"Handle",
"the",
"claim",
"invite",
"command",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Bus/Handlers/Commands/Invite/ClaimInviteCommandHandler.php#L27-L34 |
220,782 | CachetHQ/Cachet | app/Bus/Handlers/Commands/Incident/RemoveIncidentCommandHandler.php | RemoveIncidentCommandHandler.handle | public function handle(RemoveIncidentCommand $command)
{
$incident = $command->incident;
event(new IncidentWasRemovedEvent($this->auth->user(), $incident));
$incident->delete();
} | php | public function handle(RemoveIncidentCommand $command)
{
$incident = $command->incident;
event(new IncidentWasRemovedEvent($this->auth->user(), $incident));
$incident->delete();
} | [
"public",
"function",
"handle",
"(",
"RemoveIncidentCommand",
"$",
"command",
")",
"{",
"$",
"incident",
"=",
"$",
"command",
"->",
"incident",
";",
"event",
"(",
"new",
"IncidentWasRemovedEvent",
"(",
"$",
"this",
"->",
"auth",
"->",
"user",
"(",
")",
","... | Handle the remove incident command.
@param \CachetHQ\Cachet\Bus\Commands\Incident\RemoveIncidentCommand $command
@return void | [
"Handle",
"the",
"remove",
"incident",
"command",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Bus/Handlers/Commands/Incident/RemoveIncidentCommandHandler.php#L46-L53 |
220,783 | CachetHQ/Cachet | app/Bus/Handlers/Commands/IncidentUpdate/RemoveIncidentUpdateCommandHandler.php | RemoveIncidentUpdateCommandHandler.handle | public function handle(RemoveIncidentUpdateCommand $command)
{
$update = $command->incidentUpdate;
event(new IncidentUpdateWasRemovedEvent($this->auth->user(), $update));
$update->delete();
} | php | public function handle(RemoveIncidentUpdateCommand $command)
{
$update = $command->incidentUpdate;
event(new IncidentUpdateWasRemovedEvent($this->auth->user(), $update));
$update->delete();
} | [
"public",
"function",
"handle",
"(",
"RemoveIncidentUpdateCommand",
"$",
"command",
")",
"{",
"$",
"update",
"=",
"$",
"command",
"->",
"incidentUpdate",
";",
"event",
"(",
"new",
"IncidentUpdateWasRemovedEvent",
"(",
"$",
"this",
"->",
"auth",
"->",
"user",
"... | Handle the remove incident update command.
@param \CachetHQ\Cachet\Bus\Commands\IncidentUpdate\RemoveIncidentUpdateCommand $command
@return void | [
"Handle",
"the",
"remove",
"incident",
"update",
"command",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Bus/Handlers/Commands/IncidentUpdate/RemoveIncidentUpdateCommandHandler.php#L51-L58 |
220,784 | CachetHQ/Cachet | app/Bus/Handlers/Events/ActionStorageHandler.php | ActionStorageHandler.handle | public function handle(ActionInterface $event)
{
$data = $event->getAction();
$action = [
'class_name' => get_class($event),
'user_id' => $data['user']->id,
'username' => $data['user']->username,
'description' => $data['description'],
... | php | public function handle(ActionInterface $event)
{
$data = $event->getAction();
$action = [
'class_name' => get_class($event),
'user_id' => $data['user']->id,
'username' => $data['user']->username,
'description' => $data['description'],
... | [
"public",
"function",
"handle",
"(",
"ActionInterface",
"$",
"event",
")",
"{",
"$",
"data",
"=",
"$",
"event",
"->",
"getAction",
"(",
")",
";",
"$",
"action",
"=",
"[",
"'class_name'",
"=>",
"get_class",
"(",
"$",
"event",
")",
",",
"'user_id'",
"=>"... | Handle the any actions that need storing.
@param \CachetHQ\Cachet\Bus\Events\ActionInterface $event
@return void | [
"Handle",
"the",
"any",
"actions",
"that",
"need",
"storing",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Bus/Handlers/Events/ActionStorageHandler.php#L32-L48 |
220,785 | CachetHQ/Cachet | app/Bus/Handlers/Commands/User/RemoveUserCommandHandler.php | RemoveUserCommandHandler.handle | public function handle(RemoveUserCommand $command)
{
$user = $command->user;
event(new UserWasRemovedEvent($user));
$user->delete();
} | php | public function handle(RemoveUserCommand $command)
{
$user = $command->user;
event(new UserWasRemovedEvent($user));
$user->delete();
} | [
"public",
"function",
"handle",
"(",
"RemoveUserCommand",
"$",
"command",
")",
"{",
"$",
"user",
"=",
"$",
"command",
"->",
"user",
";",
"event",
"(",
"new",
"UserWasRemovedEvent",
"(",
"$",
"user",
")",
")",
";",
"$",
"user",
"->",
"delete",
"(",
")",... | Handle the remove user command.
@param \CachetHQ\Cachet\Bus\Commands\User\RemoveUserCommand $command
@return void | [
"Handle",
"the",
"remove",
"user",
"command",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Bus/Handlers/Commands/User/RemoveUserCommandHandler.php#L27-L34 |
220,786 | CachetHQ/Cachet | app/Bus/Handlers/Commands/IncidentUpdate/CreateIncidentUpdateCommandHandler.php | CreateIncidentUpdateCommandHandler.handle | public function handle(CreateIncidentUpdateCommand $command)
{
$data = [
'incident_id' => $command->incident->id,
'status' => $command->status,
'message' => $command->message,
'user_id' => $command->user->id,
];
// Create the inci... | php | public function handle(CreateIncidentUpdateCommand $command)
{
$data = [
'incident_id' => $command->incident->id,
'status' => $command->status,
'message' => $command->message,
'user_id' => $command->user->id,
];
// Create the inci... | [
"public",
"function",
"handle",
"(",
"CreateIncidentUpdateCommand",
"$",
"command",
")",
"{",
"$",
"data",
"=",
"[",
"'incident_id'",
"=>",
"$",
"command",
"->",
"incident",
"->",
"id",
",",
"'status'",
"=>",
"$",
"command",
"->",
"status",
",",
"'message'",... | Handle the report incident command.
@param \CachetHQ\Cachet\Bus\Commands\IncidentUpdate\CreateIncidentUpdateCommand $command
@return \CachetHQ\Cachet\Models\IncidentUpdate | [
"Handle",
"the",
"report",
"incident",
"command",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Bus/Handlers/Commands/IncidentUpdate/CreateIncidentUpdateCommandHandler.php#L53-L84 |
220,787 | CachetHQ/Cachet | app/Http/Controllers/Dashboard/SubscriberController.php | SubscriberController.createSubscriberAction | public function createSubscriberAction()
{
$verified = app(Repository::class)->get('setting.skip_subscriber_verification');
try {
$subscribers = preg_split("/\r\n|\n|\r/", Binput::get('email'));
foreach ($subscribers as $subscriber) {
execute(new SubscribeSu... | php | public function createSubscriberAction()
{
$verified = app(Repository::class)->get('setting.skip_subscriber_verification');
try {
$subscribers = preg_split("/\r\n|\n|\r/", Binput::get('email'));
foreach ($subscribers as $subscriber) {
execute(new SubscribeSu... | [
"public",
"function",
"createSubscriberAction",
"(",
")",
"{",
"$",
"verified",
"=",
"app",
"(",
"Repository",
"::",
"class",
")",
"->",
"get",
"(",
"'setting.skip_subscriber_verification'",
")",
";",
"try",
"{",
"$",
"subscribers",
"=",
"preg_split",
"(",
"\"... | Creates a new subscriber.
@return \Illuminate\Http\RedirectResponse | [
"Creates",
"a",
"new",
"subscriber",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/SubscriberController.php#L53-L72 |
220,788 | CachetHQ/Cachet | app/Http/Routes/ApiRoutes.php | ApiRoutes.map | public function map(Registrar $router)
{
$router->group([
'namespace' => 'Api',
'prefix' => 'api/v1',
], function (Registrar $router) {
$router->group(['middleware' => ['auth.api', 'cors']], function (Registrar $router) {
$router->get('compone... | php | public function map(Registrar $router)
{
$router->group([
'namespace' => 'Api',
'prefix' => 'api/v1',
], function (Registrar $router) {
$router->group(['middleware' => ['auth.api', 'cors']], function (Registrar $router) {
$router->get('compone... | [
"public",
"function",
"map",
"(",
"Registrar",
"$",
"router",
")",
"{",
"$",
"router",
"->",
"group",
"(",
"[",
"'namespace'",
"=>",
"'Api'",
",",
"'prefix'",
"=>",
"'api/v1'",
",",
"]",
",",
"function",
"(",
"Registrar",
"$",
"router",
")",
"{",
"$",
... | Define the api routes.
@param \Illuminate\Contracts\Routing\Registrar $router
@return void | [
"Define",
"the",
"api",
"routes",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Routes/ApiRoutes.php#L37-L97 |
220,789 | CachetHQ/Cachet | app/Settings/Cache.php | Cache.store | public function store($env, array $data)
{
$this->files->put($this->path($env), '<?php return '.var_export($data, true).';'.PHP_EOL);
} | php | public function store($env, array $data)
{
$this->files->put($this->path($env), '<?php return '.var_export($data, true).';'.PHP_EOL);
} | [
"public",
"function",
"store",
"(",
"$",
"env",
",",
"array",
"$",
"data",
")",
"{",
"$",
"this",
"->",
"files",
"->",
"put",
"(",
"$",
"this",
"->",
"path",
"(",
"$",
"env",
")",
",",
"'<?php return '",
".",
"var_export",
"(",
"$",
"data",
",",
... | Store the settings in the cache.
@param string $env
@param array $data
@return void | [
"Store",
"the",
"settings",
"in",
"the",
"cache",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Settings/Cache.php#L61-L64 |
220,790 | CachetHQ/Cachet | app/Settings/Cache.php | Cache.load | public function load($env)
{
try {
return $this->files->getRequire($this->path($env));
} catch (Exception $e) {
return false;
}
} | php | public function load($env)
{
try {
return $this->files->getRequire($this->path($env));
} catch (Exception $e) {
return false;
}
} | [
"public",
"function",
"load",
"(",
"$",
"env",
")",
"{",
"try",
"{",
"return",
"$",
"this",
"->",
"files",
"->",
"getRequire",
"(",
"$",
"this",
"->",
"path",
"(",
"$",
"env",
")",
")",
";",
"}",
"catch",
"(",
"Exception",
"$",
"e",
")",
"{",
"... | Load the settings from the cache.
@param string $env
@return array|false | [
"Load",
"the",
"settings",
"from",
"the",
"cache",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Settings/Cache.php#L73-L80 |
220,791 | CachetHQ/Cachet | app/Bus/Handlers/Commands/Metric/CreateMetricPointCommandHandler.php | CreateMetricPointCommandHandler.handle | public function handle(CreateMetricPointCommand $command)
{
$metric = $command->metric;
$createdAt = $command->created_at;
// Do we have an existing point with the same value?
$point = $this->findOrCreatePoint($command);
$point->increment('counter', 1);
event(new M... | php | public function handle(CreateMetricPointCommand $command)
{
$metric = $command->metric;
$createdAt = $command->created_at;
// Do we have an existing point with the same value?
$point = $this->findOrCreatePoint($command);
$point->increment('counter', 1);
event(new M... | [
"public",
"function",
"handle",
"(",
"CreateMetricPointCommand",
"$",
"command",
")",
"{",
"$",
"metric",
"=",
"$",
"command",
"->",
"metric",
";",
"$",
"createdAt",
"=",
"$",
"command",
"->",
"created_at",
";",
"// Do we have an existing point with the same value?"... | Handle the add metric point command.
@param \CachetHQ\Cachet\Bus\Commands\Metric\CreateMetricPointCommand $command
@return \CachetHQ\Cachet\Models\MetricPoint | [
"Handle",
"the",
"add",
"metric",
"point",
"command",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Bus/Handlers/Commands/Metric/CreateMetricPointCommandHandler.php#L58-L71 |
220,792 | CachetHQ/Cachet | app/Bus/Handlers/Commands/Metric/CreateMetricPointCommandHandler.php | CreateMetricPointCommandHandler.findOrCreatePoint | protected function findOrCreatePoint(CreateMetricPointCommand $command)
{
$buffer = Carbon::now()->subMinutes($command->metric->threshold - 1)->startOfMinute();
if ($point = MetricPoint::where('metric_id', '=', $command->metric->id)->where('value', '=', $command->value)->where('created_at', '>=', $... | php | protected function findOrCreatePoint(CreateMetricPointCommand $command)
{
$buffer = Carbon::now()->subMinutes($command->metric->threshold - 1)->startOfMinute();
if ($point = MetricPoint::where('metric_id', '=', $command->metric->id)->where('value', '=', $command->value)->where('created_at', '>=', $... | [
"protected",
"function",
"findOrCreatePoint",
"(",
"CreateMetricPointCommand",
"$",
"command",
")",
"{",
"$",
"buffer",
"=",
"Carbon",
"::",
"now",
"(",
")",
"->",
"subMinutes",
"(",
"$",
"command",
"->",
"metric",
"->",
"threshold",
"-",
"1",
")",
"->",
"... | Find or create a metric point.
@param \CachetHQ\Cachet\Bus\Commands\Metric\CreateMetricPointCommand $command
@return \CachetHQ\Cachet\Models\MetricPoint | [
"Find",
"or",
"create",
"a",
"metric",
"point",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Bus/Handlers/Commands/Metric/CreateMetricPointCommandHandler.php#L80-L99 |
220,793 | CachetHQ/Cachet | app/Bus/Handlers/Commands/Schedule/DeleteScheduleCommandHandler.php | DeleteScheduleCommandHandler.handle | public function handle(DeleteScheduleCommand $command)
{
$schedule = $command->schedule;
event(new ScheduleWasRemovedEvent($this->auth->user(), $schedule));
$schedule->delete();
} | php | public function handle(DeleteScheduleCommand $command)
{
$schedule = $command->schedule;
event(new ScheduleWasRemovedEvent($this->auth->user(), $schedule));
$schedule->delete();
} | [
"public",
"function",
"handle",
"(",
"DeleteScheduleCommand",
"$",
"command",
")",
"{",
"$",
"schedule",
"=",
"$",
"command",
"->",
"schedule",
";",
"event",
"(",
"new",
"ScheduleWasRemovedEvent",
"(",
"$",
"this",
"->",
"auth",
"->",
"user",
"(",
")",
","... | Handle the delete schedule command.
@param \CachetHQ\Cachet\Bus\Commands\Schedule\DeleteScheduleCommand $command
@return void | [
"Handle",
"the",
"delete",
"schedule",
"command",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Bus/Handlers/Commands/Schedule/DeleteScheduleCommandHandler.php#L51-L58 |
220,794 | CachetHQ/Cachet | app/Console/Commands/DemoSeederCommand.php | DemoSeederCommand.seedComponentGroups | protected function seedComponentGroups()
{
$defaultGroups = [
[
'name' => 'Websites',
'order' => 1,
'collapsed' => 0,
'visible' => ComponentGroup::VISIBLE_AUTHENTICATED,
], [
'name' => 'Al... | php | protected function seedComponentGroups()
{
$defaultGroups = [
[
'name' => 'Websites',
'order' => 1,
'collapsed' => 0,
'visible' => ComponentGroup::VISIBLE_AUTHENTICATED,
], [
'name' => 'Al... | [
"protected",
"function",
"seedComponentGroups",
"(",
")",
"{",
"$",
"defaultGroups",
"=",
"[",
"[",
"'name'",
"=>",
"'Websites'",
",",
"'order'",
"=>",
"1",
",",
"'collapsed'",
"=>",
"0",
",",
"'visible'",
"=>",
"ComponentGroup",
"::",
"VISIBLE_AUTHENTICATED",
... | Seed the component groups table.
@return void | [
"Seed",
"the",
"component",
"groups",
"table",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Console/Commands/DemoSeederCommand.php#L118-L139 |
220,795 | CachetHQ/Cachet | app/Console/Commands/DemoSeederCommand.php | DemoSeederCommand.seedComponents | protected function seedComponents()
{
$defaultComponents = [
[
'name' => 'API',
'description' => 'Used by third-parties to connect to us',
'status' => 1,
'order' => 0,
'group_id' => 0,
... | php | protected function seedComponents()
{
$defaultComponents = [
[
'name' => 'API',
'description' => 'Used by third-parties to connect to us',
'status' => 1,
'order' => 0,
'group_id' => 0,
... | [
"protected",
"function",
"seedComponents",
"(",
")",
"{",
"$",
"defaultComponents",
"=",
"[",
"[",
"'name'",
"=>",
"'API'",
",",
"'description'",
"=>",
"'Used by third-parties to connect to us'",
",",
"'status'",
"=>",
"1",
",",
"'order'",
"=>",
"0",
",",
"'grou... | Seed the components table.
@return void | [
"Seed",
"the",
"components",
"table",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Console/Commands/DemoSeederCommand.php#L146-L199 |
220,796 | CachetHQ/Cachet | app/Console/Commands/DemoSeederCommand.php | DemoSeederCommand.seedIncidents | protected function seedIncidents()
{
$incidentMessage = <<<'EINCIDENT'
# Of course it does!
What kind of web application doesn't these days?
## Headers are fun aren't they
It's _exactly_ why we need Markdown. For **emphasis** and such.
EINCIDENT;
$defaultIncidents = [
[
... | php | protected function seedIncidents()
{
$incidentMessage = <<<'EINCIDENT'
# Of course it does!
What kind of web application doesn't these days?
## Headers are fun aren't they
It's _exactly_ why we need Markdown. For **emphasis** and such.
EINCIDENT;
$defaultIncidents = [
[
... | [
"protected",
"function",
"seedIncidents",
"(",
")",
"{",
"$",
"incidentMessage",
"=",
" <<<'EINCIDENT'\n# Of course it does!\n\nWhat kind of web application doesn't these days?\n\n## Headers are fun aren't they\n\nIt's _exactly_ why we need Markdown. For **emphasis** and such.\nEINCIDENT",
";",
... | Seed the incidents table.
@return void | [
"Seed",
"the",
"incidents",
"table",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Console/Commands/DemoSeederCommand.php#L206-L249 |
220,797 | CachetHQ/Cachet | app/Console/Commands/DemoSeederCommand.php | DemoSeederCommand.seedIncidentUpdates | protected function seedIncidentUpdates($incident)
{
$defaultUpdates = [
1 => [
[
'status' => Incident::FIXED,
'message' => 'The monkeys are back and rested!',
'user_id' => 1,
], [
'st... | php | protected function seedIncidentUpdates($incident)
{
$defaultUpdates = [
1 => [
[
'status' => Incident::FIXED,
'message' => 'The monkeys are back and rested!',
'user_id' => 1,
], [
'st... | [
"protected",
"function",
"seedIncidentUpdates",
"(",
"$",
"incident",
")",
"{",
"$",
"defaultUpdates",
"=",
"[",
"1",
"=>",
"[",
"[",
"'status'",
"=>",
"Incident",
"::",
"FIXED",
",",
"'message'",
"=>",
"'The monkeys are back and rested!'",
",",
"'user_id'",
"=>... | Seed the incident updates table for a given incident.
@return void | [
"Seed",
"the",
"incident",
"updates",
"table",
"for",
"a",
"given",
"incident",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Console/Commands/DemoSeederCommand.php#L266-L300 |
220,798 | CachetHQ/Cachet | app/Console/Commands/DemoSeederCommand.php | DemoSeederCommand.seedMetrics | protected function seedMetrics()
{
$defaultMetrics = [
[
'name' => 'Cups of coffee',
'suffix' => 'Cups',
'description' => 'How many cups of coffee we\'ve drank.',
'default_value' => 0,
'calc_type' ... | php | protected function seedMetrics()
{
$defaultMetrics = [
[
'name' => 'Cups of coffee',
'suffix' => 'Cups',
'description' => 'How many cups of coffee we\'ve drank.',
'default_value' => 0,
'calc_type' ... | [
"protected",
"function",
"seedMetrics",
"(",
")",
"{",
"$",
"defaultMetrics",
"=",
"[",
"[",
"'name'",
"=>",
"'Cups of coffee'",
",",
"'suffix'",
"=>",
"'Cups'",
",",
"'description'",
"=>",
"'How many cups of coffee we\\'ve drank.'",
",",
"'default_value'",
"=>",
"0... | Seed the metrics table.
@return void | [
"Seed",
"the",
"metrics",
"table",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Console/Commands/DemoSeederCommand.php#L329-L347 |
220,799 | CachetHQ/Cachet | app/Console/Commands/DemoSeederCommand.php | DemoSeederCommand.seedSchedules | protected function seedSchedules()
{
$defaultSchedules = [
[
'name' => 'Demo resets every half hour!',
'message' => 'You can schedule downtime for _your_ service!',
'status' => Schedule::UPCOMING,
'scheduled_at' =... | php | protected function seedSchedules()
{
$defaultSchedules = [
[
'name' => 'Demo resets every half hour!',
'message' => 'You can schedule downtime for _your_ service!',
'status' => Schedule::UPCOMING,
'scheduled_at' =... | [
"protected",
"function",
"seedSchedules",
"(",
")",
"{",
"$",
"defaultSchedules",
"=",
"[",
"[",
"'name'",
"=>",
"'Demo resets every half hour!'",
",",
"'message'",
"=>",
"'You can schedule downtime for _your_ service!'",
",",
"'status'",
"=>",
"Schedule",
"::",
"UPCOMI... | Seed the schedules table.
@return void | [
"Seed",
"the",
"schedules",
"table",
"."
] | ae35e1f9d0ce643ca2dbc544fa4172861ee56288 | https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Console/Commands/DemoSeederCommand.php#L354-L370 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.