Failed Conditions
Branch newinternal (104de7)
by Simon
09:33
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
namespace Waca;
3
4
use Waca\Router\PublicRequestRouter;
5
6
/*
7
 * Public interface script
8
 *
9
 * THIS IS AN ENTRY POINT
10
 */
11
12
require_once('config.inc.php');
13
14
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...
15
$application = new WebStart($siteConfiguration, new PublicRequestRouter());
16
17
// This is a public interface
18
$application->setPublic(true);
19
20
$application->run();
21