Issues (4)

Security Analysis    no request data  

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

src/Helper/LegacyViewHelper.php (3 issues)

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
namespace Tworzenieweb\Helper;
4
5
use InvalidArgumentException;
6
use RuntimeException;
7
use Zend_View;
8
use Zend_View_Helper_Interface;
9
use Zend_View_Interface;
10
11
/**
12
 * @author Luke Adamczewski
13
 * @package Tworzenieweb\Helper
14
 */
15
class LegacyViewHelper extends Zend_View implements Zend_View_Helper_Interface
16
{
17
    /**
18
     * @var BCViewHelperInterface|callable
19
     */
20
    private $helper;
21
22
    /**
23
     * @var Zend_View_Interface
24
     */
25
    private $view;
26
27
    /**
28
     *
29
     * @param BCViewHelperInterface $helper
30
     */
31
    public function injectHelper(BCViewHelperInterface $helper)
32
    {
33
        $this->helper = $helper;
0 ignored issues
show
Documentation Bug introduced by
It seems like $helper of type object<Tworzenieweb\Helper\BCViewHelperInterface> is incompatible with the declared type callable of property $helper.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
34
    }
35
36
    /**
37
     * @return string
38
     */
39
    public function __invoke()
40
    {
41
        if (is_callable($this->helper)) {
42
            $helper = $this->helper;
43
44
            return $helper(func_get_args());
45
        }
46
47
        throw new RuntimeException(sprintf('Provided helper of class %s must be invokable', get_class($this->helper)));
48
    }
49
50
    /**
51
     * @param string $name
52
     * @param mixed $arguments
53
     *
54
     * @return mixed
55
     */
56
    public function __call($name, $arguments)
57
    {
58
        if ($name === $this->helper->getName()) {
0 ignored issues
show
The method getName cannot be called on $this->helper (of type callable).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
59
            $helper = $this->helper;
60
61
            return $helper($arguments);
62
        }
63
64
        throw new InvalidArgumentException(sprintf('Method %s is not exist', $name));
65
    }
66
67
    /**
68
     * @return string
69
     */
70
    public function getName()
71
    {
72
        return $this->helper->getName();
0 ignored issues
show
The method getName cannot be called on $this->helper (of type callable).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
73
    }
74
75
    /**
76
     * Set the View object
77
     *
78
     * @param  Zend_View_Interface $view
79
     *
80
     * @return Zend_View_Helper_Interface
81
     */
82
    public function setView(Zend_View_Interface $view)
83
    {
84
        $this->view = $view;
85
    }
86
87
    /**
88
     * Strategy pattern: helper method to invoke
89
     *
90
     * @return mixed
91
     */
92
    public function direct()
93
    {
94
    }
95
}