Skip to content

Commit 062e43d

Browse files
authored
Merge pull request #39 from stronk7/update_magic_methods
Update the list of scoped magic methods to current one
2 parents 3679d90 + 0bfb986 commit 062e43d

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

moodle/Sniffs/NamingConventions/ValidFunctionNameSniff.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,13 @@ class ValidFunctionNameSniff extends AbstractScopeSniff {
4747
'unset',
4848
'sleep',
4949
'wakeup',
50+
'serialize',
51+
'unserialize',
5052
'toString',
53+
'invoke',
5154
'set_state',
5255
'clone',
56+
'debuginfo',
5357
);
5458

5559
/** @var array A list of all PHP magic functions. */

moodle/Tests/fixtures/namingconventions/validfunctionname_scoped.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,10 @@ class someclass {
55
public function __magiclike() {
66
echo 'hi';
77
}
8+
public function __invoke() {
9+
echo 'hi';
10+
}
11+
public function __debuginfo() {
12+
echo 'hi';
13+
}
814
}

0 commit comments

Comments
 (0)