Failed Conditions
Push — rbac ( be68b4...52c28b )
by Michael
03:11
created

Logger::sentMail()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
ccs 0
cts 3
cp 0
rs 10
cc 1
nc 1
nop 3
crap 2
1
<?php
2
/******************************************************************************
3
 * Wikipedia Account Creation Assistance tool                                 *
4
 *                                                                            *
5
 * All code in this file is released into the public domain by the ACC        *
6
 * Development Team. Please see team.json for a list of contributors.         *
7
 ******************************************************************************/
8
9
namespace Waca\Helpers;
10
11
use Exception;
12
use Waca\DataObject;
13
use Waca\DataObjects\Ban;
14
use Waca\DataObjects\Comment;
15
use Waca\DataObjects\EmailTemplate;
16
use Waca\DataObjects\Log;
17
use Waca\DataObjects\Request;
18
use Waca\DataObjects\SiteNotice;
19
use Waca\DataObjects\User;
20
use Waca\DataObjects\WelcomeTemplate;
21
use Waca\PdoDatabase;
22
23
/**
24
 * Helper class for creating log entries
25
 *
26
 * Logger description.
27
 *
28
 * @version 1.0
29
 * @author  stwalkerster
30
 */
31
class Logger
32
{
33
    /**
34
     * @param PdoDatabase $database
35
     * @param Request     $object
36
     */
37
    public static function emailConfirmed(PdoDatabase $database, Request $object)
38
    {
39
        self::createLogEntry($database, $object, "Email Confirmed", null, User::getCommunity());
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Email Confirmed does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
40
    }
0 ignored issues
show
Coding Style introduced by
Expected //end emailConfirmed()
Loading history...
41
42
    /**
43
     * @param PdoDatabase $database
44
     * @param DataObject  $object
45
     * @param string      $logAction
46
     * @param null|string $comment
47
     * @param User        $user
48
     *
49
     * @throws Exception
50
     */
51
    private static function createLogEntry(
52
        PdoDatabase $database,
53
        DataObject $object,
54
        $logAction,
55
        $comment = null,
0 ignored issues
show
Coding Style introduced by
Incorrect spacing between argument "$comment" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$comment"; expected 0 but found 1
Loading history...
56
        $user = null
0 ignored issues
show
Coding Style introduced by
Incorrect spacing between argument "$user" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$user"; expected 0 but found 1
Loading history...
57
    ) {
58
        if ($user == null) {
59
            $user = User::getCurrent($database);
60
        }
61
62
        $objectType = get_class($object);
63
        if (strpos($objectType, 'Waca\\DataObjects\\') !== false) {
64
            $objectType = str_replace('Waca\\DataObjects\\', '', $objectType);
65
        }
66
67
        $log = new Log();
68
        $log->setDatabase($database);
69
        $log->setAction($logAction);
70
        $log->setObjectId($object->getId());
71
        $log->setObjectType($objectType);
72
        $log->setUser($user);
73
        $log->setComment($comment);
74
        $log->save();
75
    }
0 ignored issues
show
Coding Style introduced by
Expected //end createLogEntry()
Loading history...
76
77
    #region Users
78
79
    /**
80
     * @param PdoDatabase $database
81
     * @param User        $user
82
     */
83
    public static function newUser(PdoDatabase $database, User $user)
84
    {
85
        self::createLogEntry($database, $user, 'Registered', null, User::getCommunity());
86
    }
0 ignored issues
show
Coding Style introduced by
Expected //end newUser()
Loading history...
87
88
    /**
89
     * @param PdoDatabase $database
90
     * @param User        $object
91
     */
92
    public static function approvedUser(PdoDatabase $database, User $object)
93
    {
94
        self::createLogEntry($database, $object, "Approved");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Approved does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
95
    }
0 ignored issues
show
Coding Style introduced by
Expected //end approvedUser()
Loading history...
96
97
    /**
98
     * @param PdoDatabase $database
99
     * @param User        $object
100
     * @param string      $comment
101
     */
102
    public static function declinedUser(PdoDatabase $database, User $object, $comment)
103
    {
104
        self::createLogEntry($database, $object, "Declined", $comment);
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Declined does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
105
    }
0 ignored issues
show
Coding Style introduced by
Expected //end declinedUser()
Loading history...
106
107
    /**
108
     * @param PdoDatabase $database
109
     * @param User        $object
110
     * @param string      $comment
111
     */
112
    public static function suspendedUser(PdoDatabase $database, User $object, $comment)
113
    {
114
        self::createLogEntry($database, $object, "Suspended", $comment);
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Suspended does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
115
    }
0 ignored issues
show
Coding Style introduced by
Expected //end suspendedUser()
Loading history...
116
117
    /**
118
     * @param PdoDatabase $database
119
     * @param User        $object
120
     * @param string      $comment
121
     */
122
    public static function demotedUser(PdoDatabase $database, User $object, $comment)
123
    {
124
        self::createLogEntry($database, $object, "Demoted", $comment);
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Demoted does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
125
    }
0 ignored issues
show
Coding Style introduced by
Expected //end demotedUser()
Loading history...
126
127
    /**
128
     * @param PdoDatabase $database
129
     * @param User        $object
130
     */
131
    public static function promotedUser(PdoDatabase $database, User $object)
132
    {
133
        self::createLogEntry($database, $object, "Promoted");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Promoted does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
134
    }
0 ignored issues
show
Coding Style introduced by
Expected //end promotedUser()
Loading history...
135
136
    /**
137
     * @param PdoDatabase $database
138
     * @param User        $object
139
     * @param string      $comment
140
     */
141
    public static function renamedUser(PdoDatabase $database, User $object, $comment)
142
    {
143
        self::createLogEntry($database, $object, "Renamed", $comment);
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Renamed does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
144
    }
0 ignored issues
show
Coding Style introduced by
Expected //end renamedUser()
Loading history...
145
146
    /**
147
     * @param PdoDatabase $database
148
     * @param User        $object
149
     */
150
    public static function userPreferencesChange(PdoDatabase $database, User $object)
151
    {
152
        self::createLogEntry($database, $object, "Prefchange");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Prefchange does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
153
    }
0 ignored issues
show
Coding Style introduced by
Expected //end userPreferencesChange()
Loading history...
154
155
    /**
156
     * @param PdoDatabase $database
157
     * @param User        $object
158
     * @param string      $reason
159
     * @param array       $added
160
     * @param array       $removed
161
     */
162
    public static function userRolesEdited(PdoDatabase $database, User $object, $reason, $added, $removed)
163
    {
164
        $logData = serialize(array(
165
            'added'   => $added,
166
            'removed' => $removed,
167
            'reason'  => $reason,
168
        ));
169
170
        self::createLogEntry($database, $object, "RoleChange", $logData);
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal RoleChange does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
171
    }
0 ignored issues
show
Coding Style introduced by
Expected //end userRolesEdited()
Loading history...
172
173
    #endregion
174
175
    /**
176
     * @param PdoDatabase $database
177
     * @param SiteNotice  $object
178
     */
179
    public static function siteNoticeEdited(PdoDatabase $database, SiteNotice $object)
180
    {
181
        self::createLogEntry($database, $object, "Edited");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Edited does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
182
    }
0 ignored issues
show
Coding Style introduced by
Expected //end siteNoticeEdited()
Loading history...
183
184
    #region Welcome Templates
185
186
    /**
187
     * @param PdoDatabase     $database
188
     * @param WelcomeTemplate $object
189
     */
190
    public static function welcomeTemplateCreated(PdoDatabase $database, WelcomeTemplate $object)
191
    {
192
        self::createLogEntry($database, $object, "CreatedTemplate");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal CreatedTemplate does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
193
    }
0 ignored issues
show
Coding Style introduced by
Expected //end welcomeTemplateCreated()
Loading history...
194
195
    /**
196
     * @param PdoDatabase     $database
197
     * @param WelcomeTemplate $object
198
     */
199
    public static function welcomeTemplateEdited(PdoDatabase $database, WelcomeTemplate $object)
200
    {
201
        self::createLogEntry($database, $object, "EditedTemplate");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal EditedTemplate does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
202
    }
0 ignored issues
show
Coding Style introduced by
Expected //end welcomeTemplateEdited()
Loading history...
203
204
    /**
205
     * @param PdoDatabase     $database
206
     * @param WelcomeTemplate $object
207
     */
208
    public static function welcomeTemplateDeleted(PdoDatabase $database, WelcomeTemplate $object)
209
    {
210
        self::createLogEntry($database, $object, "DeletedTemplate");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal DeletedTemplate does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
211
    }
0 ignored issues
show
Coding Style introduced by
Expected //end welcomeTemplateDeleted()
Loading history...
212
213
    #endregion
214
215
    #region Bans
216
217
    /**
218
     * @param PdoDatabase $database
219
     * @param Ban         $object
220
     * @param string      $reason
221
     */
222
    public static function banned(PdoDatabase $database, Ban $object, $reason)
223
    {
224
        self::createLogEntry($database, $object, "Banned", $reason);
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Banned does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
225
    }
0 ignored issues
show
Coding Style introduced by
Expected //end banned()
Loading history...
226
227
    /**
228
     * @param PdoDatabase $database
229
     * @param Ban         $object
230
     * @param string      $reason
231
     */
232
    public static function unbanned(PdoDatabase $database, Ban $object, $reason)
233
    {
234
        self::createLogEntry($database, $object, "Unbanned", $reason);
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Unbanned does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
235
    }
0 ignored issues
show
Coding Style introduced by
Expected //end unbanned()
Loading history...
236
237
    #endregion
238
239
    #region Requests
240
241
    /**
242
     * @param PdoDatabase $database
243
     * @param Request     $object
244
     * @param string      $target
245
     */
246
    public static function deferRequest(PdoDatabase $database, Request $object, $target)
247
    {
248
        self::createLogEntry($database, $object, "Deferred to $target");
0 ignored issues
show
Coding Style Best Practice introduced by
As per coding-style, please use concatenation or sprintf for the variable $target instead of interpolation.

It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings.

// Instead of
$x = "foo $bar $baz";

// Better use either
$x = "foo " . $bar . " " . $baz;
$x = sprintf("foo %s %s", $bar, $baz);
Loading history...
249
    }
0 ignored issues
show
Coding Style introduced by
Expected //end deferRequest()
Loading history...
250
251
    /**
252
     * @param PdoDatabase $database
253
     * @param Request     $object
254
     * @param integer     $target
255
     * @param string      $comment
256
     */
257
    public static function closeRequest(PdoDatabase $database, Request $object, $target, $comment)
258
    {
259
        self::createLogEntry($database, $object, "Closed $target", $comment);
0 ignored issues
show
Coding Style Best Practice introduced by
As per coding-style, please use concatenation or sprintf for the variable $target instead of interpolation.

It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings.

// Instead of
$x = "foo $bar $baz";

// Better use either
$x = "foo " . $bar . " " . $baz;
$x = sprintf("foo %s %s", $bar, $baz);
Loading history...
260
    }
0 ignored issues
show
Coding Style introduced by
Expected //end closeRequest()
Loading history...
261
262
    /**
263
     * @param PdoDatabase $database
264
     * @param Request     $object
265
     */
266
    public static function reserve(PdoDatabase $database, Request $object)
267
    {
268
        self::createLogEntry($database, $object, "Reserved");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Reserved does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
269
    }
0 ignored issues
show
Coding Style introduced by
Expected //end reserve()
Loading history...
270
271
    /**
272
     * @param PdoDatabase $database
273
     * @param Request     $object
274
     */
275
    public static function breakReserve(PdoDatabase $database, Request $object)
276
    {
277
        self::createLogEntry($database, $object, "BreakReserve");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal BreakReserve does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
278
    }
0 ignored issues
show
Coding Style introduced by
Expected //end breakReserve()
Loading history...
279
280
    /**
281
     * @param PdoDatabase $database
282
     * @param Request     $object
283
     */
284
    public static function unreserve(PdoDatabase $database, Request $object)
285
    {
286
        self::createLogEntry($database, $object, "Unreserved");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Unreserved does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
287
    }
0 ignored issues
show
Coding Style introduced by
Expected //end unreserve()
Loading history...
288
289
    /**
290
     * @param PdoDatabase $database
291
     * @param Comment     $object
292
     * @param Request     $request
293
     */
294
    public static function editComment(PdoDatabase $database, Comment $object, Request $request)
295
    {
296
        self::createLogEntry($database, $request, "EditComment-r");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal EditComment-r does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
297
        self::createLogEntry($database, $object, "EditComment-c");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal EditComment-c does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
298
    }
0 ignored issues
show
Coding Style introduced by
Expected //end editComment()
Loading history...
299
300
    /**
301
     * @param PdoDatabase $database
302
     * @param Request     $object
303
     * @param User        $target
304
     */
305
    public static function sendReservation(PdoDatabase $database, Request $object, User $target)
306
    {
307
        self::createLogEntry($database, $object, "SendReserved");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal SendReserved does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
308
        self::createLogEntry($database, $object, "ReceiveReserved", null, $target);
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal ReceiveReserved does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
309
    }
0 ignored issues
show
Coding Style introduced by
Expected //end sendReservation()
Loading history...
310
311
    /**
312
     * @param PdoDatabase $database
313
     * @param Request     $object
314
     * @param string      $comment
315
     */
316
    public static function sentMail(PdoDatabase $database, Request $object, $comment)
317
    {
318
        self::createLogEntry($database, $object, "SentMail", $comment);
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal SentMail does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
319
    }
0 ignored issues
show
Coding Style introduced by
Expected //end sentMail()
Loading history...
320
    #endregion
321
322
    #region Email templates
323
324
    /**
325
     * @param PdoDatabase   $database
326
     * @param EmailTemplate $object
327
     */
328
    public static function createEmail(PdoDatabase $database, EmailTemplate $object)
329
    {
330
        self::createLogEntry($database, $object, "CreatedEmail");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal CreatedEmail does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
331
    }
0 ignored issues
show
Coding Style introduced by
Expected //end createEmail()
Loading history...
332
333
    /**
334
     * @param PdoDatabase   $database
335
     * @param EmailTemplate $object
336
     */
337
    public static function editedEmail(PdoDatabase $database, EmailTemplate $object)
338
    {
339
        self::createLogEntry($database, $object, "EditedEmail");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal EditedEmail does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
340
    }
0 ignored issues
show
Coding Style introduced by
Expected //end editedEmail()
Loading history...
341
342
    #endregion
343
344
    #region Display
345
346
    #endregion
347
}
0 ignored issues
show
Coding Style introduced by
Expected //end class
Loading history...
348