dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Safe replacement of a lot of `!count()` with `=== []`
[lhc/web/wiklou.git]
/
includes
/
parser
/
Preprocessor_DOM.php
diff --git
a/includes/parser/Preprocessor_DOM.php
b/includes/parser/Preprocessor_DOM.php
index
d00c40f
..
3bcd012
100644
(file)
--- a/
includes/parser/Preprocessor_DOM.php
+++ b/
includes/parser/Preprocessor_DOM.php
@@
-878,7
+878,7
@@
class PPDStack {
}
public function pop() {
}
public function pop() {
- if (
!count( $this->stack )
) {
+ if (
$this->stack === []
) {
throw new MWException( __METHOD__ . ': no elements remaining' );
}
$temp = array_pop( $this->stack );
throw new MWException( __METHOD__ . ': no elements remaining' );
}
$temp = array_pop( $this->stack );
@@
-902,7
+902,7
@@
class PPDStack {
* @return array
*/
public function getFlags() {
* @return array
*/
public function getFlags() {
- if (
!count( $this->stack )
) {
+ if (
$this->stack === []
) {
return [
'findEquals' => false,
'findPipe' => false,
return [
'findEquals' => false,
'findPipe' => false,
@@
-1876,10
+1876,7
@@
class PPCustomFrame_DOM extends PPFrame_DOM {
* @return string|bool
*/
public function getArgument( $index ) {
* @return string|bool
*/
public function getArgument( $index ) {
- if ( !isset( $this->args[$index] ) ) {
- return false;
- }
- return $this->args[$index];
+ return $this->args[$index] ?? false;
}
public function getArguments() {
}
public function getArguments() {