Skip to content

Commit

Permalink
Fix "self_accessor" PHP CS Fixer rule (#9269)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Dec 17, 2023
1 parent f5b800f commit 93946f4
Show file tree
Hide file tree
Showing 16 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions plugins/enigma/lib/enigma_key.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ static function cmp($a, $b)
function get_type()
{
if (!empty($this->subkeys[0]) && $this->subkeys[0]->has_private) {
return enigma_key::TYPE_KEYPAIR;
return self::TYPE_KEYPAIR;
}
else if (!empty($this->subkeys[0])) {
return enigma_key::TYPE_PUBLIC;
return self::TYPE_PUBLIC;
}

return enigma_key::TYPE_UNKNOWN;
return self::TYPE_UNKNOWN;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion plugins/enigma/lib/enigma_mime_message.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function __construct($message, $type)
*/
public function isMultipart()
{
return $this->message instanceof enigma_mime_message
return $this->message instanceof self
|| $this->message->isMultipart() || $this->message->getHTMLBody();
}

Expand Down
2 changes: 1 addition & 1 deletion plugins/filesystem_attachments/filesystem_attachments.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function init()
// Find filesystem_attachments-based plugins, we can use only one
foreach ($this->api->loaded_plugins() as $plugin_name) {
$plugin = $this->api->get_plugin($plugin_name);
if (($plugin instanceof filesystem_attachments) && $plugin->initialized) {
if (($plugin instanceof self) && $plugin->initialized) {
rcube::raise_error([
'file' => __FILE__, 'line' => __LINE__,
'message' => "Can use only one plugin for attachments/file uploads! Using '$plugin_name', ignoring others.",
Expand Down
4 changes: 2 additions & 2 deletions program/include/rcmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ static function get_instance($mode = 0, $env = '')
$env = 'test';
}

self::$instance = new rcmail($env);
self::$instance = new self($env);
// init AFTER object was linked with self::$instance
self::$instance->startup();
}
Expand Down Expand Up @@ -302,7 +302,7 @@ public function action_handler()

// if we arrive here, something went wrong
$error = ['code' => 404, 'line' => __LINE__, 'file' => __FILE__, 'message' => "Invalid request"];
rcmail::raise_error($error, true, true);
self::raise_error($error, true, true);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion program/include/rcmail_install.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public static function get_instance()
static $inst;

if (!$inst) {
$inst = new rcmail_install();
$inst = new self();
}

return $inst;
Expand Down
2 changes: 1 addition & 1 deletion program/include/rcmail_oauth.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class rcmail_oauth
static function get_instance($options = [])
{
if (!self::$instance) {
self::$instance = new rcmail_oauth($options);
self::$instance = new self($options);
self::$instance->init();
}

Expand Down
2 changes: 1 addition & 1 deletion program/lib/Roundcube/rcube.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class rcube
static function get_instance($mode = 0, $env = '')
{
if (!self::$instance) {
self::$instance = new rcube($env);
self::$instance = new self($env);
self::$instance->init($mode);
}

Expand Down
2 changes: 1 addition & 1 deletion program/lib/Roundcube/rcube_charset.php
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ public static function check($str, $charsets = [])
foreach ($charsets as $charset) {
$ret = self::convert($chunk, $charset);

if ($ret === rcube_charset::clean($ret)) {
if ($ret === self::clean($ret)) {
return $charset;
}
}
Expand Down
2 changes: 1 addition & 1 deletion program/lib/Roundcube/rcube_html2text.php
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ protected function _handle_link($link, $display)
if (self::LINKS_NONE === $this->_links_mode) {
// When not using link list use URL if there's no content (#5795)
// The content here is HTML, convert it to text first
$h2t = new rcube_html2text($display, false, false, 1024, $this->charset);
$h2t = new self($display, false, false, 1024, $this->charset);
$display = $h2t->get_text();

if (empty($display) && preg_match('!^([a-z][a-z0-9.+-]+://)!i', $link)) {
Expand Down
2 changes: 1 addition & 1 deletion program/lib/Roundcube/rcube_message_header.php
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ public function set($name, $value)
*/
public static function from_array($arr)
{
$obj = new rcube_message_header;
$obj = new self;
foreach ($arr as $k => $v) {
$obj->set($k, $v);
}
Expand Down
2 changes: 1 addition & 1 deletion program/lib/Roundcube/rcube_mime_decode.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ protected function do_decode($headers, $body, $default_ctype = 'text/plain')
break;

case 'message/rfc822':
$obj = new rcube_mime_decode($this->params);
$obj = new self($this->params);
$return->parts[] = $obj->decode($body, false);
unset($obj);

Expand Down
2 changes: 1 addition & 1 deletion program/lib/Roundcube/rcube_plugin_api.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class rcube_plugin_api
static function get_instance()
{
if (!self::$instance) {
self::$instance = new rcube_plugin_api();
self::$instance = new self();
}

return self::$instance;
Expand Down
2 changes: 1 addition & 1 deletion program/lib/Roundcube/rcube_tnef_decoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ protected function _extractMapiAttributes($data, &$result)

case self::MAPI_ATTACH_DATA:
$this->_getx($value, 16);
$att = new rcube_tnef_decoder;
$att = new self;
$res = $att->decompress($value);
$result = array_merge($result, $res['message']);
break;
Expand Down
4 changes: 2 additions & 2 deletions program/lib/Roundcube/rcube_user.php
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ static function query($user, $host)

// user already registered -> overwrite username
if ($sql_arr) {
return new rcube_user($sql_arr['user_id'], $sql_arr);
return new self($sql_arr['user_id'], $sql_arr);
}
}

Expand Down Expand Up @@ -660,7 +660,7 @@ static function create($user, $host)

if ($dbh->affected_rows($insert) && ($user_id = $dbh->insert_id('users'))) {
// create rcube_user instance to make plugin hooks work
$user_instance = new rcube_user($user_id, [
$user_instance = new self($user_id, [
'user_id' => $user_id,
'username' => $data['user'],
'mail_host' => $data['host'],
Expand Down
2 changes: 1 addition & 1 deletion program/lib/Roundcube/rcube_utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ public static function file2class($mimetype, $filename)
$mimetype = strtolower($mimetype);
$filename = strtolower($filename);

list($primary, $secondary) = rcube_utils::explode('/', $mimetype);
list($primary, $secondary) = self::explode('/', $mimetype);

$classes = [$primary ?: 'unknown'];

Expand Down
2 changes: 1 addition & 1 deletion program/lib/Roundcube/rcube_vcard.php
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ public static function import($data)

if (preg_match('/^END:VCARD$/i', $line)) {
// parse vcard
$obj = new rcube_vcard($vcard_block, $charset, false, self::$fieldmap);
$obj = new self($vcard_block, $charset, false, self::$fieldmap);

// FN and N is required by vCard format (RFC 2426)
// on import we can be less restrictive, let's addressbook decide
Expand Down

0 comments on commit 93946f4

Please sign in to comment.