Issues (7)

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/Specifying.php (7 issues)

1
<?php
2
3
declare(strict_types = 1);
4
5
namespace Stratadox\Specification;
6
7
use Stratadox\Specification\Binary\AndSpecification;
8
use Stratadox\Specification\Binary\OrSpecification;
9
use Stratadox\Specification\Binary\XorSpecification;
10
use Stratadox\Specification\Contract\Satisfiable;
11
use Stratadox\Specification\Contract\Specifies;
12
use Stratadox\Specification\Unary\NotSpecification;
13
14
trait Specifying
15
{
16
    /** @see Specifies::not() */
17
    public function not() : Specifies
18
    {
19
        /** @var Specifying|Satisfiable $this */
20
        return $this->doesNotSatisfy($this);
0 ignored issues
show
The method doesNotSatisfy() does not exist on Stratadox\Specification\Contract\Satisfiable. It seems like you code against a sub-type of Stratadox\Specification\Contract\Satisfiable such as Stratadox\Specification\Specification or Stratadox\Specification\Binary\BinarySpecification or Stratadox\Specification\Unary\UnarySpecification. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

20
        return $this->/** @scrutinizer ignore-call */ doesNotSatisfy($this);
Loading history...
It seems like $this can also be of type Stratadox\Specification\Specifying; however, parameter $condition of Stratadox\Specification\...fying::doesNotSatisfy() does only seem to accept Stratadox\Specification\Contract\Satisfiable, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

20
        return $this->doesNotSatisfy(/** @scrutinizer ignore-type */ $this);
Loading history...
21
    }
22
23
    /** @see Specifies::and() */
24
    public function and(Satisfiable $other) : Specifies
25
    {
26
        /** @var Specifying|Satisfiable $this */
27
        return $this->satisfiesBoth($this, $other);
0 ignored issues
show
The method satisfiesBoth() does not exist on Stratadox\Specification\Contract\Satisfiable. It seems like you code against a sub-type of Stratadox\Specification\Contract\Satisfiable such as Stratadox\Specification\Specification or Stratadox\Specification\Binary\BinarySpecification or Stratadox\Specification\Unary\UnarySpecification. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

27
        return $this->/** @scrutinizer ignore-call */ satisfiesBoth($this, $other);
Loading history...
It seems like $this can also be of type Stratadox\Specification\Specifying; however, parameter $firstCondition of Stratadox\Specification\...ifying::satisfiesBoth() does only seem to accept Stratadox\Specification\Contract\Satisfiable, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

27
        return $this->satisfiesBoth(/** @scrutinizer ignore-type */ $this, $other);
Loading history...
28
    }
29
30
    /** @see Specifies::or() */
31
    public function or(Satisfiable $other) : Specifies
32
    {
33
        /** @var Specifying|Satisfiable $this */
34
        return $this->oneOfThese($this, $other);
0 ignored issues
show
The method oneOfThese() does not exist on Stratadox\Specification\Contract\Satisfiable. It seems like you code against a sub-type of Stratadox\Specification\Contract\Satisfiable such as Stratadox\Specification\Specification or Stratadox\Specification\Binary\BinarySpecification or Stratadox\Specification\Unary\UnarySpecification. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

34
        return $this->/** @scrutinizer ignore-call */ oneOfThese($this, $other);
Loading history...
It seems like $this can also be of type Stratadox\Specification\Specifying; however, parameter $firstCondition of Stratadox\Specification\Specifying::oneOfThese() does only seem to accept Stratadox\Specification\Contract\Satisfiable, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

34
        return $this->oneOfThese(/** @scrutinizer ignore-type */ $this, $other);
Loading history...
35
    }
36
37
    /** @see Specifies::xor() */
38
    public function xor(Satisfiable $other) : Specifies
39
    {
40
        /** @var Specifying|Satisfiable $this */
41
        return new XorSpecification($this, $other);
0 ignored issues
show
It seems like $this can also be of type Stratadox\Specification\Specifying; however, parameter $leftHandCondition of Stratadox\Specification\...fication::__construct() does only seem to accept Stratadox\Specification\Contract\Satisfiable, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

41
        return new XorSpecification(/** @scrutinizer ignore-type */ $this, $other);
Loading history...
42
    }
43
44
    /** @see Specifies::nor() */
45
    public function nor(Satisfiable $other) : Specifies
46
    {
47
        return $this->not()->andNot($other);
48
    }
49
50
    /** @see Specifies::andNot() */
51
    public function andNot(Satisfiable $other) : Specifies
52
    {
53
        return $this->and($this->doesNotSatisfy($other));
54
    }
55
56
    /** @see Specifies::butNot() */
57
    public function butNot(Satisfiable $other) : Specifies
58
    {
59
        return $this->andNot($other);
60
    }
61
62
    /** @see Specifies::orNot() */
63
    public function orNot(Satisfiable $other) : Specifies
64
    {
65
        return $this->or($this->doesNotSatisfy($other));
66
    }
67
68
69
    // Private
70
71
72
    private function doesNotSatisfy(Satisfiable $condition) : Specifies
73
    {
74
        return new NotSpecification($condition);
75
    }
76
77
    private function satisfiesBoth(Satisfiable $firstCondition, Satisfiable $secondCondition) : Specifies
78
    {
79
        return new AndSpecification($firstCondition, $secondCondition);
80
    }
81
82
    private function oneOfThese(Satisfiable $firstCondition, Satisfiable $secondCondition) : Specifies
83
    {
84
        return new OrSpecification($firstCondition, $secondCondition);
85
    }
86
}
87