From fc5fd628b25dbf87ab3424a4bdf1cfad0cfc0bb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20=C5=A0?= Date: Thu, 23 Jul 2020 00:01:12 +0200 Subject: [PATCH 1/2] Add serialize and unserialize to list of known magic methods --- .../CamelCapsFunctionNameSniff.php | 32 ++++++++++--------- .../ValidFunctionNameSniff.php | 32 ++++++++++--------- 2 files changed, 34 insertions(+), 30 deletions(-) diff --git a/src/Standards/Generic/Sniffs/NamingConventions/CamelCapsFunctionNameSniff.php b/src/Standards/Generic/Sniffs/NamingConventions/CamelCapsFunctionNameSniff.php index 64e12689a9..195504ae31 100644 --- a/src/Standards/Generic/Sniffs/NamingConventions/CamelCapsFunctionNameSniff.php +++ b/src/Standards/Generic/Sniffs/NamingConventions/CamelCapsFunctionNameSniff.php @@ -23,21 +23,23 @@ class CamelCapsFunctionNameSniff extends AbstractScopeSniff * @var array */ protected $magicMethods = [ - 'construct' => true, - 'destruct' => true, - 'call' => true, - 'callstatic' => true, - 'get' => true, - 'set' => true, - 'isset' => true, - 'unset' => true, - 'sleep' => true, - 'wakeup' => true, - 'tostring' => true, - 'set_state' => true, - 'clone' => true, - 'invoke' => true, - 'debuginfo' => true, + 'construct' => true, + 'destruct' => true, + 'call' => true, + 'callstatic ' => true, + 'get' => true, + 'set' => true, + 'isset' => true, + 'unset' => true, + 'sleep' => true, + 'wakeup' => true, + 'serialize' => true, + 'unserialize' => true, + 'tostring' => true, + 'invoke' => true, + 'set_state' => true, + 'clone' => true, + 'debuginfo' => true, ]; /** diff --git a/src/Standards/PEAR/Sniffs/NamingConventions/ValidFunctionNameSniff.php b/src/Standards/PEAR/Sniffs/NamingConventions/ValidFunctionNameSniff.php index 49486a54a3..c2ae1be50a 100644 --- a/src/Standards/PEAR/Sniffs/NamingConventions/ValidFunctionNameSniff.php +++ b/src/Standards/PEAR/Sniffs/NamingConventions/ValidFunctionNameSniff.php @@ -23,21 +23,23 @@ class ValidFunctionNameSniff extends AbstractScopeSniff * @var array */ protected $magicMethods = [ - 'construct' => true, - 'destruct' => true, - 'call' => true, - 'callstatic' => true, - 'get' => true, - 'set' => true, - 'isset' => true, - 'unset' => true, - 'sleep' => true, - 'wakeup' => true, - 'tostring' => true, - 'set_state' => true, - 'clone' => true, - 'invoke' => true, - 'debuginfo' => true, + 'construct' => true, + 'destruct' => true, + 'call' => true, + 'callstatic ' => true, + 'get' => true, + 'set' => true, + 'isset' => true, + 'unset' => true, + 'sleep' => true, + 'wakeup' => true, + 'serialize' => true, + 'unserialize' => true, + 'tostring' => true, + 'invoke' => true, + 'set_state' => true, + 'clone' => true, + 'debuginfo' => true, ]; /** From 1e8a69c8c105d84ec75f3c05d8a341178589ea26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20=C5=A0?= Date: Thu, 23 Jul 2020 11:10:36 +0200 Subject: [PATCH 2/2] Fix misaligned space --- .../Sniffs/NamingConventions/CamelCapsFunctionNameSniff.php | 2 +- .../PEAR/Sniffs/NamingConventions/ValidFunctionNameSniff.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Standards/Generic/Sniffs/NamingConventions/CamelCapsFunctionNameSniff.php b/src/Standards/Generic/Sniffs/NamingConventions/CamelCapsFunctionNameSniff.php index 195504ae31..b45112034a 100644 --- a/src/Standards/Generic/Sniffs/NamingConventions/CamelCapsFunctionNameSniff.php +++ b/src/Standards/Generic/Sniffs/NamingConventions/CamelCapsFunctionNameSniff.php @@ -26,7 +26,7 @@ class CamelCapsFunctionNameSniff extends AbstractScopeSniff 'construct' => true, 'destruct' => true, 'call' => true, - 'callstatic ' => true, + 'callstatic' => true, 'get' => true, 'set' => true, 'isset' => true, diff --git a/src/Standards/PEAR/Sniffs/NamingConventions/ValidFunctionNameSniff.php b/src/Standards/PEAR/Sniffs/NamingConventions/ValidFunctionNameSniff.php index c2ae1be50a..e7f87d44dd 100644 --- a/src/Standards/PEAR/Sniffs/NamingConventions/ValidFunctionNameSniff.php +++ b/src/Standards/PEAR/Sniffs/NamingConventions/ValidFunctionNameSniff.php @@ -26,7 +26,7 @@ class ValidFunctionNameSniff extends AbstractScopeSniff 'construct' => true, 'destruct' => true, 'call' => true, - 'callstatic ' => true, + 'callstatic' => true, 'get' => true, 'set' => true, 'isset' => true,