Failed Conditions
Pull Request — newinternal-bugfixing (#286)
by Simon
06:57 queued 03:32
created

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/******************************************************************************
3
 * Wikipedia Account Creation Assistance tool                                 *
4
 *                                                                            *
5
 * All code in this file is released into the public domain by the ACC        *
6
 * Development Team. Please see team.json for a list of contributors.         *
7
 ******************************************************************************/
8
9
namespace Waca;
10
11
use Waca\Router\ApiRequestRouter;
12
13
/*
14
 * Public interface script
15
 *
16
 * THIS IS AN ENTRY POINT
17
 */
18
19
require_once('config.inc.php');
20
21
global $siteConfiguration;
0 ignored issues
show
Compatibility Best Practice introduced by
Use of global functionality is not recommended; it makes your code harder to test, and less reusable.

Instead of relying on global state, we recommend one of these alternatives:

1. Pass all data via parameters

function myFunction($a, $b) {
    // Do something
}

2. Create a class that maintains your state

class MyClass {
    private $a;
    private $b;

    public function __construct($a, $b) {
        $this->a = $a;
        $this->b = $b;
    }

    public function myFunction() {
        // Do something
    }
}
Loading history...
22
$application = new WebStart($siteConfiguration, new ApiRequestRouter());
23
24
// This is a public interface
25
$application->setPublic(true);
26
27
$application->run();
28