1
0
mirror of https://github.com/postfixadmin/postfixadmin.git synced 2025-07-28 11:41:57 +03:00

phpcs wants to change ...

This commit is contained in:
David Goodwin
2021-03-22 09:28:28 +00:00
parent 4f1ef668d9
commit 823f27b29d
51 changed files with 106 additions and 53 deletions

View File

@ -1,7 +1,8 @@
<?php
# $Id$
class AdminHandler extends PFAHandler {
class AdminHandler extends PFAHandler
{
protected $db_table = 'admin';
protected $id_field = 'username';

View File

@ -1,7 +1,8 @@
<?php
# $Id$
class AdminpasswordHandler extends PFAHandler {
class AdminpasswordHandler extends PFAHandler
{
protected $db_table = 'admin';
protected $id_field = 'username';

View File

@ -4,7 +4,8 @@
/**
* Handlers User level alias actions - e.g. add alias, get aliases, update etc.
*/
class AliasHandler extends PFAHandler {
class AliasHandler extends PFAHandler
{
protected $db_table = 'alias';
protected $id_field = 'address';
protected $domain_field = 'domain';

View File

@ -4,7 +4,8 @@
/**
* Handlers User level alias actions - e.g. add alias, get aliases, update etc.
*/
class AliasdomainHandler extends PFAHandler {
class AliasdomainHandler extends PFAHandler
{
protected $db_table = 'alias_domain';
protected $id_field = 'alias_domain';
protected $domain_field = 'alias_domain';

View File

@ -4,7 +4,8 @@
* class to handle 'delete' in Cli
*/
class CliDelete extends Shell {
class CliDelete extends Shell
{
/**
* Execution method always used for tasks

View File

@ -6,7 +6,8 @@
*
* extends the "Shell" class
*/
class CliEdit extends Shell {
class CliEdit extends Shell
{
public $handler_to_use = "";
public $new = 0;

View File

@ -1,7 +1,8 @@
<?php
# $Id$
class CliHelp extends Shell {
class CliHelp extends Shell
{
public $handler_to_use = "__not_set__";
/**

View File

@ -6,7 +6,8 @@
* extends the "Shell" class
*/
class CliScheme extends Shell {
class CliScheme extends Shell
{
public $handler_to_use = "";
public $new = 0;

View File

@ -4,7 +4,8 @@
* class to handle 'view' in Cli
*/
class CliView extends Shell {
class CliView extends Shell
{
/**
* Execution method always used for tasks

View File

@ -3,7 +3,8 @@
# This class is too static - if you inherit a class from it, it will share the static $instance and all its contents
# Therefore the class is marked as final to prevent someone accidently does this ;-)
final class Config {
final class Config
{
private static $instance = null;
/**

View File

@ -4,7 +4,8 @@
/**
* Handlers User level alias actions - e.g. add alias, get aliases, update etc.
*/
class DomainHandler extends PFAHandler {
class DomainHandler extends PFAHandler
{
protected $db_table = 'domain';
protected $id_field = 'domain';
protected $domain_field = 'domain';

View File

@ -4,7 +4,8 @@
/**
* Handler for fetchmail jobs
*/
class FetchmailHandler extends PFAHandler {
class FetchmailHandler extends PFAHandler
{
protected $db_table = 'fetchmail';
protected $id_field = 'id';
protected $domain_field = 'domain';

View File

@ -1,6 +1,7 @@
<?php
class Login {
class Login
{
private $key_table;
private $table;

View File

@ -4,7 +4,8 @@
/**
* Simple class to represent a user.
*/
class MailboxHandler extends PFAHandler {
class MailboxHandler extends PFAHandler
{
protected $db_table = 'mailbox';
protected $id_field = 'username';
protected $domain_field = 'domain';

View File

@ -1,5 +1,6 @@
<?php
abstract class PFAHandler {
abstract class PFAHandler
{
/**
* public variables

View File

@ -3,7 +3,8 @@
/**
* Turn on sanitisation of all data by default so it's not possible for XSS flaws to occur in PFA
*/
class PFASmarty {
class PFASmarty
{
public static $instance = null;
/**
* @var Smarty

View File

@ -29,7 +29,8 @@
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
class Shell {
class Shell
{
/**
* An instance of the ShellDispatcher object that loaded this script
*

View File

@ -1,7 +1,8 @@
<?php
# $Id$
class VacationHandler extends PFAHandler {
class VacationHandler extends PFAHandler
{
/**
* @var string

View File

@ -348,7 +348,8 @@ for ($i = 0; $i < sizeof($tMailbox); $i++) {
class cNav_bar {
class cNav_bar
{
protected $count;
protected $title;
protected $limit;

View File

@ -66,7 +66,8 @@ if (!isset($_SESSION['authenticated'])) {
echo $server->handle();
class UserProxy {
class UserProxy
{
/**
* @param string $old_password
@ -105,7 +106,8 @@ class UserProxy {
}
}
class VacationProxy {
class VacationProxy
{
/**
* @return boolean true if the vacation is removed successfully. Else false.
*/
@ -154,7 +156,8 @@ class VacationProxy {
}
}
class AliasProxy {
class AliasProxy
{
/**
* @return array - array of aliases this user has. Array may be empty.
*/

View File

@ -33,7 +33,8 @@
*/
class PostfixAdmin {
class PostfixAdmin
{
/**
* Version
*

View File

@ -1,6 +1,7 @@
<?php
class Crypt {
class Crypt
{
/**
* @access private

View File

@ -9,7 +9,8 @@ define('LM_HASH_SIZE', 16);
define('NTLMSSP_HASH_SIZE', 16);
class DovecotCrypt extends Crypt {
class DovecotCrypt extends Crypt
{
private $errormsg = [];
private $salt_chars = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";

View File

@ -1,6 +1,7 @@
<?php
class AdminHandlerTest extends \PHPUnit\Framework\TestCase {
class AdminHandlerTest extends \PHPUnit\Framework\TestCase
{
public function setUp() : void {
parent::setUp();

View File

@ -1,6 +1,7 @@
<?php
class AdminpasswordHandlerTest extends \PHPUnit\Framework\TestCase {
class AdminpasswordHandlerTest extends \PHPUnit\Framework\TestCase
{
public function testBasic() {
$x = new AdminpasswordHandler();

View File

@ -1,6 +1,7 @@
<?php
class AliasHandlerTest extends \PHPUnit\Framework\TestCase {
class AliasHandlerTest extends \PHPUnit\Framework\TestCase
{
protected function setUp(): void {
// Fake being an admin.
$_SESSION = [

View File

@ -1,6 +1,7 @@
<?php
class AliasdomainHandlerTest extends \PHPUnit\Framework\TestCase {
class AliasdomainHandlerTest extends \PHPUnit\Framework\TestCase
{
public function testBasic() {
$x = new AliasdomainHandler();

View File

@ -4,7 +4,8 @@
/**
* Obviously replies on working DNS service
*/
class CheckDomainTest extends \PHPUnit\Framework\TestCase {
class CheckDomainTest extends \PHPUnit\Framework\TestCase
{
public function testBasic() {
$this->assertEquals('', check_domain('example.com'));
$this->assertEquals('', check_domain('google.com'));

View File

@ -3,7 +3,8 @@
/**
* Obviously relies on working DNS service etc.
*/
class CheckEmailTest extends \PHPUnit\Framework\TestCase {
class CheckEmailTest extends \PHPUnit\Framework\TestCase
{
public function testBasic() {
$this->assertEquals('', check_email('test@example.com'));
$this->assertRegExp('/ not discoverable in DNS/', check_email('test@fishbeansblahblahblah' . uniqid() . '.com'));

View File

@ -1,6 +1,7 @@
<?php
class CheckLanguageTest extends \PHPUnit\Framework\TestCase {
class CheckLanguageTest extends \PHPUnit\Framework\TestCase
{
public function testBasic() {
global $supported_languages;

View File

@ -1,6 +1,7 @@
<?php
class CheckOwnerTest extends \PHPUnit\Framework\TestCase {
class CheckOwnerTest extends \PHPUnit\Framework\TestCase
{
public function testBasic() {
$check = check_owner('random@example.com', 'test.com');
$this->assertFalse($check, "there should be no entries in test.com as it's an invalid/non-existant domain");

View File

@ -1,6 +1,7 @@
<?php
class ConfigTest extends \PHPUnit\Framework\TestCase {
class ConfigTest extends \PHPUnit\Framework\TestCase
{
public function setUp() : void {
$c = Config::getInstance();

View File

@ -1,6 +1,7 @@
<?php
class CreatePageBrowserTest extends \PHPUnit\Framework\TestCase {
class CreatePageBrowserTest extends \PHPUnit\Framework\TestCase
{
public function tearDown() : void {
$this->cleanup();
}

View File

@ -1,6 +1,7 @@
<?php
class DbBasicTest extends \PHPUnit\Framework\TestCase {
class DbBasicTest extends \PHPUnit\Framework\TestCase
{
private $test_domain;
public function setUp() : void {

View File

@ -1,6 +1,7 @@
<?php
class DomainHandlerTest extends \PHPUnit\Framework\TestCase {
class DomainHandlerTest extends \PHPUnit\Framework\TestCase
{
public function testBasic() {
$x = new DomainHandler();

View File

@ -1,6 +1,7 @@
<?php
class FetchmailHandlerTest extends \PHPUnit\Framework\TestCase {
class FetchmailHandlerTest extends \PHPUnit\Framework\TestCase
{
public function testBasic() {
$x = new FetchmailHandler();

View File

@ -1,6 +1,7 @@
<?php
class GeneratePasswordTest extends \PHPUnit\Framework\TestCase {
class GeneratePasswordTest extends \PHPUnit\Framework\TestCase
{
public function testBasic() {
$one = generate_password();

View File

@ -1,6 +1,7 @@
<?php
class GetSiteUrlTest extends \PHPUnit\Framework\TestCase {
class GetSiteUrlTest extends \PHPUnit\Framework\TestCase
{
public function testControlViaConfig() {
$server = [];
$orig = Config::getInstance()->getAll();

View File

@ -1,6 +1,7 @@
<?php
class ListAdminsTest extends \PHPUnit\Framework\TestCase {
class ListAdminsTest extends \PHPUnit\Framework\TestCase
{
public function testBasic() {
$list= list_admins();

View File

@ -1,6 +1,7 @@
<?php
class ListDomainsForAdminTest extends \PHPUnit\Framework\TestCase {
class ListDomainsForAdminTest extends \PHPUnit\Framework\TestCase
{
public function testBasic() {
$this->assertEquals([], list_domains_for_admin('test@test.com'));
}

View File

@ -1,6 +1,7 @@
<?php
class ListDomainsTest extends \PHPUnit\Framework\TestCase {
class ListDomainsTest extends \PHPUnit\Framework\TestCase
{
public function testBasic() {
$domains = list_domains();

View File

@ -1,6 +1,7 @@
<?php
class LoginTest extends \PHPUnit\Framework\TestCase {
class LoginTest extends \PHPUnit\Framework\TestCase
{
public function setUp(): void {
global $CONF;

View File

@ -1,6 +1,7 @@
<?php
class MailboxHandlerTest extends \PHPUnit\Framework\TestCase {
class MailboxHandlerTest extends \PHPUnit\Framework\TestCase
{
public function tearDown() : void {
db_query('DELETE FROM mailbox');
db_query('DELETE FROM alias');

View File

@ -1,6 +1,7 @@
<?php
class PaCryptTest extends \PHPUnit\Framework\TestCase {
class PaCryptTest extends \PHPUnit\Framework\TestCase
{
public function testMd5Crypt() {
$hash = _pacrypt_md5crypt('test', '');

View File

@ -1,6 +1,7 @@
<?php
class PasswordValidationCallableTEst extends \PHPUnit\Framework\TestCase {
class PasswordValidationCallableTEst extends \PHPUnit\Framework\TestCase
{
public function setUp(): void {
$c = Config::getInstance();

View File

@ -7,7 +7,8 @@
require_once('RemoteTest.php');
class RemoteAliasTest extends RemoteTest {
class RemoteAliasTest extends RemoteTest
{
public function __construct() {
parent::__construct();
global $CONF;

View File

@ -1,6 +1,7 @@
<?php
abstract class RemoteTest extends \PHPUnit\Framework\TestCase {
abstract class RemoteTest extends \PHPUnit\Framework\TestCase
{
protected $server_url = 'http://change.me/to/work'; // http://orange/david/postfixadmin/xmlrpc.php';
protected $username = 'user@example.com';
protected $password = 'password1';

View File

@ -7,7 +7,8 @@
require_once('RemoteTest.php');
class RemoteUserTest extends RemoteTest {
class RemoteUserTest extends RemoteTest
{
public function testChangePassword() {
$this->assertTrue($this->user->login($this->username, $this->password));
$this->assertTrue($this->user->changePassword($this->password, 'foobar'));

View File

@ -7,7 +7,8 @@
require_once('RemoteTest.php');
class RemoteVacationTest extends RemoteTest {
class RemoteVacationTest extends RemoteTest
{
/**

View File

@ -1,6 +1,7 @@
<?php
class RemoveFromArrayTest extends \PHPUnit\Framework\TestCase {
class RemoveFromArrayTest extends \PHPUnit\Framework\TestCase
{
public function testBasic() {
$list = array('a','b','c','d');

View File

@ -1,6 +1,7 @@
<?php
class ValidatePasswordTest extends \PHPUnit\Framework\TestCase {
class ValidatePasswordTest extends \PHPUnit\Framework\TestCase
{
public function testBasic() {
$config = Config::getInstance();