Issues (89)

Security Analysis    not enabled

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.

Provider/AbstractProvider.php (1 issue)

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 DoS\ResourceBundle\Provider;
4
5
use Doctrine\Common\Persistence\ObjectManager;
6
use Sylius\Component\Resource\Factory\FactoryInterface;
7
use Sylius\Component\Resource\Model\ResourceInterface;
8
use Sylius\Component\Resource\Repository\RepositoryInterface;
9
10
/**
11
 * @author liverbool <[email protected]>
12
 */
13
abstract class AbstractProvider implements ProviderInterface
14
{
15
    /**
16
     * @var ObjectManager
17
     */
18
    protected $manager;
19
20
    /**
21
     * @var string
22
     */
23
    protected $dataClass;
24
25
    /**
26
     * @var RepositoryInterface
27
     */
28
    protected $repository;
29
30
    /**
31
     * @var FactoryInterface
32
     */
33
    protected $factory;
34
35
    public function __construct(
36
        RepositoryInterface $repository,
37
        FactoryInterface $factory,
38
        ObjectManager $manager = null,
39
        $dataClass = null
40
    ) {
41
        $this->repository = $repository;
42
        $this->factory = $factory;
43
        $this->manager = $manager ?: $repository->getManager();
44
        $this->dataClass = $dataClass ?: $repository->getEntityName();
45
    }
46
47
    /**
48
     * @return ResourceInterface
49
     */
50
    public function createNew()
51
    {
52
        return $this->factory->createNew();
53
    }
54
55
    /**
56
     * @param ResourceInterface $resource
57
     */
58
    public function persist(ResourceInterface $resource)
59
    {
60
        $this->manager->persist($resource);
61
    }
62
63
    /**
64
     * @param ResourceInterface|null $resource
65
     */
66
    public function flush(ResourceInterface $resource = null)
67
    {
68
        $this->manager->flush($resource);
69
    }
70
71
    /**
72
     * @param ResourceInterface $resource
73
     * @param bool $single
74
     */
75
    public function save(ResourceInterface $resource, $single = false)
76
    {
77
        $this->manager->persist($resource);
78
        $this->manager->flush($single ? $resource : null);
79
    }
80
81
    /**
82
     * @param ResourceInterface $resource
83
     */
84
    public function detach(ResourceInterface $resource)
85
    {
86
        $this->manager->detach($resource);
87
    }
88
89
    /**
90
     * @param ResourceInterface $resource
91
     */
92
    public function remove(ResourceInterface $resource)
93
    {
94
        $this->manager->remove($resource);
95
    }
96
97
    /**
98
     * @param null $objectName
99
     */
100
    public function clear($objectName = null)
101
    {
102
        $this->manager->clear($objectName);
103
    }
104
105
    /**
106
     * @param $id
107
     *
108
     * @return ResourceInterface
109
     */
110
    public function find($id)
111
    {
112
        return $this->repository->find($id);
113
    }
114
115
    /**
116
     * @return ResourceInterface[]
117
     */
118
    public function findAll()
119
    {
120
        return $this->repository->findAll();
121
    }
122
123
    /**
124
     * @param array $criteria
125
     * @param array|null $orderBy
126
     * @param null $limit
127
     * @param null $offset
128
     *
129
     * @return ResourceInterface[]
130
     */
131
    public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
132
    {
133
        return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
134
    }
135
136
    /**
137
     * @param array $criteria
138
     *
139
     * @return ResourceInterface[]
140
     */
141
    public function findOneBy(array $criteria)
142
    {
143
        return $this->repository->findOneBy($criteria);
0 ignored issues
show
Bug Compatibility introduced by
The expression $this->repository->findOneBy($criteria); of type object|null adds the type object to the return on line 143 which is incompatible with the return type declared by the interface DoS\ResourceBundle\Provi...derInterface::findOneBy of type Sylius\Component\Resourc...del\ResourceInterface[].
Loading history...
144
    }
145
}
146