Flock   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 13
c 1
b 0
f 1
dl 0
loc 35
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getCTypeName() 0 3 1
A __construct() 0 12 1
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\Fcntl;
15
16
use Fuse\FFI\TypedCDataDefaultImplementationTrait;
17
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...
18
19
/**
20
 * struct flock
21
 * {
22
 *     short int l_type;
23
 *     short int l_whence;
24
 *     off_t l_start;
25
 *     off_t l_len;
26
 *     pid_t l_pid;
27
 * };
28
 */
29
final class Flock implements TypedCDataInterface
30
{
31
    use TypedCDataDefaultImplementationTrait;
32
33
    public int $l_type;
34
    public int $l_whence;
35
    public int $l_start;
36
    public int $l_len;
37
    public int $l_pid;
38
39
    /**
40
     * Flock constructor.
41
     * @param int $l_type
42
     * @param int $l_whence
43
     * @param int $l_start
44
     * @param int $l_len
45
     * @param int $l_pid
46
     */
47
    public function __construct(
48
        int $l_type = 0,
49
        int $l_whence = 0,
50
        int $l_start = 0,
51
        int $l_len = 0,
52
        int $l_pid = 0
53
    ) {
54
        $this->l_type = $l_type;
55
        $this->l_whence = $l_whence;
56
        $this->l_start = $l_start;
57
        $this->l_len = $l_len;
58
        $this->l_pid = $l_pid;
59
    }
60
61
    public static function getCTypeName(): string
62
    {
63
        return 'struct flock';
64
    }
65
}
66