Browse Source

phpcs wants to change ...

pull/483/head
David Goodwin 5 years ago
parent
commit
823f27b29d
  1. 3
      model/AdminHandler.php
  2. 3
      model/AdminpasswordHandler.php
  3. 3
      model/AliasHandler.php
  4. 3
      model/AliasdomainHandler.php
  5. 3
      model/CliDelete.php
  6. 3
      model/CliEdit.php
  7. 3
      model/CliHelp.php
  8. 3
      model/CliScheme.php
  9. 3
      model/CliView.php
  10. 3
      model/Config.php
  11. 3
      model/DomainHandler.php
  12. 3
      model/FetchmailHandler.php
  13. 3
      model/Login.php
  14. 3
      model/MailboxHandler.php
  15. 3
      model/PFAHandler.php
  16. 3
      model/PFASmarty.php
  17. 3
      model/Shell.php
  18. 3
      model/VacationHandler.php
  19. 3
      public/list-virtual.php
  20. 9
      public/xmlrpc.php
  21. 3
      scripts/postfixadmin-cli.php
  22. 3
      scripts/snippets/crypt.php
  23. 3
      scripts/snippets/dovecot_crypt.php
  24. 3
      tests/AdminHandlerTest.php
  25. 3
      tests/AdminpasswordHandlerTest.php
  26. 3
      tests/AliasHandlerTest.php
  27. 3
      tests/AliasdomainHandlerTest.php
  28. 3
      tests/CheckDomainTest.php
  29. 3
      tests/CheckEmailTest.php
  30. 3
      tests/CheckLanguageTest.php
  31. 3
      tests/CheckOwnerTest.php
  32. 3
      tests/ConfigTest.php
  33. 3
      tests/CreatePageBrowserTest.php
  34. 3
      tests/DbBasicTest.php
  35. 3
      tests/DomainHandlerTest.php
  36. 3
      tests/FetchmailHandlerTest.php
  37. 3
      tests/GeneratePasswordTest.php
  38. 3
      tests/GetSiteUrlTest.php
  39. 3
      tests/ListAdminsTest.php
  40. 3
      tests/ListDomainsForAdminTest.php
  41. 3
      tests/ListDomainsTest.php
  42. 3
      tests/LoginTest.php
  43. 3
      tests/MailboxHandlerTest.php
  44. 3
      tests/PacryptTest.php
  45. 3
      tests/PasswordValidationCallableTest.php
  46. 3
      tests/RemoteAliasTest.php
  47. 3
      tests/RemoteTest.php
  48. 3
      tests/RemoteUserTest.php
  49. 3
      tests/RemoteVacationTest.php
  50. 3
      tests/RemoveFromArrayTest.php
  51. 3
      tests/ValidatePasswordTest.php

3
model/AdminHandler.php

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

3
model/AdminpasswordHandler.php

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

3
model/AliasHandler.php

@ -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';

3
model/AliasdomainHandler.php

@ -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';

3
model/CliDelete.php

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

3
model/CliEdit.php

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

3
model/CliHelp.php

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

3
model/CliScheme.php

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

3
model/CliView.php

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

3
model/Config.php

@ -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;
/**

3
model/DomainHandler.php

@ -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';

3
model/FetchmailHandler.php

@ -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';

3
model/Login.php

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

3
model/MailboxHandler.php

@ -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';

3
model/PFAHandler.php

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

3
model/PFASmarty.php

@ -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

3
model/Shell.php

@ -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
*

3
model/VacationHandler.php

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

3
public/list-virtual.php

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

9
public/xmlrpc.php

@ -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.
*/

3
scripts/postfixadmin-cli.php

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

3
scripts/snippets/crypt.php

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

3
scripts/snippets/dovecot_crypt.php

@ -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";

3
tests/AdminHandlerTest.php

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

3
tests/AdminpasswordHandlerTest.php

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

3
tests/AliasHandlerTest.php

@ -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 = [

3
tests/AliasdomainHandlerTest.php

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

3
tests/CheckDomainTest.php

@ -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'));

3
tests/CheckEmailTest.php

@ -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'));

3
tests/CheckLanguageTest.php

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

3
tests/CheckOwnerTest.php

@ -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");

3
tests/ConfigTest.php

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

3
tests/CreatePageBrowserTest.php

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

3
tests/DbBasicTest.php

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

3
tests/DomainHandlerTest.php

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

3
tests/FetchmailHandlerTest.php

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

3
tests/GeneratePasswordTest.php

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

3
tests/GetSiteUrlTest.php

@ -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();

3
tests/ListAdminsTest.php

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

3
tests/ListDomainsForAdminTest.php

@ -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'));
}

3
tests/ListDomainsTest.php

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

3
tests/LoginTest.php

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

3
tests/MailboxHandlerTest.php

@ -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');

3
tests/PacryptTest.php

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

3
tests/PasswordValidationCallableTest.php

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

3
tests/RemoteAliasTest.php

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

3
tests/RemoteTest.php

@ -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';

3
tests/RemoteUserTest.php

@ -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'));

3
tests/RemoteVacationTest.php

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

3
tests/RemoveFromArrayTest.php

@ -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');

3
tests/ValidatePasswordTest.php

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

Loading…
Cancel
Save