Issues (70)

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/Dusk/Concerns/InteractsWithElements.php (37 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 BeyondCode\DuskDashboard\Dusk\Concerns;
4
5
trait InteractsWithElements
6
{
7
    /** {@inheritdoc} */
8
    public function elements($selector)
9
    {
10
        $this->actionCollector->collect(__FUNCTION__, func_get_args(), $this);
0 ignored issues
show
The property actionCollector does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
11
12
        return parent::elements($selector);
13
    }
14
15
    /** {@inheritdoc} */
16
    public function element($selector)
17
    {
18
        $this->actionCollector->collect(__FUNCTION__, func_get_args(), $this);
19
20
        return parent::element($selector);
21
    }
22
23
    /** {@inheritdoc} */
24 View Code Duplication
    public function clickLink($link, $element = 'a')
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
25
    {
26
        $previousHtml = $this->getCurrentPageSource();
0 ignored issues
show
It seems like getCurrentPageSource() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
27
28
        $browser = parent::clickLink($link, $element);
29
30
        $this->actionCollector->collect(__FUNCTION__, func_get_args(), $this, $previousHtml);
31
32
        return $browser;
33
    }
34
35
    /** {@inheritdoc} */
36
    public function value($selector, $value = null)
37
    {
38
        $this->actionCollector->collect(__FUNCTION__, func_get_args(), $this);
39
40
        return parent::value($selector, $value);
41
    }
42
43
    /** {@inheritdoc} */
44
    public function text($selector)
45
    {
46
        $this->actionCollector->collect(__FUNCTION__, func_get_args(), $this);
47
48
        return parent::text($selector);
49
    }
50
51
    /** {@inheritdoc} */
52
    public function attribute($selector, $attribute)
53
    {
54
        $this->actionCollector->collect(__FUNCTION__, func_get_args(), $this);
55
56
        return parent::attribute($selector, $attribute);
57
    }
58
59
    /** {@inheritdoc} */
60 View Code Duplication
    public function keys($selector, ...$keys)
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
61
    {
62
        $previousHtml = $this->getCurrentPageSource();
0 ignored issues
show
It seems like getCurrentPageSource() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
63
64
        $browser = parent::keys($selector, $keys);
65
66
        $this->actionCollector->collect(__FUNCTION__, func_get_args(), $this, $previousHtml);
67
68
        return $browser;
69
    }
70
71
    /** {@inheritdoc} */
72 View Code Duplication
    public function type($field, $value)
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
73
    {
74
        $previousHtml = $this->getCurrentPageSource();
0 ignored issues
show
It seems like getCurrentPageSource() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
75
76
        $browser = parent::type($field, $value);
77
78
        $this->actionCollector->collect(__FUNCTION__, func_get_args(), $this, $previousHtml);
79
80
        return $browser;
81
    }
82
83
    /** {@inheritdoc} */
84 View Code Duplication
    public function append($field, $value)
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
85
    {
86
        $previousHtml = $this->getCurrentPageSource();
0 ignored issues
show
It seems like getCurrentPageSource() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
87
88
        $browser = parent::append($field, $value);
89
90
        $this->actionCollector->collect(__FUNCTION__, func_get_args(), $this, $previousHtml);
91
92
        return $browser;
93
    }
94
95
    /** {@inheritdoc} */
96 View Code Duplication
    public function clear($field)
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
97
    {
98
        $previousHtml = $this->getCurrentPageSource();
0 ignored issues
show
It seems like getCurrentPageSource() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
99
100
        $browser = parent::clear($field);
101
102
        $this->actionCollector->collect(__FUNCTION__, func_get_args(), $this, $previousHtml);
103
104
        return $browser;
105
    }
106
107
    /** {@inheritdoc} */
108 View Code Duplication
    public function select($field, $value = null)
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
109
    {
110
        $previousHtml = $this->getCurrentPageSource();
0 ignored issues
show
It seems like getCurrentPageSource() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
111
112
        $browser = parent::select($field, $value);
113
114
        $this->actionCollector->collect(__FUNCTION__, func_get_args(), $this, $previousHtml);
115
116
        return $browser;
117
    }
118
119
    /** {@inheritdoc} */
120 View Code Duplication
    public function radio($field, $value)
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
121
    {
122
        $previousHtml = $this->getCurrentPageSource();
0 ignored issues
show
It seems like getCurrentPageSource() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
123
124
        $browser = parent::radio($field, $value);
125
126
        $this->actionCollector->collect(__FUNCTION__, func_get_args(), $this, $previousHtml);
127
128
        return $browser;
129
    }
130
131
    /** {@inheritdoc} */
132 View Code Duplication
    public function check($field, $value = null)
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
133
    {
134
        $previousHtml = $this->getCurrentPageSource();
0 ignored issues
show
It seems like getCurrentPageSource() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
135
136
        $browser = parent::check($field, $value);
137
138
        $this->actionCollector->collect(__FUNCTION__, func_get_args(), $this, $previousHtml);
139
140
        return $browser;
141
    }
142
143
    /** {@inheritdoc} */
144 View Code Duplication
    public function uncheck($field, $value = null)
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
145
    {
146
        $previousHtml = $this->getCurrentPageSource();
0 ignored issues
show
It seems like getCurrentPageSource() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
147
148
        $browser = parent::uncheck($field, $value);
149
150
        $this->actionCollector->collect(__FUNCTION__, func_get_args(), $this, $previousHtml);
151
152
        return $browser;
153
    }
154
155
    /** {@inheritdoc} */
156 View Code Duplication
    public function attach($field, $path)
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
157
    {
158
        $previousHtml = $this->getCurrentPageSource();
0 ignored issues
show
It seems like getCurrentPageSource() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
159
160
        $browser = parent::attach($field, $path);
161
162
        $this->actionCollector->collect(__FUNCTION__, func_get_args(), $this, $previousHtml);
163
164
        return $browser;
165
    }
166
167
    /** {@inheritdoc} */
168 View Code Duplication
    public function press($button)
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
169
    {
170
        $previousHtml = $this->getCurrentPageSource();
0 ignored issues
show
It seems like getCurrentPageSource() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
171
172
        $browser = parent::press($button);
173
174
        $this->actionCollector->collect(__FUNCTION__, func_get_args(), $this, $previousHtml);
175
176
        return $browser;
177
    }
178
179
    /** {@inheritdoc} */
180 View Code Duplication
    public function pressAndWaitFor($button, $seconds = 5)
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
181
    {
182
        $previousHtml = $this->getCurrentPageSource();
0 ignored issues
show
It seems like getCurrentPageSource() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
183
184
        $browser = parent::pressAndWaitFor($button, $seconds);
185
186
        $this->actionCollector->collect(__FUNCTION__, func_get_args(), $this, $previousHtml);
187
188
        return $browser;
189
    }
190
191
    /** {@inheritdoc} */
192 View Code Duplication
    public function drag($from, $to)
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
193
    {
194
        $previousHtml = $this->getCurrentPageSource();
0 ignored issues
show
It seems like getCurrentPageSource() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
195
196
        $browser = parent::drag($from, $to);
197
198
        $this->actionCollector->collect(__FUNCTION__, func_get_args(), $this, $previousHtml);
199
200
        return $browser;
201
    }
202
203
    /** {@inheritdoc} */
204 View Code Duplication
    public function dragUp($selector, $offset)
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
205
    {
206
        $previousHtml = $this->getCurrentPageSource();
0 ignored issues
show
It seems like getCurrentPageSource() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
207
208
        $browser = parent::dragUp($selector, $offset);
209
210
        $this->actionCollector->collect(__FUNCTION__, func_get_args(), $this, $previousHtml);
211
212
        return $browser;
213
    }
214
215
    /** {@inheritdoc} */
216 View Code Duplication
    public function dragDown($selector, $offset)
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
217
    {
218
        $previousHtml = $this->getCurrentPageSource();
0 ignored issues
show
It seems like getCurrentPageSource() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
219
220
        $browser = parent::dragDown($selector, $offset);
221
222
        $this->actionCollector->collect(__FUNCTION__, func_get_args(), $this, $previousHtml);
223
224
        return $browser;
225
    }
226
227
    /** {@inheritdoc} */
228 View Code Duplication
    public function dragLeft($selector, $offset)
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
229
    {
230
        $previousHtml = $this->getCurrentPageSource();
0 ignored issues
show
It seems like getCurrentPageSource() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
231
232
        $browser = parent::dragLeft($selector, $offset);
233
234
        $this->actionCollector->collect(__FUNCTION__, func_get_args(), $this, $previousHtml);
235
236
        return $browser;
237
    }
238
239
    /** {@inheritdoc} */
240 View Code Duplication
    public function dragRight($selector, $offset)
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
241
    {
242
        $previousHtml = $this->getCurrentPageSource();
0 ignored issues
show
It seems like getCurrentPageSource() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
243
244
        $browser = parent::dragRight($selector, $offset);
245
246
        $this->actionCollector->collect(__FUNCTION__, func_get_args(), $this, $previousHtml);
247
248
        return $browser;
249
    }
250
251
    /** {@inheritdoc} */
252 View Code Duplication
    public function dragOffset($selector, $x = 0, $y = 0)
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
253
    {
254
        $previousHtml = $this->getCurrentPageSource();
0 ignored issues
show
It seems like getCurrentPageSource() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
255
256
        $browser = parent::dragOffset($selector, $x, $y);
257
258
        $this->actionCollector->collect(__FUNCTION__, func_get_args(), $this, $previousHtml);
259
260
        return $browser;
261
    }
262
263
    /** {@inheritdoc} */
264
    public function acceptDialog()
265
    {
266
        $browser = parent::acceptDialog();
267
268
        $this->actionCollector->collect(__FUNCTION__, func_get_args(), $this);
269
270
        return $browser;
271
    }
272
273
    /** {@inheritdoc} */
274
    public function typeInDialog($value)
275
    {
276
        $browser = parent::typeInDialog($value);
277
278
        $this->actionCollector->collect(__FUNCTION__, func_get_args(), $this);
279
280
        return $browser;
281
    }
282
283
    /** {@inheritdoc} */
284
    public function dismissDialog()
285
    {
286
        $browser = parent::dismissDialog();
287
288
        $this->actionCollector->collect(__FUNCTION__, func_get_args(), $this);
289
290
        return $browser;
291
    }
292
}
293