Skip to content

Commit

Permalink
Fix CS - imports (#9316)
Browse files Browse the repository at this point in the history
* fix Tests\Browser\TestCase imports

* fix remaining imports

* fix PHPUnit\Framework\TestCase imports

* import GuzzleHttp\Client

* fix remaining

* "php_unit_method_casing" is not todo

* fix "single_line_comment_spacing"

* fix 2nd commit done using older fixer
  • Loading branch information
mvorisek authored Jan 21, 2024
1 parent 60011f1 commit 54f4aa3
Show file tree
Hide file tree
Showing 153 changed files with 511 additions and 255 deletions.
13 changes: 6 additions & 7 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
<?php

$finder = PhpCsFixer\Finder::create()
use PhpCsFixer\Config;
use PhpCsFixer\Finder;

$finder = Finder::create()
->in([__DIR__])
->exclude(['vendor'])
->ignoreDotFiles(false)
->name('*.php.dist')
->name('*.sh');

return (new PhpCsFixer\Config())
return (new Config())
->setRiskyAllowed(true)
->setRules([
'@PhpCsFixer' => true,
Expand Down Expand Up @@ -85,6 +88,7 @@
'prefix' => 'provide_',
'suffix' => '_cases',
],
'php_unit_method_casing' => false,
'php_unit_test_case_static_method_calls' => false,
'psr_autoloading' => false,
'strict_comparison' => false,
Expand All @@ -93,19 +97,14 @@
'array_indentation' => false,
'binary_operator_spaces' => ['default' => 'at_least_single_space'],
'explicit_string_variable' => false,
'fully_qualified_strict_types' => [
'import_symbols' => false,
],
'general_phpdoc_annotation_remove' => false,
'method_argument_space' => ['on_multiline' => 'ignore'],
'modernize_types_casting' => false,
'no_blank_lines_after_phpdoc' => false,
'no_break_comment' => false,
'no_useless_else' => false,
'php_unit_method_casing' => false,
'phpdoc_annotation_without_dot' => false,
'phpdoc_summary' => false,
'single_line_comment_spacing' => false,
'string_length_to_empty' => false,

// TODO - risky
Expand Down
6 changes: 3 additions & 3 deletions bin/install-jsdeps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ if (($CACHEDIR = getenv('CACHEDIR')) && is_writable($CACHEDIR)) {
$CACHEDIR = sys_get_temp_dir();
}

//////////////// License definitions
// ////////////// License definitions

$LICENSES = [];
$LICENSES['MIT'] = <<<'EOM'
Expand Down Expand Up @@ -98,7 +98,7 @@ $LICENSES['LGPL'] = <<<'EOL'

EOL;

//////////////// Functions
// ////////////// Functions

/**
* Fetch package file from source
Expand Down Expand Up @@ -309,7 +309,7 @@ function delete_destfile($package)
}
}

//////////////// Execution
// ////////////// Execution

$args = rcube_utils::get_opt([
'f' => 'force:bool',
Expand Down
2 changes: 1 addition & 1 deletion bin/msgimport.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ if (!isset($_SERVER['argv'][1]) || $_SERVER['argv'][1] == 'help') {

// prompt for username if not set
if (empty($args['user'])) {
//fwrite(STDOUT, "Please enter your name\n");
// fwrite(STDOUT, "Please enter your name\n");
echo 'IMAP user: ';
$args['user'] = trim(fgets(\STDIN));
}
Expand Down
8 changes: 4 additions & 4 deletions config/defaults.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
// See http://www.haproxy.org/download/1.6/doc/proxy-protocol.txt
// WARNING: Please note this is currently incompatible with implicit ssl,
// since the proxy protocol preamble is expected before the ssl handshake.
//$config['imap_conn_options'] = [
// $config['imap_conn_options'] = [
// 'ssl' => [
// 'verify_peer' => true,
// 'verify_depth' => 3,
Expand All @@ -171,7 +171,7 @@
// 'local_addr' => $_SERVER['SERVER_ADDR'], // optional
// 'local_port' => $_SERVER['SERVER_PORT'], // optional
// ],
//];
// ];
// Note: These can be also specified as an array of options indexed by hostname
$config['imap_conn_options'] = null;

Expand Down Expand Up @@ -413,7 +413,7 @@
'language' => ['locale'],
];

///// Example config for Gmail
// /// Example config for Gmail

// Register your service at https://console.developers.google.com/
// - use https://<your-roundcube-url>/index.php/login/oauth as redirect URL
Expand All @@ -429,7 +429,7 @@
// $config['oauth_scope'] = "email profile openid https://mail.google.com/";
// $config['oauth_auth_parameters'] = ['access_type' => 'offline', 'prompt' => 'consent'];

///// Example config for Outlook.com (Office 365)
// /// Example config for Outlook.com (Office 365)

// Register your OAuth client at https://portal.azure.com
// - use https://<your-roundcube-url>/index.php/login/oauth as redirect URL
Expand Down
2 changes: 1 addition & 1 deletion plugins/acl/acl.php
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ private function action_save()
*/
private function action_delete()
{
$mbox = trim(rcube_utils::get_input_string('_mbox', rcube_utils::INPUT_POST, true)); //UTF7-IMAP
$mbox = trim(rcube_utils::get_input_string('_mbox', rcube_utils::INPUT_POST, true)); // UTF7-IMAP
$user = trim(rcube_utils::get_input_string('_user', rcube_utils::INPUT_POST));

$user = explode(',', $user);
Expand Down
4 changes: 3 additions & 1 deletion plugins/archive/tests/Archive.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php

class Archive_Plugin extends PHPUnit\Framework\TestCase
use PHPUnit\Framework\TestCase;

class Archive_Plugin extends TestCase
{
public static function setUpBeforeClass(): void
{
Expand Down
3 changes: 2 additions & 1 deletion plugins/archive/tests/Browser/MailTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
namespace Tests\Browser\Plugins\Archive;

use Tests\Browser\Components\Popupmenu;
use Tests\Browser\TestCase;

class MailTest extends \Tests\Browser\TestCase
class MailTest extends TestCase
{
public static function setUpBeforeClass(): void
{
Expand Down
4 changes: 3 additions & 1 deletion plugins/archive/tests/Browser/SettingsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace Tests\Browser\Plugins\Archive;

class SettingsTest extends \Tests\Browser\TestCase
use Tests\Browser\TestCase;

class SettingsTest extends TestCase
{
public static function setUpBeforeClass(): void
{
Expand Down
4 changes: 3 additions & 1 deletion plugins/attachment_reminder/tests/AttachmentReminder.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php

class AttachmentReminder_Plugin extends PHPUnit\Framework\TestCase
use PHPUnit\Framework\TestCase;

class AttachmentReminder_Plugin extends TestCase
{
public static function setUpBeforeClass(): void
{
Expand Down
3 changes: 2 additions & 1 deletion plugins/attachment_reminder/tests/Browser/PluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
namespace Tests\Browser\Plugins\AttachmentReminder;

use Tests\Browser\Components\Dialog;
use Tests\Browser\TestCase;

class PluginTest extends \Tests\Browser\TestCase
class PluginTest extends TestCase
{
public static function setUpBeforeClass(): void
{
Expand Down
4 changes: 3 additions & 1 deletion plugins/autologon/tests/Autologon.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php

class Autologon_Plugin extends PHPUnit\Framework\TestCase
use PHPUnit\Framework\TestCase;

class Autologon_Plugin extends TestCase
{
public static function setUpBeforeClass(): void
{
Expand Down
4 changes: 3 additions & 1 deletion plugins/autologout/tests/Autologout.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php

class Autologout_Plugin extends PHPUnit\Framework\TestCase
use PHPUnit\Framework\TestCase;

class Autologout_Plugin extends TestCase
{
public static function setUpBeforeClass(): void
{
Expand Down
4 changes: 3 additions & 1 deletion plugins/database_attachments/tests/DatabaseAttachments.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php

class DatabaseAttachments_Plugin extends PHPUnit\Framework\TestCase
use PHPUnit\Framework\TestCase;

class DatabaseAttachments_Plugin extends TestCase
{
public static function setUpBeforeClass(): void
{
Expand Down
4 changes: 3 additions & 1 deletion plugins/debug_logger/tests/DebugLogger.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php

class DebugLogger_Plugin extends PHPUnit\Framework\TestCase
use PHPUnit\Framework\TestCase;

class DebugLogger_Plugin extends TestCase
{
public static function setUpBeforeClass(): void
{
Expand Down
4 changes: 3 additions & 1 deletion plugins/emoticons/tests/Emoticons.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php

class Emoticons_Plugin extends PHPUnit\Framework\TestCase
use PHPUnit\Framework\TestCase;

class Emoticons_Plugin extends TestCase
{
public static function setUpBeforeClass(): void
{
Expand Down
2 changes: 1 addition & 1 deletion plugins/enigma/lib/enigma_driver_phpssl.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ private function parse_sig_cert($file, $validity)

$data = new enigma_signature();

$data->id = $cert['hash']; //?
$data->id = $cert['hash']; // ?
$data->valid = $validity;
$data->fingerprint = $cert['serialNumber'];
$data->created = $cert['validFrom_time_t'];
Expand Down
4 changes: 3 additions & 1 deletion plugins/enigma/tests/Enigma.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php

class Enigma_Plugin extends PHPUnit\Framework\TestCase
use PHPUnit\Framework\TestCase;

class Enigma_Plugin extends TestCase
{
protected function setUp(): void
{
Expand Down
4 changes: 3 additions & 1 deletion plugins/enigma/tests/EnigmaDriverGnupg.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php

class Enigma_EnigmaDriverGnupg extends PHPUnit\Framework\TestCase
use PHPUnit\Framework\TestCase;

class Enigma_EnigmaDriverGnupg extends TestCase
{
public static function setUpBeforeClass(): void
{
Expand Down
4 changes: 3 additions & 1 deletion plugins/enigma/tests/EnigmaEngine.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php

class Enigma_EnigmaEngine extends PHPUnit\Framework\TestCase
use PHPUnit\Framework\TestCase;

class Enigma_EnigmaEngine extends TestCase
{
public static function setUpBeforeClass(): void
{
Expand Down
4 changes: 3 additions & 1 deletion plugins/enigma/tests/EnigmaError.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php

class Enigma_EnigmaError extends PHPUnit\Framework\TestCase
use PHPUnit\Framework\TestCase;

class Enigma_EnigmaError extends TestCase
{
public static function setUpBeforeClass(): void
{
Expand Down
4 changes: 3 additions & 1 deletion plugins/enigma/tests/EnigmaKey.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php

class Enigma_EnigmaKey extends PHPUnit\Framework\TestCase
use PHPUnit\Framework\TestCase;

class Enigma_EnigmaKey extends TestCase
{
public static function setUpBeforeClass(): void
{
Expand Down
4 changes: 3 additions & 1 deletion plugins/enigma/tests/EnigmaMimeMessage.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php

class Enigma_EnigmaMimeMessage extends PHPUnit\Framework\TestCase
use PHPUnit\Framework\TestCase;

class Enigma_EnigmaMimeMessage extends TestCase
{
public static function setUpBeforeClass(): void
{
Expand Down
4 changes: 3 additions & 1 deletion plugins/enigma/tests/EnigmaSignature.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php

class Enigma_EnigmaSignature extends PHPUnit\Framework\TestCase
use PHPUnit\Framework\TestCase;

class Enigma_EnigmaSignature extends TestCase
{
public static function setUpBeforeClass(): void
{
Expand Down
4 changes: 3 additions & 1 deletion plugins/enigma/tests/EnigmaSubkey.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php

class Enigma_EnigmaSubkey extends PHPUnit\Framework\TestCase
use PHPUnit\Framework\TestCase;

class Enigma_EnigmaSubkey extends TestCase
{
public static function setUpBeforeClass(): void
{
Expand Down
4 changes: 3 additions & 1 deletion plugins/enigma/tests/EnigmaUserid.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php

class Enigma_EnigmaUserid extends PHPUnit\Framework\TestCase
use PHPUnit\Framework\TestCase;

class Enigma_EnigmaUserid extends TestCase
{
public static function setUpBeforeClass(): void
{
Expand Down
4 changes: 3 additions & 1 deletion plugins/example_addressbook/tests/ExampleAddressbook.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php

class ExampleAddressbook_Plugin extends PHPUnit\Framework\TestCase
use PHPUnit\Framework\TestCase;

class ExampleAddressbook_Plugin extends TestCase
{
public static function setUpBeforeClass(): void
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php

class FilesystemAttachments_Plugin extends PHPUnit\Framework\TestCase
use PHPUnit\Framework\TestCase;

class FilesystemAttachments_Plugin extends TestCase
{
public static function setUpBeforeClass(): void
{
Expand Down
4 changes: 3 additions & 1 deletion plugins/help/tests/Help.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php

class Help_Plugin extends PHPUnit\Framework\TestCase
use PHPUnit\Framework\TestCase;

class Help_Plugin extends TestCase
{
public static function setUpBeforeClass(): void
{
Expand Down
4 changes: 3 additions & 1 deletion plugins/hide_blockquote/tests/HideBlockquote.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php

class HideBlockquote_Plugin extends PHPUnit\Framework\TestCase
use PHPUnit\Framework\TestCase;

class HideBlockquote_Plugin extends TestCase
{
public static function setUpBeforeClass(): void
{
Expand Down
4 changes: 3 additions & 1 deletion plugins/http_authentication/tests/HttpAuthentication.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php

class HttpAuthentication_Plugin extends PHPUnit\Framework\TestCase
use PHPUnit\Framework\TestCase;

class HttpAuthentication_Plugin extends TestCase
{
public static function setUpBeforeClass(): void
{
Expand Down
4 changes: 3 additions & 1 deletion plugins/identicon/tests/Identicon.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php

class Identicon_Plugin extends PHPUnit\Framework\TestCase
use PHPUnit\Framework\TestCase;

class Identicon_Plugin extends TestCase
{
public static function setUpBeforeCLass(): void
{
Expand Down
4 changes: 3 additions & 1 deletion plugins/identicon/tests/IdenticonEngine.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php

class Identicon_IdenticonEngine extends PHPUnit\Framework\TestCase
use PHPUnit\Framework\TestCase;

class Identicon_IdenticonEngine extends TestCase
{
public static function setUpBeforeClass(): void
{
Expand Down
Loading

0 comments on commit 54f4aa3

Please sign in to comment.