1 | <?php |
||||||||||||
2 | namespace FFI\Libc; |
||||||||||||
3 | use FFI\CData; |
||||||||||||
4 | use FFI\CInteger; |
||||||||||||
5 | |||||||||||||
6 | /** |
||||||||||||
7 | * This file is part of the sj-i/php-profiler package. |
||||||||||||
8 | * |
||||||||||||
9 | * (c) sji <[email protected]> |
||||||||||||
10 | * |
||||||||||||
11 | * For the full copyright and license information, please view the LICENSE |
||||||||||||
12 | * file that was distributed with this source code. |
||||||||||||
13 | */ |
||||||||||||
14 | |||||||||||||
15 | class iovec extends CData |
||||||||||||
16 | { |
||||||||||||
17 | /** @var int|CInteger */ |
||||||||||||
18 | public int $iov_base; |
||||||||||||
19 | /** @var int|CInteger */ |
||||||||||||
20 | public int $iov_len; |
||||||||||||
21 | } |
||||||||||||
22 | |||||||||||||
23 | class process_vm_readv_ffi extends \FFI |
||||||||||||
24 | { |
||||||||||||
25 | /** @var int|CInteger */ |
||||||||||||
26 | public int $errno; |
||||||||||||
27 | |||||||||||||
28 | /** |
||||||||||||
29 | * @param int $pid |
||||||||||||
30 | * @param CData $local_iov_addr |
||||||||||||
31 | * @param int $liovcnt |
||||||||||||
32 | * @param CData $remote_iov_addr |
||||||||||||
33 | * @param int $riovcnt |
||||||||||||
34 | * @param int $flags |
||||||||||||
35 | * @return int|CInteger |
||||||||||||
36 | */ |
||||||||||||
37 | public function process_vm_readv(int $pid, CData $local_iov_addr, int $liovcnt, CData $remote_iov_addr, int $riovcnt, int $flags): int {} |
||||||||||||
0 ignored issues
–
show
The parameter
$pid is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() The parameter
$remote_iov_addr is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() In this branch, the function will implicitly return
null which is incompatible with the type-hinted return integer . Consider adding a return statement or allowing null as return value.
For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example: interface ReturnsInt {
public function returnsIntHinted(): int;
}
class MyClass implements ReturnsInt {
public function returnsIntHinted(): int
{
if (foo()) {
return 123;
}
// here: null is implicitly returned
}
}
![]() The parameter
$local_iov_addr is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() The parameter
$riovcnt is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() The parameter
$liovcnt is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() |
|||||||||||||
38 | } |
||||||||||||
39 | |||||||||||||
40 | class errno_ffi extends \FFI |
||||||||||||
41 | { |
||||||||||||
42 | /** @var int|CInteger */ |
||||||||||||
43 | public int $errno; |
||||||||||||
44 | } |
||||||||||||
45 | |||||||||||||
46 | class execvp_ffi extends \FFI |
||||||||||||
47 | { |
||||||||||||
48 | public function execvp(string $file, CData $argv): int {} |
||||||||||||
0 ignored issues
–
show
In this branch, the function will implicitly return
null which is incompatible with the type-hinted return integer . Consider adding a return statement or allowing null as return value.
For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example: interface ReturnsInt {
public function returnsIntHinted(): int;
}
class MyClass implements ReturnsInt {
public function returnsIntHinted(): int
{
if (foo()) {
return 123;
}
// here: null is implicitly returned
}
}
![]() The parameter
$argv is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() The parameter
$file is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() |
|||||||||||||
49 | } |
||||||||||||
50 | |||||||||||||
51 | class ptrace_ffi extends \FFI |
||||||||||||
52 | { |
||||||||||||
53 | /** |
||||||||||||
54 | * @param int $request |
||||||||||||
55 | * @param int $pid |
||||||||||||
56 | * @param CData $addr |
||||||||||||
57 | * @param CData $data |
||||||||||||
58 | * @return int |
||||||||||||
59 | */ |
||||||||||||
60 | public function ptrace(int $request, int $pid, CData $addr, CData $data): int {} |
||||||||||||
0 ignored issues
–
show
In this branch, the function will implicitly return
null which is incompatible with the type-hinted return integer . Consider adding a return statement or allowing null as return value.
For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example: interface ReturnsInt {
public function returnsIntHinted(): int;
}
class MyClass implements ReturnsInt {
public function returnsIntHinted(): int
{
if (foo()) {
return 123;
}
// here: null is implicitly returned
}
}
![]() The parameter
$addr is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() The parameter
$data is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() The parameter
$request is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() The parameter
$pid is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() |
|||||||||||||
61 | } |
||||||||||||
62 | |||||||||||||
63 | class libc_file_ffi extends \FFI |
||||||||||||
64 | { |
||||||||||||
65 | public function open(string $path, int $mode): int {} |
||||||||||||
0 ignored issues
–
show
The parameter
$mode is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() The parameter
$path is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() In this branch, the function will implicitly return
null which is incompatible with the type-hinted return integer . Consider adding a return statement or allowing null as return value.
For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example: interface ReturnsInt {
public function returnsIntHinted(): int;
}
class MyClass implements ReturnsInt {
public function returnsIntHinted(): int
{
if (foo()) {
return 123;
}
// here: null is implicitly returned
}
}
![]() |
|||||||||||||
66 | public function read(int $fd, CData $buffer, int $size): int {} |
||||||||||||
0 ignored issues
–
show
The parameter
$fd is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() The parameter
$buffer is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() The parameter
$size is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() In this branch, the function will implicitly return
null which is incompatible with the type-hinted return integer . Consider adding a return statement or allowing null as return value.
For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example: interface ReturnsInt {
public function returnsIntHinted(): int;
}
class MyClass implements ReturnsInt {
public function returnsIntHinted(): int
{
if (foo()) {
return 123;
}
// here: null is implicitly returned
}
}
![]() |
|||||||||||||
67 | public function close(int $fd) {} |
||||||||||||
0 ignored issues
–
show
The parameter
$fd is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() |
|||||||||||||
68 | } |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.