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 (7)

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/Jobs/MnsJob.php (6 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
/*
4
 * Laravel-Mns -- 阿里云消息队列(MNS)的 Laravel 适配。
5
 *
6
 * This file is part of the abe/laravel-mns.
7
 *
8
 * (c) Abraham Greyson <[email protected]>
9
 * @link: https://github.com/abrahamgreyson/laravel-mns
10
 *
11
 * This source file is subject to the MIT license that is bundled
12
 * with this source code in the file LICENSE.
13
 */
14
15
namespace LaravelMns\Jobs;
16
17
use AliyunMNS\Responses\ReceiveMessageResponse;
18
use Illuminate\Container\Container;
19
use Illuminate\Contracts\Queue\Job as JobContract;
20
use Illuminate\Queue\Jobs\Job;
21
use LaravelMns\MnsAdapter;
22
23
class MnsJob extends Job implements JobContract
24
{
25
    /**
26
     * The class name of the job.
27
     *
28
     * @var string
29
     */
30
    protected $job;
31
32
    /**
33
     * The queue message data.
34
     *
35
     * @var string
36
     */
37
    protected $data;
38
39
    /**
40
     * @var \LaravelMns\MnsAdapter
41
     */
42
    private $mns;
43
44
    /**
45
     * Create a new job instance.
46
     *
47
     * @param \Illuminate\Container\Container             $container
48
     * @param \LaravelMns\MnsAdapter                      $mns
49
     * @param string                                      $queue
50
     * @param \AliyunMNS\Responses\ReceiveMessageResponse $job
51
     */
52 6
    public function __construct(
53
        Container $container,
54
        MnsAdapter $mns,
55
        $queue,
56
        ReceiveMessageResponse $job
57
    ) {
58 6
        $this->container = $container;
59 6
        $this->mns = $mns;
60 6
        $this->queue = $queue;
61 6
        $this->job = $job;
0 ignored issues
show
Documentation Bug introduced by
It seems like $job of type object<AliyunMNS\Respons...ReceiveMessageResponse> is incompatible with the declared type string of property $job.

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...
62 6
    }
63
64
    /**
65
     * Fire the job.
66
     */
67 2
    public function fire()
68
    {
69 2
        $body = json_decode($this->getRawBody(), true);
70 2
        if (!is_array($body)) {
71 1
            throw new \InvalidArgumentException(
72
                "Seems it's not a Laravel enqueued job. \r\n
73 1
                [$body]"
74 1
            );
75
        }
76 1
        $this->resolveAndFire($body);
77 1
    }
78
79
    /**
80
     * Get the raw body string for the job.
81
     *
82
     * @return string
83
     */
84 2
    public function getRawBody()
85
    {
86 2
        return $this->job->getMessageBody();
0 ignored issues
show
The method getMessageBody cannot be called on $this->job (of type string).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
87
    }
88
89
    /**
90
     * Delete the job from the queue.
91
     */
92 1
    public function delete()
93
    {
94 1
        parent::delete();
95 1
        $receiptHandle = $this->job->getReceiptHandle();
0 ignored issues
show
The method getReceiptHandle cannot be called on $this->job (of type string).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
96 1
        $this->mns->deleteMessage($receiptHandle);
97 1
    }
98
99
    /**
100
     * Release the job back into the queue.
101
     *
102
     * @param int $delay
103
     */
104 1
    public function release($delay = 0)
105
    {
106
        // 默认情况下 Laravel 将以 delay 0 来更改可见性,其预期的是使用队列服务默认的
107
        // 下次可消费时间,但 Aliyun MNS PHP SDK 的接口要求这个值必须大于 0,
108
        // 指从现在起,多久后消息变为可消费。
109
        $delay = 0 !== $delay
110 1
            ? $delay
111 1
            : $this->fromNowToNextVisibleTime($this->job->getNextVisibleTime());
0 ignored issues
show
The method getNextVisibleTime cannot be called on $this->job (of type string).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
112 1
        parent::release($delay);
113 1
        $this->mns->changeMessageVisibility(
114 1
            $this->job->getReceiptHandle(),
0 ignored issues
show
The method getReceiptHandle cannot be called on $this->job (of type string).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
115
            $delay
116 1
        );
117 1
    }
118
119
    /**
120
     * Get the number of times the job has been attempted.
121
     *
122
     * @return int
123
     */
124 1
    public function attempts()
125
    {
126 1
        return (int) $this->job->getDequeueCount();
0 ignored issues
show
The method getDequeueCount cannot be called on $this->job (of type string).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
127
    }
128
129
    /**
130
     * 从现在起到消息变为可消费的秒数。
131
     *
132
     * @param int $nextVisibleTime 下次可消费时的微妙时间戳。
133
     *
134
     * @return int
135
     */
136 1
    private function fromNowToNextVisibleTime($nextVisibleTime)
137
    {
138 1
        $nowInMilliSeconds = 1000 * microtime(true);
139 1
        $fromNowToNextVisibleTime = $nextVisibleTime - $nowInMilliSeconds;
140
141 1
        return (int) ($fromNowToNextVisibleTime / 1000);
142
    }
143
144
    /**
145
     * Get the IoC container instance.
146
     *
147
     * @return \Illuminate\Container\Container
148
     */
149 1
    public function getContainer()
150
    {
151 1
        return $this->container;
152
    }
153
}
154