Issues (40)

Security Analysis    not enabled

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/Traits/BookingScopes.php (13 issues)

Labels
Severity

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
declare(strict_types=1);
4
5
namespace Rinvex\Bookings\Traits;
6
7
use Carbon\Carbon;
8
use Illuminate\Database\Eloquent\Relations\MorphMany;
9
10
trait BookingScopes
11
{
12
    /**
13
     * Get past bookings.
14
     *
15
     * @return \Illuminate\Database\Eloquent\Relations\MorphMany
16
     */
17
    public function pastBookings(): MorphMany
18
    {
19
        return $this->bookings()
0 ignored issues
show
The method bookings() does not exist on Rinvex\Bookings\Traits\BookingScopes. Did you maybe mean pastBookings()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
20
                    ->whereNull('canceled_at')
21
                    ->whereNotNull('ends_at')
22
                    ->where('ends_at', '<', now());
23
    }
24
25
    /**
26
     * Get future bookings.
27
     *
28
     * @return \Illuminate\Database\Eloquent\Relations\MorphMany
29
     */
30
    public function futureBookings(): MorphMany
31
    {
32
        return $this->bookings()
0 ignored issues
show
The method bookings() does not exist on Rinvex\Bookings\Traits\BookingScopes. Did you maybe mean pastBookings()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
33
                    ->whereNull('canceled_at')
34
                    ->whereNotNull('starts_at')
35
                    ->where('starts_at', '>', now());
36
    }
37
38
    /**
39
     * Get current bookings.
40
     *
41
     * @return \Illuminate\Database\Eloquent\Relations\MorphMany
42
     */
43
    public function currentBookings(): MorphMany
44
    {
45
        return $this->bookings()
0 ignored issues
show
The method bookings() does not exist on Rinvex\Bookings\Traits\BookingScopes. Did you maybe mean pastBookings()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
46
                    ->whereNull('canceled_at')
47
                    ->whereNotNull('starts_at')
48
                    ->whereNotNull('ends_at')
49
                    ->where('starts_at', '<', now())
50
                    ->where('ends_at', '>', now());
51
    }
52
53
    /**
54
     * Get cancelled bookings.
55
     *
56
     * @return \Illuminate\Database\Eloquent\Relations\MorphMany
57
     */
58
    public function cancelledBookings(): MorphMany
59
    {
60
        return $this->bookings()
0 ignored issues
show
The method bookings() does not exist on Rinvex\Bookings\Traits\BookingScopes. Did you maybe mean pastBookings()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
61
                    ->whereNotNull('canceled_at');
62
    }
63
64
    /**
65
     * Get bookings starts before the given date.
66
     *
67
     * @param string $date
68
     *
69
     * @return \Illuminate\Database\Eloquent\Relations\MorphMany
70
     */
71
    public function bookingsStartsBefore(string $date): MorphMany
72
    {
73
        return $this->bookings()
0 ignored issues
show
The method bookings() does not exist on Rinvex\Bookings\Traits\BookingScopes. Did you maybe mean pastBookings()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
74
                    ->whereNull('canceled_at')
75
                    ->whereNotNull('starts_at')
76
                    ->where('starts_at', '<', new Carbon($date));
77
    }
78
79
    /**
80
     * Get bookings starts after the given date.
81
     *
82
     * @param string $date
83
     *
84
     * @return \Illuminate\Database\Eloquent\Relations\MorphMany
85
     */
86
    public function bookingsStartsAfter(string $date): MorphMany
87
    {
88
        return $this->bookings()
0 ignored issues
show
The method bookings() does not exist on Rinvex\Bookings\Traits\BookingScopes. Did you maybe mean pastBookings()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
89
                    ->whereNull('canceled_at')
90
                    ->whereNotNull('starts_at')
91
                    ->where('starts_at', '>', new Carbon($date));
92
    }
93
94
    /**
95
     * Get bookings starts between the given dates.
96
     *
97
     * @param string $startsAt
98
     * @param string $endsAt
99
     *
100
     * @return \Illuminate\Database\Eloquent\Relations\MorphMany
101
     */
102
    public function bookingsStartsBetween(string $startsAt, string $endsAt): MorphMany
103
    {
104
        return $this->bookings()
0 ignored issues
show
The method bookings() does not exist on Rinvex\Bookings\Traits\BookingScopes. Did you maybe mean pastBookings()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
105
                    ->whereNull('canceled_at')
106
                    ->whereNotNull('starts_at')
107
                    ->where('starts_at', '>', new Carbon($startsAt))
108
                    ->where('starts_at', '<', new Carbon($endsAt));
109
    }
110
111
    /**
112
     * Get bookings ends before the given date.
113
     *
114
     * @param string $date
115
     *
116
     * @return \Illuminate\Database\Eloquent\Relations\MorphMany
117
     */
118
    public function bookingsEndsBefore(string $date): MorphMany
119
    {
120
        return $this->bookings()
0 ignored issues
show
The method bookings() does not exist on Rinvex\Bookings\Traits\BookingScopes. Did you maybe mean pastBookings()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
121
                    ->whereNull('canceled_at')
122
                    ->whereNotNull('ends_at')
123
                    ->where('ends_at', '<', new Carbon($date));
124
    }
125
126
    /**
127
     * Get bookings ends after the given date.
128
     *
129
     * @param string $date
130
     *
131
     * @return \Illuminate\Database\Eloquent\Relations\MorphMany
132
     */
133
    public function bookingsEndsAfter(string $date): MorphMany
134
    {
135
        return $this->bookings()
0 ignored issues
show
The method bookings() does not exist on Rinvex\Bookings\Traits\BookingScopes. Did you maybe mean pastBookings()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
136
                    ->whereNull('canceled_at')
137
                    ->whereNotNull('ends_at')
138
                    ->where('ends_at', '>', new Carbon($date));
139
    }
140
141
    /**
142
     * Get bookings ends between the given dates.
143
     *
144
     * @param string $startsAt
145
     * @param string $endsAt
146
     *
147
     * @return \Illuminate\Database\Eloquent\Relations\MorphMany
148
     */
149
    public function bookingsEndsBetween(string $startsAt, string $endsAt): MorphMany
150
    {
151
        return $this->bookings()
0 ignored issues
show
The method bookings() does not exist on Rinvex\Bookings\Traits\BookingScopes. Did you maybe mean pastBookings()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
152
                    ->whereNull('canceled_at')
153
                    ->whereNotNull('ends_at')
154
                    ->where('ends_at', '>', new Carbon($startsAt))
155
                    ->where('ends_at', '<', new Carbon($endsAt));
156
    }
157
158
    /**
159
     * Get bookings cancelled before the given date.
160
     *
161
     * @param string $date
162
     *
163
     * @return \Illuminate\Database\Eloquent\Relations\MorphMany
164
     */
165
    public function bookingsCancelledBefore(string $date): MorphMany
166
    {
167
        return $this->bookings()
0 ignored issues
show
The method bookings() does not exist on Rinvex\Bookings\Traits\BookingScopes. Did you maybe mean pastBookings()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
168
                    ->whereNotNull('canceled_at')
169
                    ->where('canceled_at', '<', new Carbon($date));
170
    }
171
172
    /**
173
     * Get bookings cancelled after the given date.
174
     *
175
     * @param string $date
176
     *
177
     * @return \Illuminate\Database\Eloquent\Relations\MorphMany
178
     */
179
    public function bookingsCancelledAfter(string $date): MorphMany
180
    {
181
        return $this->bookings()
0 ignored issues
show
The method bookings() does not exist on Rinvex\Bookings\Traits\BookingScopes. Did you maybe mean pastBookings()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
182
                    ->whereNotNull('canceled_at')
183
                    ->where('canceled_at', '>', new Carbon($date));
184
    }
185
186
    /**
187
     * Get bookings cancelled between the given dates.
188
     *
189
     * @param string $startsAt
190
     * @param string $endsAt
191
     *
192
     * @return \Illuminate\Database\Eloquent\Relations\MorphMany
193
     */
194
    public function bookingsCancelledBetween(string $startsAt, string $endsAt): MorphMany
195
    {
196
        return $this->bookings()
0 ignored issues
show
The method bookings() does not exist on Rinvex\Bookings\Traits\BookingScopes. Did you maybe mean pastBookings()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
197
                    ->whereNotNull('canceled_at')
198
                    ->where('canceled_at', '>', new Carbon($startsAt))
199
                    ->where('canceled_at', '<', new Carbon($endsAt));
200
    }
201
}
202