Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3942551
Kernel.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
Kernel.php
View Options
<?php
namespace
Nasqueron\Notifications\Console
;
use
Illuminate\Console\Command
;
use
Illuminate\Console\Scheduling\Schedule
;
use
Illuminate\Foundation\Console\Kernel
as
ConsoleKernel
;
class
Kernel
extends
ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var string[]
*/
protected
$commands
=
[
\Nasqueron\Notifications\Console\Commands\ConfigShow
::
class
,
\Nasqueron\Notifications\Console\Commands\ConfigValidate
::
class
,
\Nasqueron\Notifications\Console\Commands\Inspire
::
class
,
\Nasqueron\Notifications\Console\Commands\NotificationsPayload
::
class
,
\Nasqueron\Notifications\Console\Commands\PhabricatorProjectsMap
::
class
,
];
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected
function
schedule
(
Schedule
$schedule
)
:
void
{
$schedule
->
command
(
'inspire'
)
->
hourly
();
}
/**
* Gets a command by name
*
* @throws \RuntimeException when command doesn't exit
*/
public
function
get
(
string
$name
)
:
Command
{
$commands
=
$this
->
all
();
if
(
array_key_exists
(
$name
,
$commands
))
{
return
$commands
[
$name
];
}
throw
new
\RuntimeException
(
"Command $name doesn't exist."
);
}
/**
* Gets a command by class
*
* @param string $class The command class
* @return \Illuminate\Console\Command
* @throws \RuntimeException when command doesn't exit
*/
public
function
getByClass
(
string
$class
)
:
Command
{
$commands
=
$this
->
all
();
foreach
(
$commands
as
$command
)
{
if
(
$command
instanceof
$class
)
{
return
$command
;
}
}
throw
new
\RuntimeException
(
"Command $class doesn't exist."
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Thu, Dec 26, 16:28 (20 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2315259
Default Alt Text
Kernel.php (1 KB)
Attached To
Mode
rNOTIF Notifications center
Attached
Detach File
Event Timeline
Log In to Comment