mosbth /
Anax-MVC
This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
| 1 | <?php |
||
| 2 | /** |
||
| 3 | * This is a Anax frontcontroller. |
||
| 4 | * |
||
| 5 | */ |
||
| 6 | |||
| 7 | // Get environment & autoloader. |
||
| 8 | require __DIR__.'/../config.php'; |
||
| 9 | |||
| 10 | // Create services and inject into the app. |
||
| 11 | $di = new \Anax\DI\CDIFactoryTest(); |
||
| 12 | $app = new \Anax\Kernel\CAnax($di); |
||
|
0 ignored issues
–
show
|
|||
| 13 | |||
| 14 | |||
| 15 | $di->set('TestController', function () use ($di) { |
||
| 16 | $controller = new TestController(); |
||
| 17 | $controller->setDI($di); |
||
| 18 | return $controller; |
||
| 19 | }); |
||
| 20 | |||
| 21 | |||
| 22 | class TestController |
||
| 23 | { |
||
| 24 | use \Anax\DI\TInjectable; |
||
| 25 | |||
| 26 | public function indexAction() |
||
| 27 | { |
||
| 28 | $this->theme->setTitle("Delegate view creation to other methods/actions and use forward"); |
||
|
0 ignored issues
–
show
The property
theme does not exist on object<TestController>. Since you implemented __get, maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. Loading history...
|
|||
| 29 | $this->views->add('default/page', [ |
||
|
0 ignored issues
–
show
The property
views does not exist on object<TestController>. Since you implemented __get, maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. Loading history...
|
|||
| 30 | 'title' => "Delegate view creation to other methods and use forward", |
||
| 31 | 'content' => "Add views by using forward. This page is built up by several views, combined in one controller/action but added using dispatcher->forward().", |
||
| 32 | ]); |
||
| 33 | |||
| 34 | $this->dispatcher->forward([ |
||
|
0 ignored issues
–
show
The property
dispatcher does not exist on object<TestController>. Since you implemented __get, maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. Loading history...
|
|||
| 35 | 'controller' => 'test', |
||
| 36 | 'action' => 'addView1', |
||
| 37 | ]); |
||
| 38 | |||
| 39 | $this->dispatcher->forward([ |
||
|
0 ignored issues
–
show
The property
dispatcher does not exist on object<TestController>. Since you implemented __get, maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. Loading history...
|
|||
| 40 | 'controller' => 'test', |
||
| 41 | 'action' => 'addView2', |
||
| 42 | 'params' => ["A_PARAMETER", "ANOTHER PARAM"], |
||
| 43 | ]); |
||
| 44 | |||
| 45 | $this->views->add('default/page', [ |
||
|
0 ignored issues
–
show
The property
views does not exist on object<TestController>. Since you implemented __get, maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. Loading history...
|
|||
| 46 | 'title' => "Last view", |
||
| 47 | 'content' => "This view is created in indexAction()", |
||
| 48 | ]); |
||
| 49 | } |
||
| 50 | |||
| 51 | public function addView1Action() |
||
| 52 | { |
||
| 53 | $this->views->add('default/page', [ |
||
|
0 ignored issues
–
show
The property
views does not exist on object<TestController>. Since you implemented __get, maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. Loading history...
|
|||
| 54 | 'title' => "View 1.1", |
||
| 55 | 'content' => "This view is created in addView1Action()", |
||
| 56 | ]); |
||
| 57 | |||
| 58 | $this->views->add('default/page', [ |
||
|
0 ignored issues
–
show
The property
views does not exist on object<TestController>. Since you implemented __get, maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. Loading history...
|
|||
| 59 | 'title' => "View 1.2", |
||
| 60 | 'content' => "This view is created in addView1Action()", |
||
| 61 | ]); |
||
| 62 | } |
||
| 63 | |||
| 64 | public function addView2Action($str1, $str2) |
||
| 65 | { |
||
| 66 | $this->views->add('default/page', [ |
||
|
0 ignored issues
–
show
The property
views does not exist on object<TestController>. Since you implemented __get, maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. Loading history...
|
|||
| 67 | 'title' => "View 2", |
||
| 68 | 'content' => "This view is created in addView1Action(), the parameter values are: $str1, $str2", |
||
| 69 | ]); |
||
| 70 | } |
||
| 71 | } |
||
| 72 | |||
| 73 | |||
| 74 | |||
| 75 | $app->router->add('', function () use ($app) { |
||
|
0 ignored issues
–
show
The property
router does not exist on object<Anax\Kernel\CAnax>. Since you implemented __get, maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. Loading history...
|
|||
| 76 | |||
| 77 | $app->dispatcher->forward(['controller' => 'test']); |
||
|
0 ignored issues
–
show
The property
dispatcher does not exist on object<Anax\Kernel\CAnax>. Since you implemented __get, maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. Loading history...
|
|||
| 78 | }); |
||
| 79 | |||
| 80 | |||
| 81 | // Check for matching routes and dispatch to controller/handler of route |
||
| 82 | $app->router->handle(); |
||
|
0 ignored issues
–
show
The property
router does not exist on object<Anax\Kernel\CAnax>. Since you implemented __get, maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. Loading history...
|
|||
| 83 | |||
| 84 | // Render the page |
||
| 85 | $app->theme->render(); |
||
|
0 ignored issues
–
show
The property
theme does not exist on object<Anax\Kernel\CAnax>. Since you implemented __get, maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. Loading history...
|
|||
| 86 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: