Issues (319)

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.

Module.php (2 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
 * @company MTE Telecom, Ltd.
4
 * @author Roman Malashin <[email protected]>
5
 */
6
7
namespace Nnx\DataGrid;
8
9
use Nnx\DataGrid\Column\GridColumnProviderInterface;
10
use Nnx\DataGrid\Mutator\GridMutatorProviderInterface;
11
use \Nnx\DataGrid\Button\GridButtonProviderInterface;
12
use Nnx\DataGrid\Options\ModuleOptions;
13
use Zend\EventManager\EventInterface;
14
use Zend\ModuleManager\Feature\AutoloaderProviderInterface;
15
use Zend\ModuleManager\Feature\BootstrapListenerInterface;
16
use Zend\ModuleManager\Feature\ConfigProviderInterface;
17
use Zend\ModuleManager\Feature\InitProviderInterface;
18
use Zend\ModuleManager\Feature\ServiceProviderInterface;
19
use Zend\ModuleManager\Listener\ServiceListenerInterface;
20
use Zend\ModuleManager\ModuleManager;
21
use Zend\ModuleManager\ModuleManagerInterface;
22
use Zend\Mvc\MvcEvent;
23
use Zend\ServiceManager\ServiceLocatorAwareInterface;
24
use Zend\ServiceManager\ServiceLocatorAwareTrait;
25
use Zend\ServiceManager\ServiceLocatorInterface;
26
27
/**
28
 * Class Module
29
 * @package Nnx\DataGrid
30
 */
31
class Module
32
    implements ServiceLocatorAwareInterface,
33
    ConfigProviderInterface,
34
    AutoloaderProviderInterface,
35
    BootstrapListenerInterface,
36
    ServiceProviderInterface,
37
    InitProviderInterface
38
{
39
40
    use ServiceLocatorAwareTrait;
41
42
    /**
43
     * Имя секции в конфигах приложения, содержащей настройки модуля
44
     *
45
     * @var string
46
     */
47
    const CONFIG_KEY = 'mteGrid';
48
49
    /**
50
     * Имя модуля
51
     *
52
     * @var string
53
     */
54
    const MODULE_NAME = __NAMESPACE__;
55
56
    /**
57
     * Получаем конфигурацию модуля
58
     * @return array
59
     */
60
    public function getConfig()
61
    {
62
        return require __DIR__ . '/config/module.config.php';
63
    }
64
65
    /**
66
     * Return an array for passing to Zend\Loader\AutoloaderFactory.
67
     *
68
     * @return array
69
     */
70
    public function getAutoloaderConfig()
71
    {
72
        $config = [];
73
        $autoloadFile = __DIR__ . '/autoload_classmap.php';
74
        if (file_exists($autoloadFile)) {
75
            $config['Zend\Loader\ClassMapAutoloader'] = [
76
                $autoloadFile
77
            ];
78
        }
79
        $config['Zend\Loader\StandardAutoloader'] = [
80
            'namespaces' => [
81
                __NAMESPACE__ => __DIR__ . '/src'
82
            ]
83
        ];
84
        return $config;
85
    }
86
87
    /**
88
     * Listen to the bootstrap event
89
     *
90
     * @param EventInterface $e
91
     * @return array
92
     */
93
    public function onBootstrap(EventInterface $e)
0 ignored issues
show
Comprehensibility introduced by
Avoid variables with short names like $e. Configured minimum length is 3.

Short variable names may make your code harder to understand. Variable names should be self-descriptive. This check looks for variable names who are shorter than a configured minimum.

Loading history...
94
    {
95
        /** @var MvcEvent $e */
96
        $this->setServiceLocator($e->getApplication()->getServiceManager());
97
    }
98
99
    /**
100
     * Expected to return \Zend\ServiceManager\Config object or array to
101
     * seed such an object.
102
     *
103
     * @return array|\Zend\ServiceManager\Config
104
     */
105
    public function getServiceConfig()
106
    {
107
        return [];
108
    }
109
110
    /**
111
     * Initialize workflow
112
     *
113
     * @param  ModuleManagerInterface $manager
114
     * @throws Exception\RuntimeException
115
     */
116
    public function init(ModuleManagerInterface $manager)
117
    {
118
        if (!$manager instanceof ModuleManager) {
119
            $errMsg =sprintf('Менеджер модулей должен реализовывать %s', ModuleManager::class);
120
            throw new Exception\RuntimeException($errMsg);
121
        }
122
        /** @var ModuleManager $manager */
123
124
        /** @var ServiceLocatorInterface $sm */
125
        $sm = $manager->getEvent()->getParam('ServiceManager');
0 ignored issues
show
Comprehensibility introduced by
Avoid variables with short names like $sm. Configured minimum length is 3.

Short variable names may make your code harder to understand. Variable names should be self-descriptive. This check looks for variable names who are shorter than a configured minimum.

Loading history...
126
127
        /** @var ServiceListenerInterface $serviceListener */
128
        $serviceListener = $sm->get('ServiceListener');
129
        $serviceListener->addServiceManager(
130
            'GridManager',
131
            'grid_manager',
132
            GridProviderInterface::class,
133
            'getGridConfig'
134
        );
135
136
        $serviceListener->addServiceManager(
137
            'GridColumnManager',
138
            'grid_columns',
139
            GridColumnProviderInterface::class,
140
            'getGridColumnConfig'
141
        );
142
        $serviceListener->addServiceManager(
143
            'GridMutatorManager',
144
            'grid_mutators',
145
            GridMutatorProviderInterface::class,
146
            'getGridMutatorConfig'
147
        );
148
        $serviceListener->addServiceManager(
149
            'GridButtonManager',
150
            'grid_buttons',
151
            GridButtonProviderInterface::class,
152
            'getGridButtonConfig'
153
        );
154
    }
155
156
    /**
157
     * Возвращает объект с настройками модуля
158
     *
159
     * @return ModuleOptions
160
     * @throws \Zend\ServiceManager\Exception\ServiceNotFoundException
161
     */
162
    public function getModuleOptions()
163
    {
164
        /** @var ModuleOptions $moduleOptions */
165
        return $this->getServiceLocator()->get('GridModuleOptions');
166
    }
167
}
168