/
AtlanticCity.php
96 lines (84 loc) · 3.2 KB
/
AtlanticCity.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?php
declare(strict_types=1);
namespace App;
class AtlanticCity
{
private const LYRICS = [
"Well they blew up the chicken man in Philly last night",
"Now they blew up his house too",
"Down on the boardwalk they're getting ready for a fight",
"Gonna see what them racket boys can do",
"Now there's trouble busting in from outta state",
"And the D.A. can't get no relief",
"Gonna be a rumble out on the promenade",
"And the gambling commissions hanging on by the skin of its teeth",
"Well now everything dies baby that's a fact",
"But maybe everything that dies someday comes back",
"Put your makeup on, fix your hair up pretty",
"And meet me tonight in Atlantic City",
"Well I got a job and tried to put my money away",
"But I got debts that no honest man can pay",
"So I drew what I had from the Central Trust",
"And I bought us two tickets on that Coast City bus",
"Now baby everything dies baby that's a fact",
"But maybe everything that dies someday comes back",
"Put your makeup on, fix your hair up pretty",
"And meet me tonight in Atlantic City",
"Now our luck may have died and our love may be cold",
"But with you forever I'll stay",
"We're going out where the sand's turning to gold",
"So put on your stockings, baby, 'cause the night's getting cold",
"And maybe everything dies, that's a fact",
"But maybe everything that dies someday comes back",
"Now I've been looking for a job but it's hard to find",
"Down here it's just winners and losers and don't get caught on the wrong side of that line",
"Well I'm tired of coming out on this losing end",
"So honey last night I met this guy and I'm gonna do a little favor for him",
"Well I guess everything dies baby that's a fact",
"But maybe everything that dies someday comes back",
"Put your hair up nice and set up pretty",
"And meet me tonight in Atlantic City",
"Meet me tonight in Atlantic City"
];
/**
* @return list<string>
*/
private function getLyrics(): array
{
return self::LYRICS;
}
private function getRandomLyric(): string
{
return $this->getLyrics()[rand(0, count($this->getLyrics()) - 1)];
}
private function getCss(): string
{
$float = is_rtl() ? 'left' : 'right';
return "<style type='text/css'>" .
"#atlantic {" .
"float: $float;" .
"padding-$float: 15px;" .
"padding-top: 5px;" .
"margin: 0;" .
"font-size: 11px;" .
"}" .
"</style>";
}
private function getHtmlOutput(): string
{
return '<p id="atlantic">' . $this->getRandomLyric() . '</p>';
}
public function atlanticCity(): void
{
echo $this->getHtmlOutput();
}
public function atlanticCss(): void
{
echo $this->getCss();
}
public function run(): void
{
add_action('admin_notices', [$this, 'atlanticCity']);
add_action('admin_head', [$this, 'atlanticCss']);
}
}