Issues (56)

Security Analysis    no request data  

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

  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.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  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.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  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.
  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.
  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.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
  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.
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  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.
  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.
  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.
  Header Injection
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/Scalp/Utils/Failure.php (1 issue)

Labels
Severity
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Scalp\Utils;
6
7
use function Scalp\None;
8
use Scalp\Option;
9
use function Scalp\Type\restrictCallableReturnType;
0 ignored issues
show
The type Scalp\Type\restrictCallableReturnType was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
10
11
final class Failure extends TryCatch
12
{
13
    private $error;
14
15
    public function __construct(\Throwable $error)
16
    {
17
        $this->error = $error;
18
    }
19
20
    public function isFailure(): bool
21
    {
22
        return true;
23
    }
24
25
    public function isSuccess(): bool
26
    {
27
        return false;
28
    }
29
30
    public function getOrElse($default)
31
    {
32
        return $default;
33
    }
34
35
    public function orElse(TryCatch $default): TryCatch
36
    {
37
        return $default;
38
    }
39
40
    public function get(): void
41
    {
42
        throw $this->error;
43
    }
44
45
    public function foreach(callable $f): void
46
    {
47
    }
48
49
    public function flatMap(callable $f): TryCatch
50
    {
51
        return $this;
52
    }
53
54
    public function map(callable $f): TryCatch
55
    {
56
        return $this;
57
    }
58
59
    public function filter(callable $p): TryCatch
60
    {
61
        return $this;
62
    }
63
64
    public function recoverWith(callable $pf): TryCatch
65
    {
66
        restrictCallableReturnType($pf, TryCatch::class);
67
68
        try {
69
            return $pf($this->error);
70
        } catch (\Throwable $error) {
71
            return Failure($error);
72
        }
73
    }
74
75
    public function recover(callable $pf): TryCatch
76
    {
77
        try {
78
            return Success($pf($this->error));
79
        } catch (\Throwable $error) {
80
            return Failure($error);
81
        }
82
    }
83
84
    public function toOption(): Option
85
    {
86
        return None();
87
    }
88
89
    public function flatten(): TryCatch
90
    {
91
        return $this;
92
    }
93
94
    public function failed(): TryCatch
95
    {
96
        return Success($this->error);
97
    }
98
99
    public function transform(callable $s, callable $f): TryCatch
100
    {
101
        return $this->recoverWith($f);
102
    }
103
104
    public function fold(callable $fa, callable $fb)
105
    {
106
        return $fa($this->error);
107
    }
108
109
    public function __toString(): string
110
    {
111
        return sprintf('Failure[%s]("%s")', get_class($this->error), $this->error->getMessage());
112
    }
113
}
114