Issues (83)

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.

Service/JobQueue.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
namespace SfCod\QueueBundle\Service;
4
5
use SfCod\QueueBundle\Base\JobQueueInterface;
6
7
/**
8
 * JobQueue service
9
 *
10
 * @author Virchenko Maksim <[email protected]>
11
 * @author Orlov Alexey <[email protected]>
12
 */
13
class JobQueue implements JobQueueInterface
14
{
15
    /**
16
     * QueueManager instance
17
     *
18
     * @var QueueManager
19
     */
20
    protected $manager;
21
22
    /**
23
     * JobQueue constructor.
24
     *
25
     * @param QueueManager $manager
26
     *
27
     * @internal param array $config
28
     */
29
    public function __construct(QueueManager $manager)
30
    {
31
        $this->manager = $manager;
32
    }
33
34
    /**
35
     * Push new job to queue
36
     *
37
     * @author Virchenko Maksim <[email protected]>
38
     *
39
     * @param string $job
40
     * @param array $data
41
     * @param string $queue
42
     * @param string $connection
43
     *
44
     * @return mixed
45
     */
46
    public function push(string $job, array $data = [], string $queue = 'default', string $connection = 'default')
47
    {
48
        return $this->manager->push($job, $data, $queue, $connection);
0 ignored issues
show
Documentation Bug introduced by
The method push does not exist on object<SfCod\QueueBundle\Service\QueueManager>? Since you implemented __call, maybe consider adding a @method annotation.

If you implement __call and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.

This is often the case, when __call is implemented by a parent class and only the child class knows which methods exist:

class ParentClass {
    private $data = array();

    public function __call($method, array $args) {
        if (0 === strpos($method, 'get')) {
            return $this->data[strtolower(substr($method, 3))];
        }

        throw new \LogicException(sprintf('Unsupported method: %s', $method));
    }
}

/**
 * If this class knows which fields exist, you can specify the methods here:
 *
 * @method string getName()
 */
class SomeClass extends ParentClass { }
Loading history...
49
    }
50
51
    /**
52
     * Push new job to queue if this job is not exist
53
     *
54
     * @author Virchenko Maksim <[email protected]>
55
     *
56
     * @param string $job
57
     * @param array $data
58
     * @param string $queue
59
     * @param string $connection
60
     *
61
     * @return mixed
62
     */
63
    public function pushUnique(string $job, array $data = [], string $queue = 'default', string $connection = 'default')
64
    {
65
        if (false === $this->manager->connection($connection)->exists($job, $data, $queue)) {
66
            return $this->manager->push($job, $data, $queue, $connection);
0 ignored issues
show
Documentation Bug introduced by
The method push does not exist on object<SfCod\QueueBundle\Service\QueueManager>? Since you implemented __call, maybe consider adding a @method annotation.

If you implement __call and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.

This is often the case, when __call is implemented by a parent class and only the child class knows which methods exist:

class ParentClass {
    private $data = array();

    public function __call($method, array $args) {
        if (0 === strpos($method, 'get')) {
            return $this->data[strtolower(substr($method, 3))];
        }

        throw new \LogicException(sprintf('Unsupported method: %s', $method));
    }
}

/**
 * If this class knows which fields exist, you can specify the methods here:
 *
 * @method string getName()
 */
class SomeClass extends ParentClass { }
Loading history...
67
        }
68
69
        return null;
70
    }
71
72
    /**
73
     * Push a new an array of jobs onto the queue.
74
     *
75
     * @param array $jobs
76
     * @param mixed $data
77
     * @param string $queue
78
     * @param string $connection
79
     *
80
     * @return mixed
81
     */
82
    public function bulk(array $jobs, array $data = [], string $queue = 'default', string $connection = 'default')
83
    {
84
        return $this->manager->bulk($jobs, $data, $queue, $connection);
0 ignored issues
show
Documentation Bug introduced by
The method bulk does not exist on object<SfCod\QueueBundle\Service\QueueManager>? Since you implemented __call, maybe consider adding a @method annotation.

If you implement __call and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.

This is often the case, when __call is implemented by a parent class and only the child class knows which methods exist:

class ParentClass {
    private $data = array();

    public function __call($method, array $args) {
        if (0 === strpos($method, 'get')) {
            return $this->data[strtolower(substr($method, 3))];
        }

        throw new \LogicException(sprintf('Unsupported method: %s', $method));
    }
}

/**
 * If this class knows which fields exist, you can specify the methods here:
 *
 * @method string getName()
 */
class SomeClass extends ParentClass { }
Loading history...
85
    }
86
87
    /**
88
     * Push a new job onto the queue after a delay.
89
     *
90
     * @param \DateInterval|int $delay
91
     * @param string $job
92
     * @param mixed $data
93
     * @param string $queue
94
     * @param string $connection
95
     *
96
     * @return mixed
97
     */
98
    public function later($delay, string $job, array $data = [], string $queue = 'default', string $connection = 'default')
99
    {
100
        return $this->manager->later($delay, $job, $data, $queue, $connection);
0 ignored issues
show
Documentation Bug introduced by
The method later does not exist on object<SfCod\QueueBundle\Service\QueueManager>? Since you implemented __call, maybe consider adding a @method annotation.

If you implement __call and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.

This is often the case, when __call is implemented by a parent class and only the child class knows which methods exist:

class ParentClass {
    private $data = array();

    public function __call($method, array $args) {
        if (0 === strpos($method, 'get')) {
            return $this->data[strtolower(substr($method, 3))];
        }

        throw new \LogicException(sprintf('Unsupported method: %s', $method));
    }
}

/**
 * If this class knows which fields exist, you can specify the methods here:
 *
 * @method string getName()
 */
class SomeClass extends ParentClass { }
Loading history...
101
    }
102
103
    /**
104
     * Push a new job into the queue after a delay if job does not exist.
105
     *
106
     * @param \DateInterval|int $delay
107
     * @param string $job
108
     * @param mixed $data
109
     * @param string $queue
110
     * @param string $connection
111
     *
112
     * @return mixed
113
     */
114
    public function laterUnique($delay, string $job, array $data = [], string $queue = 'default', string $connection = 'default')
115
    {
116
        if (false === $this->manager->connection($connection)->exists($job, $data, $queue)) {
117
            return $this->manager->later($delay, $job, $data, $queue, $connection);
0 ignored issues
show
Documentation Bug introduced by
The method later does not exist on object<SfCod\QueueBundle\Service\QueueManager>? Since you implemented __call, maybe consider adding a @method annotation.

If you implement __call and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.

This is often the case, when __call is implemented by a parent class and only the child class knows which methods exist:

class ParentClass {
    private $data = array();

    public function __call($method, array $args) {
        if (0 === strpos($method, 'get')) {
            return $this->data[strtolower(substr($method, 3))];
        }

        throw new \LogicException(sprintf('Unsupported method: %s', $method));
    }
}

/**
 * If this class knows which fields exist, you can specify the methods here:
 *
 * @method string getName()
 */
class SomeClass extends ParentClass { }
Loading history...
118
        }
119
120
        return null;
121
    }
122
}
123