GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Issues (15)

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.

src/Entity/AbstractEntry.php (5 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
 * @link    https://github.com/old-town/workflow-doctrine
4
 * @author  Malofeykin Andrey  <[email protected]>
5
 */
6
namespace OldTown\Workflow\Spi\Doctrine\Entity;
7
8
use Doctrine\Common\Collections\ArrayCollection;
9
use Doctrine\ORM\Mapping as ORM;
10
11
12
/**
13
 * Class WorkflowName
14
 *
15
 * @ORM\Entity()
16
 * @ORM\Table(name="wf_entry")
17
 * @ORM\InheritanceType(value="SINGLE_TABLE")
18
 * @ORM\DiscriminatorColumn(name="type", type="string")
19
 *
20
 * @package OldTown\Workflow\Spi\Doctrine
21
 */
22
abstract class AbstractEntry implements EntryInterface
23
{
24
    /**
25
     * @ORM\Id()
26
     * @ORM\Column(name="id", type="integer")
27
     * @ORM\GeneratedValue(strategy="IDENTITY")
28
     *
29
     * @var string
30
     */
31
    protected $id;
32
33
    /**
34
     * @ORM\Column(name="workflow_name", type="string", length=60)
35
     *
36
     *
37
     * @var string
38
     */
39
    protected $workflowName;
40
41
    /**
42
     * @ORM\Column(name="state", type="integer")
43
     *
44
     *
45
     * @var integer
46
     */
47
    protected $state;
48
49
    /**
50
     * Шаги привязанные к процессу wf
51
     *
52
     * @ORM\OneToMany(targetEntity="Step", mappedBy="entry")
53
     *
54
     * @var StepInterface
55
     */
56
    protected $steps;
57
58
    /**
59
     * AbstractEntry constructor.
60
     */
61
    public function __construct()
62
    {
63
        $this->steps = new ArrayCollection();
0 ignored issues
show
Documentation Bug introduced by
It seems like new \Doctrine\Common\Collections\ArrayCollection() of type object<Doctrine\Common\C...ctions\ArrayCollection> is incompatible with the declared type object<OldTown\Workflow\...e\Entity\StepInterface> of property $steps.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
64
    }
65
66
    /**
67
     * @return string
68
     */
69
    public function getId()
70
    {
71
        return $this->id;
72
    }
73
74
    /**
75
     * @param string $id
76
     *
77
     * @return $this
78
     */
79
    public function setId($id)
80
    {
81
        $this->id = (integer)$id;
0 ignored issues
show
Documentation Bug introduced by
The property $id was declared of type string, but (int) $id is of type integer. Maybe add a type cast?

This check looks for assignments to scalar types that may be of the wrong type.

To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.

$answer = 42;

$correct = false;

$correct = (bool) $answer;
Loading history...
82
83
        return $this;
84
    }
85
86
    /**
87
     * @return string
88
     */
89
    public function getWorkflowName()
90
    {
91
        return $this->workflowName;
92
    }
93
94
    /**
95
     * @param string $workflowName
96
     *
97
     * @return $this
98
     */
99
    public function setWorkflowName($workflowName)
100
    {
101
        $this->workflowName = (string)$workflowName;
102
103
        return $this;
104
    }
105
106
    /**
107
     * @return integer
108
     */
109
    public function getState()
110
    {
111
        return $this->state;
112
    }
113
114
    /**
115
     * @param integer $state
116
     *
117
     * @return $this
118
     */
119
    public function setState($state)
120
    {
121
        $this->state = (integer)$state;
122
123
        return $this;
124
    }
125
126
    /**
127
     * Определяет иницилазирован ли процесс workflow
128
     *
129
     * @return bool
130
     */
131
    public function isInitialized()
132
    {
133
        return $this->state > 0;
134
    }
135
136
137
    /**
138
     * @return ArrayCollection|StepInterface[]
139
     */
140
    public function getSteps()
141
    {
142
        return $this->steps;
0 ignored issues
show
Bug Best Practice introduced by
The return type of return $this->steps; (OldTown\Workflow\Spi\Doctrine\Entity\StepInterface) is incompatible with the return type declared by the interface OldTown\Workflow\Spi\Doc...ntryInterface::getSteps of type Doctrine\Common\Collecti...\Entity\StepInterface[].

If you return a value from a function or method, it should be a sub-type of the type that is given by the parent type f.e. an interface, or abstract method. This is more formally defined by the Lizkov substitution principle, and guarantees that classes that depend on the parent type can use any instance of a child type interchangably. This principle also belongs to the SOLID principles for object oriented design.

Let’s take a look at an example:

class Author {
    private $name;

    public function __construct($name) {
        $this->name = $name;
    }

    public function getName() {
        return $this->name;
    }
}

abstract class Post {
    public function getAuthor() {
        return 'Johannes';
    }
}

class BlogPost extends Post {
    public function getAuthor() {
        return new Author('Johannes');
    }
}

class ForumPost extends Post { /* ... */ }

function my_function(Post $post) {
    echo strtoupper($post->getAuthor());
}

Our function my_function expects a Post object, and outputs the author of the post. The base class Post returns a simple string and outputting a simple string will work just fine. However, the child class BlogPost which is a sub-type of Post instead decided to return an object, and is therefore violating the SOLID principles. If a BlogPost were passed to my_function, PHP would not complain, but ultimately fail when executing the strtoupper call in its body.

Loading history...
143
    }
144
145
    /**
146
     * @param StepInterface $step
147
     *
148
     * @return $this
149
     */
150
    public function addCurrentStep(StepInterface $step)
151
    {
152
        $step->setEntry($this);
153
        if (!$this->getSteps()->contains($step)) {
0 ignored issues
show
The method contains() does not seem to exist on object<OldTown\Workflow\...e\Entity\StepInterface>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
154
            $this->getSteps()->add($step);
0 ignored issues
show
The method add() does not seem to exist on object<OldTown\Workflow\...e\Entity\StepInterface>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
155
        }
156
157
        return $this;
158
    }
159
}
160