FuseBuf::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 5
c 1
b 0
f 1
nc 1
nop 5
dl 0
loc 12
rs 10
1
<?php
2
3
/**
4
 * This file is part of the sj-i/php-fuse package.
5
 *
6
 * (c) sji <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace Fuse\Libc\Fuse;
15
16
use FFI\CData;
17
use Fuse\FFI\TypedCDataDefaultImplementationTrait;
18
use TypedCData\TypedCDataInterface;
0 ignored issues
show
Bug introduced by
The type TypedCData\TypedCDataInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
19
20
/**
21
 * struct fuse_buf
22
 * {
23
 *     size_t size;
24
 *     enum fuse_buf_flags flags;
25
 *     void *mem;
26
 *     int fd;
27
 *     off_t pos;
28
 * };
29
 */
30
final class FuseBuf implements TypedCDataInterface
31
{
32
    use TypedCDataDefaultImplementationTrait;
33
34
    public int $size;
35
    public int $flags;
36
    public ?CData $mem;
37
    public int $fd;
38
    public int $pos;
39
40
    public static function getCTypeName(): string
41
    {
42
        return 'struct fuse_buf';
43
    }
44
45
    public function __construct(
46
        int $size = 0,
47
        int $flags = 0,
48
        ?CData $mem = null,
49
        int $fd = 0,
50
        int $pos = 0
51
    ) {
52
        $this->size = $size;
53
        $this->flags = $flags;
54
        $this->mem = $mem;
55
        $this->fd = $fd;
56
        $this->pos = $pos;
57
    }
58
}
59