These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | namespace Robo\Task\Development; |
||
3 | |||
4 | trait loadTasks |
||
5 | { |
||
6 | /** |
||
7 | * @param string $filename |
||
8 | * |
||
9 | * @return Changelog |
||
10 | */ |
||
11 | protected function taskChangelog($filename = 'CHANGELOG.md') |
||
12 | { |
||
13 | return $this->task(Changelog::class, $filename); |
||
0 ignored issues
–
show
|
|||
14 | } |
||
15 | |||
16 | /** |
||
17 | * @param string $filename |
||
18 | * |
||
19 | * @return GenerateMarkdownDoc |
||
20 | */ |
||
21 | protected function taskGenDoc($filename) |
||
22 | { |
||
23 | return $this->task(GenerateMarkdownDoc::class, $filename); |
||
0 ignored issues
–
show
It seems like
task() 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 Adding the
Loading history...
|
|||
24 | } |
||
25 | |||
26 | /** |
||
27 | * @param string $className |
||
28 | * @param string $wrapperClassName |
||
29 | * |
||
30 | * @return \Robo\Task\Development\GenerateTask |
||
31 | */ |
||
32 | protected function taskGenTask($className, $wrapperClassName = '') |
||
33 | { |
||
34 | return $this->task(GenerateTask::class, $className, $wrapperClassName); |
||
0 ignored issues
–
show
It seems like
task() 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 Adding the
Loading history...
|
|||
35 | } |
||
36 | |||
37 | /** |
||
38 | * @param string $pathToSemVer |
||
39 | * |
||
40 | * @return SemVer |
||
41 | */ |
||
42 | protected function taskSemVer($pathToSemVer = '.semver') |
||
43 | { |
||
44 | return $this->task(SemVer::class, $pathToSemVer); |
||
0 ignored issues
–
show
It seems like
task() 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 Adding the
Loading history...
|
|||
45 | } |
||
46 | |||
47 | /** |
||
48 | * @param int $port |
||
49 | * |
||
50 | * @return PhpServer |
||
51 | */ |
||
52 | protected function taskServer($port = 8000) |
||
53 | { |
||
54 | return $this->task(PhpServer::class, $port); |
||
0 ignored issues
–
show
It seems like
task() 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 Adding the
Loading history...
|
|||
55 | } |
||
56 | |||
57 | /** |
||
58 | * @param string $filename |
||
59 | * |
||
60 | * @return PackPhar |
||
61 | */ |
||
62 | protected function taskPackPhar($filename) |
||
63 | { |
||
64 | return $this->task(PackPhar::class, $filename); |
||
0 ignored issues
–
show
It seems like
task() 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 Adding the
Loading history...
|
|||
65 | } |
||
66 | |||
67 | /** |
||
68 | * @param string $tag |
||
69 | * |
||
70 | * @return GitHubRelease |
||
71 | */ |
||
72 | protected function taskGitHubRelease($tag) |
||
73 | { |
||
74 | return $this->task(GitHubRelease::class, $tag); |
||
0 ignored issues
–
show
It seems like
task() 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 Adding the
Loading history...
|
|||
75 | } |
||
76 | |||
77 | /** |
||
78 | * @param string|array $url |
||
79 | * |
||
80 | * @return OpenBrowser |
||
81 | */ |
||
82 | protected function taskOpenBrowser($url) |
||
83 | { |
||
84 | return $this->task(OpenBrowser::class, $url); |
||
0 ignored issues
–
show
It seems like
task() 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 Adding the
Loading history...
|
|||
85 | } |
||
86 | } |
||
87 |
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
The trait
Idable
provides a methodequalsId
that in turn relies on the methodgetId()
. 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.