Skip to content

Commit a528e6e

Browse files
authored
Enhancement: Enable no_mixed_echo_print fixer (#864)
1 parent 9709f81 commit a528e6e

File tree

6 files changed

+12
-11
lines changed

6 files changed

+12
-11
lines changed

.php-cs-fixer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
'line_ending' => true,
3939
'new_with_parentheses' => true,
4040
'no_extra_blank_lines' => true,
41+
'no_mixed_echo_print' => true,
4142
'no_trailing_whitespace' => true,
4243
'ordered_class_elements' => true,
4344
'random_api_migration' => true,

git-php.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@
159159

160160
else {
161161
if (count($_POST)) {
162-
print <<<EOT
162+
echo <<<EOT
163163
<div class="warning">
164164
<p>
165165
We could not have said it more clearly. Read everything on

images/elephpants.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
$count = min((int) $_REQUEST['count'], 50);
3939
} else {
4040
header('HTTP/1.1 400', true, 400);
41-
print json_encode([
41+
echo json_encode([
4242
'error' => "Specify how many elephpants to serve via 'count'."
4343
]);
4444
exit;
@@ -52,7 +52,7 @@
5252
// if no photo data, respond with an error.
5353
if (!$photos || !is_array($photos)) {
5454
header('HTTP/1.1 500', true, 500);
55-
print json_encode([
55+
echo json_encode([
5656
'error' => "No elephpant metadata available."
5757
]);
5858
exit;
@@ -83,4 +83,4 @@
8383
];
8484
}
8585

86-
print json_encode($elephpants);
86+
echo json_encode($elephpants);

include/footer.inc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
</section><!-- layout-content -->
22
<?php
33
if (!empty($config['spanning-content'])) {
4-
print "<div class='spanning-content'>";
5-
print $config['spanning-content'];
6-
print "</div>";
4+
echo "<div class='spanning-content'>";
5+
echo $config['spanning-content'];
6+
echo "</div>";
77
}
88

99
?>
@@ -80,7 +80,7 @@
8080
// if elephpants enabled, insert placeholder nodes
8181
// to be populated with images via javascript.
8282
if (isset($config['elephpants']) && $config['elephpants']) {
83-
print "<div class='elephpants'><div class=images></div></div>";
83+
echo "<div class='elephpants'><div class=images></div></div>";
8484
}
8585
?>
8686

include/header.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ if (!isset($config["languages"])) {
9292
<?php if (isset($config['meta_tags'])) { echo $config['meta_tags']; } ?>
9393

9494
</head>
95-
<body class="<?php print $curr; ?> <?php echo $classes; ?>">
95+
<body class="<?php echo $curr; ?> <?php echo $classes; ?>">
9696

9797
<nav id="head-nav" class="navbar navbar-fixed-top">
9898
<div class="navbar-inner clearfix">

manual/add-note.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,11 @@
107107
// If there is any non-header result, then it is an error
108108
if ($result) {
109109
if (strpos($result, '[TOO MANY NOTES]') !== false) {
110-
print "<p class=\"formerror\">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.</p>";
110+
echo "<p class=\"formerror\">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.</p>";
111111
} elseif (($pos = strpos($result, '[SPAMMER]')) !== false) {
112112
$ip = trim(substr($result, $pos + 9));
113113
$spam_url = $ip_spam_lookup_url . $ip;
114-
print '<p class="formerror">Your IP is listed in one of the spammers lists we use, which aren\'t controlled by us. More information is available at <a href="' . $spam_url . '">' . $spam_url . '</a>.</p>';
114+
echo '<p class="formerror">Your IP is listed in one of the spammers lists we use, which aren\'t controlled by us. More information is available at <a href="' . $spam_url . '">' . $spam_url . '</a>.</p>';
115115
} elseif (strpos($result, '[SPAM WORD]') !== false) {
116116
echo '<p class="formerror">Your note contains a prohibited (usually SPAM) word. Please remove it and try again.</p>';
117117
} elseif (strpos($result, '[CLOSED]') !== false) {

0 commit comments

Comments
 (0)