Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F12870382
ConfigShow.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
ConfigShow.php
View Options
<?php
namespace
Nasqueron\Notifications\Console\Commands
;
use
Illuminate\Console\Command
;
use
Nasqueron\Notifications\Config\Reporting\ConfigReport
;
class
ConfigShow
extends
Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected
$signature
=
'config:show'
;
/**
* The console command description.
*
* @var string
*/
protected
$description
=
'Show notifications center configuration'
;
/**
* @var \Nasqueron\Notifications\Config\Reporting\ConfigReport
*/
private
$report
;
///
/// Prepare information tables
///
/**
* Gets the services (defined in credentials.json) as table rows.
*
* @return array
*/
protected
function
getServicesTableRows
()
:
array
{
$rows
=
[];
foreach
(
$this
->
report
->
services
as
$service
)
{
$rows
[]
=
$service
->
toFancyArray
();
}
return
$rows
;
}
/**
* Gets features as table rows
*
* @return array
*/
protected
function
getFeaturesTableRows
()
:
array
{
$rows
=
[];
foreach
(
$this
->
report
->
features
as
$feature
)
{
$rows
[]
=
$feature
->
toFancyArray
();
}
return
$rows
;
}
///
/// Handle the command
///
/**
* Executes the console command.
*/
public
function
handle
()
:
void
{
$this
->
prepareReport
();
$this
->
printGates
();
$this
->
printFeatures
();
$this
->
printServices
();
}
protected
final
function
prepareReport
()
:
void
{
$this
->
report
=
new
ConfigReport
();
}
protected
final
function
printGates
()
:
void
{
$this
->
info
(
"Gates:
\n
"
);
foreach
(
$this
->
report
->
gates
as
$gate
)
{
$this
->
line
(
'- '
.
$gate
);
}
}
protected
final
function
printFeatures
()
:
void
{
$this
->
info
(
"
\n
Features:
\n
"
);
$this
->
table
(
[
'Feature'
,
'Enabled'
],
$this
->
getFeaturesTableRows
()
);
}
protected
final
function
printServices
()
:
void
{
$this
->
info
(
"
\n
Services declared in credentials:
\n
"
);
$this
->
table
(
[
'Gate'
,
'Door'
,
'Instance'
,
'Status'
],
$this
->
getServicesTableRows
()
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Nov 17, 15:48 (21 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3145571
Default Alt Text
ConfigShow.php (2 KB)
Attached To
Mode
rNOTIF Notifications center
Attached
Detach File
Event Timeline
Log In to Comment