diff options
author | Andreas Gohr <andi@splitbrain.org> | 2023-09-02 14:42:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-02 14:42:51 +0200 |
commit | 5ff5424d8c81c7123d8656a787af2ff85b3dec21 (patch) | |
tree | 322929ee01d892bb3c927e7fe1238369c647f820 /inc/Extension/RemotePlugin.php | |
parent | 0613df3287b82a98b1e97cf86ed9d4c8fbd16f1c (diff) | |
parent | 91560755291852b8302767d454183a7662666f7e (diff) | |
download | dokuwiki-5ff5424d8c81c7123d8656a787af2ff85b3dec21.tar.gz dokuwiki-5ff5424d8c81c7123d8656a787af2ff85b3dec21.zip |
Merge pull request #4045 from dokuwiki/autofix
Use Rector to autofix code smell
Diffstat (limited to 'inc/Extension/RemotePlugin.php')
-rw-r--r-- | inc/Extension/RemotePlugin.php | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/inc/Extension/RemotePlugin.php b/inc/Extension/RemotePlugin.php index 33bca980a..985aa91c9 100644 --- a/inc/Extension/RemotePlugin.php +++ b/inc/Extension/RemotePlugin.php @@ -13,8 +13,7 @@ use ReflectionMethod; */ abstract class RemotePlugin extends Plugin { - - private $api; + private Api $api; /** * Constructor @@ -35,7 +34,7 @@ abstract class RemotePlugin extends Plugin */ public function _getMethods() { - $result = array(); + $result = []; $reflection = new \ReflectionClass($this); foreach ($reflection->getMethods(ReflectionMethod::IS_PUBLIC) as $method) { @@ -52,17 +51,17 @@ abstract class RemotePlugin extends Plugin // strip asterisks $doc = $method->getDocComment(); $doc = preg_replace( - array('/^[ \t]*\/\*+[ \t]*/m', '/[ \t]*\*+[ \t]*/m', '/\*+\/\s*$/m', '/\s*\/\s*$/m'), - array('', '', '', ''), + ['/^[ \t]*\/\*+[ \t]*/m', '/[ \t]*\*+[ \t]*/m', '/\*+\/\s*$/m', '/\s*\/\s*$/m'], + ['', '', '', ''], $doc ); // prepare data - $data = array(); + $data = []; $data['name'] = $method_name; $data['public'] = 0; $data['doc'] = $doc; - $data['args'] = array(); + $data['args'] = []; // get parameter type from doc block type hint foreach ($method->getParameters() as $parameter) { @@ -104,7 +103,7 @@ abstract class RemotePlugin extends Plugin if ($t === 'boolean') { return 'bool'; } - if (in_array($t, array('array', 'string', 'int', 'double', 'bool', 'null', 'date', 'file'))) { + if (in_array($t, ['array', 'string', 'int', 'double', 'bool', 'null', 'date', 'file'])) { return $t; } } @@ -118,5 +117,4 @@ abstract class RemotePlugin extends Plugin { return $this->api; } - } |