Issues (126)

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.

src/Db/EntityRepo.php (4 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
declare(strict_types=1);
3
/**
4
 * Minotaur
5
 *
6
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
7
 * use this file except in compliance with the License. You may obtain a copy of
8
 * the License at
9
 *
10
 * http://www.apache.org/licenses/LICENSE-2.0
11
 *
12
 * Unless required by applicable law or agreed to in writing, software
13
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15
 * License for the specific language governing permissions and limitations under
16
 * the License.
17
 *
18
 * @copyright 2015-2017 Appertly
19
 * @license   Apache-2.0
20
 */
21
namespace Minotaur\Db;
22
23
/**
24
 * Basic interface for entity services.
25
 */
26
interface EntityRepo
27
{
28
    /**
29
     * Gets the type of entity produced, mainly for ACL reasons.
30
     *
31
     * @return string The entity type
32
     */
33
    public function getType(): string;
34
35
    /**
36
     * Gets a Map that relates identifier to instance
37
     *
38
     * @param iterable<mixed> $entities The entities to "zip"
0 ignored issues
show
The doc-type iterable<mixed> could not be parsed: Expected "|" or "end of type", but got "<" at position 8. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
39
     * @return array<string,mixed> The instances keyed by identifier
40
     */
41
    public function getInstanceMap(iterable $entities): array;
42
43
    /**
44
     * Finds a single record by some arbitrary criteria.
45
     *
46
     * @param array<string,mixed> $criteria Field to value pairs
47
     * @return mixed|null The object found or null if none
48
     * @throws \Caridea\Dao\Exception\Unreachable If the connection fails
49
     * @throws \Caridea\Dao\Exception\Unretrievable If the result cannot be returned
50
     * @throws \Caridea\Dao\Exception\Generic If any other database problem occurs
51
     */
52
    public function findOne(array $criteria);
53
54
    /**
55
     * Counts several records by some arbitrary criteria.
56
     *
57
     * @param array<string,mixed> $criteria Field to value pairs
58
     * @return int The count of the documents
59
     * @throws \Caridea\Dao\Exception\Unreachable If the connection fails
60
     * @throws \Caridea\Dao\Exception\Unretrievable If the result cannot be returned
61
     * @throws \Caridea\Dao\Exception\Generic If any other database problem occurs
62
     */
63
    public function countAll(array $criteria): int;
64
65
    /**
66
     * Finds several records by some arbitrary criteria.
67
     *
68
     * @param array<string,mixed> $criteria Field to value pairs
69
     * @param $pagination - Optional pagination parameters
70
     * @param bool $totalCount Return a `CursorSubset` that includes the total
71
     *        number of records. This is only done if `$pagination` is not using
72
     *        the defaults.
73
     * @return iterable<mixed> The objects found or null if none
0 ignored issues
show
The doc-type iterable<mixed> could not be parsed: Expected "|" or "end of type", but got "<" at position 8. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
74
     * @throws \Caridea\Dao\Exception\Unreachable If the connection fails
75
     * @throws \Caridea\Dao\Exception\Unretrievable If the result cannot be returned
76
     * @throws \Caridea\Dao\Exception\Generic If any other database problem occurs
77
     */
78
    public function findAll(array $criteria, \Caridea\Http\Pagination $pagination = null, bool $totalCount = false): iterable;
79
80
    /**
81
     * Gets a single document by ID.
82
     *
83
     * @param $id - The document identifier
84
     * @return mixed|null The entity, or `null`
85
     * @throws \Caridea\Dao\Exception\Unreachable If the connection fails
86
     * @throws \Caridea\Dao\Exception\Unretrievable If the result cannot be returned
87
     * @throws \Caridea\Dao\Exception\Generic If any other database problem occurs
88
     */
89
    public function findById($id);
90
91
    /**
92
     * Gets a single document by ID, throwing an exception if it's not found.
93
     *
94
     * @param $id - The document identifier
95
     * @return mixed The entity, never `null`.
96
     * @throws \Caridea\Dao\Exception\Unreachable If the connection fails
97
     * @throws \Caridea\Dao\Exception\Unretrievable If the document doesn't exist
98
     * @throws \Caridea\Dao\Exception\Generic If any other database problem occurs
99
     */
100
    public function get($id);
101
102
    /**
103
     * Gets several documents by ID.
104
     *
105
     * @param iterable<mixed> $ids List of identifiers
0 ignored issues
show
The doc-type iterable<mixed> could not be parsed: Expected "|" or "end of type", but got "<" at position 8. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
106
     * @return iterable<mixed> The results
0 ignored issues
show
The doc-type iterable<mixed> could not be parsed: Expected "|" or "end of type", but got "<" at position 8. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
107
     * @throws \Caridea\Dao\Exception\Unreachable If the connection fails
108
     * @throws \Caridea\Dao\Exception\Unretrievable If the result cannot be returned
109
     * @throws \Caridea\Dao\Exception\Generic If any other database problem occurs
110
     */
111
    public function getAll(iterable $ids): iterable;
112
}
113