diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php
index f2ea023803..f9ca187953 100644
--- a/.php-cs-fixer.php
+++ b/.php-cs-fixer.php
@@ -13,6 +13,7 @@
$config->setRules([
'array_indentation' => true,
+ 'constant_case' => true,
'indentation_type' => true,
'line_ending' => true,
'no_extra_blank_lines' => true,
diff --git a/cal.php b/cal.php
index 55599eb7e0..990040cf5e 100644
--- a/cal.php
+++ b/cal.php
@@ -18,7 +18,7 @@
a fallback to display the actual month/year.
*/
-$begun = FALSE; $errors = array();
+$begun = false; $errors = array();
$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
$cy = isset($_GET['cy']) ? (int) $_GET['cy'] : 0;
$cm = isset($_GET['cm']) ? (int) $_GET['cm'] : 0;
@@ -37,7 +37,7 @@
if ($event = load_event($id)) {
site_header("Event: " . stripslashes(htmlentities($event['sdesc'], ENT_QUOTES | ENT_IGNORE, 'UTF-8')), $site_header_config);
display_event($event, 0);
- $begun = TRUE;
+ $begun = true;
}
// Unable to find event, put this to the error messages' list
else {
@@ -63,7 +63,7 @@
display_event($event, 0);
echo "
";
}
- $begun = TRUE;
+ $begun = true;
}
// Unable to load events for that day
@@ -110,10 +110,10 @@
}
// Get events list for a whole month
-$events = load_events($date, TRUE);
+$events = load_events($date, true);
// If there was an error, or there are no events, this is an error
-if ($events === FALSE || count($events) == 0) {
+if ($events === false || count($events) == 0) {
$errors[] = "No events found for this month";
}
@@ -257,7 +257,7 @@ function load_event($id)
{
// Open events CSV file, return on error
$fp = @fopen("backend/events.csv",'r');
- if (!$fp) { return FALSE; }
+ if (!$fp) { return false; }
// Read as we can, event by event
while (!feof($fp)) {
@@ -266,7 +266,7 @@ function load_event($id)
// Return with the event, if it's ID is the one
// we search for (also close the file)
- if ($event !== FALSE && $event['id'] == $id) {
+ if ($event !== false && $event['id'] == $id) {
fclose($fp);
return $event;
}
@@ -274,12 +274,12 @@ function load_event($id)
// Close file, and return sign of failure
fclose($fp);
- return FALSE;
+ return false;
}
// Load a list of events. Either for a particular day ($from) or a whole
// month (if second parameter specified with TRUE)
-function load_events($from, $whole_month = FALSE)
+function load_events($from, $whole_month = false)
{
// Take advantage of the equality behavior of this date format
$from_date = date("Y-m-d", $from);
@@ -292,14 +292,14 @@ function load_events($from, $whole_month = FALSE)
// Try to open the events file for reading, return if unable to
$fp = @fopen("backend/events.csv",'r');
- if (!$fp) { return FALSE; }
+ if (!$fp) { return false; }
// For all events, read in the event and check it if fits our scope
while (!feof($fp)) {
// Read the event data into $event, or continue with next
// line, if there was an error with this line
- if (($event = read_event($fp)) === FALSE) {
+ if (($event = read_event($fp)) === false) {
continue;
}
@@ -345,12 +345,12 @@ function load_events($from, $whole_month = FALSE)
function read_event($fp)
{
// We were unable to read a line from the file, return
- if (($linearr = fgetcsv($fp, 8192)) === FALSE) {
- return FALSE;
+ if (($linearr = fgetcsv($fp, 8192)) === false) {
+ return false;
}
// Corrupt line in CSV file
- if (count($linearr) < 13) { return FALSE; }
+ if (count($linearr) < 13) { return false; }
// Get components
list(
@@ -386,11 +386,11 @@ function valid_year($year)
// We only allow this and the next year for displays
if ($year != $current_year && $year != $current_year+1) {
- return FALSE;
+ return false;
}
// The year is all right
- return TRUE;
+ return true;
}
?>
diff --git a/download-docs.php b/download-docs.php
index bdd5d4a247..471f153049 100644
--- a/download-docs.php
+++ b/download-docs.php
@@ -118,7 +118,7 @@
$changed = @filemtime($filepath);
// Size available, collect information
- if ($size !== FALSE) {
+ if ($size !== false) {
$files[$langcode][$formatname] = array(
$link_to,
(int) ($size/1024),
@@ -170,8 +170,8 @@
foreach ($files as $langcode => $lang_files) {
// See if current language is the preferred one
- if ($langcode == $LANG) { $preflang = TRUE; }
- else { $preflang = FALSE; }
+ if ($langcode == $LANG) { $preflang = true; }
+ else { $preflang = false; }
// Highlight manual in preferred language
if ($preflang) {
diff --git a/download-logos.php b/download-logos.php
index 85f59dd1c4..b331754d91 100644
--- a/download-logos.php
+++ b/download-logos.php
@@ -65,7 +65,7 @@ function random_bgcolor($min, $max): void
As a security precaution, we only allow a certain number of notes to be submitted per minute. At this time, this number has been exceeded. Please re-submit your note in about a minute.
"; - } elseif (($pos = strpos($result, '[SPAMMER]')) !== FALSE) { + } elseif (($pos = strpos($result, '[SPAMMER]')) !== false) { $ip = trim(substr($result, $pos+9)); $spam_url = $ip_spam_lookup_url . $ip; print 'Your IP is listed in one of the spammers lists we use, which aren\'t controlled by us. More information is available at '.$spam_url.'.
'; - } elseif (strpos($result, '[SPAM WORD]') !== FALSE) { + } elseif (strpos($result, '[SPAM WORD]') !== false) { echo 'Your note contains a prohibited (usually SPAM) word. Please remove it and try again.
'; - } elseif (strpos($result, '[CLOSED]') !== FALSE) { + } elseif (strpos($result, '[CLOSED]') !== false) { echo 'Due to some technical problems this service isn\'t currently working. Please try again later. Sorry for any inconvenience.
'; } else { echo ""; @@ -140,7 +140,7 @@ // Print out preview of note echo 'This is what your entry will look like, roughly:
'; echo '