FusePollHandle   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 2
Bugs 1 Features 1
Metric Value
eloc 7
c 2
b 1
f 1
dl 0
loc 28
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A toCData() 0 3 1
A __construct() 0 3 1
A fromCData() 0 3 1
A newCData() 0 3 1
A getCTypeName() 0 3 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\Fuse;
15
16
use FFI\CData;
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 fuse_pollhandle *;
21
 */
22
final class FusePollHandle implements TypedCDataInterface
23
{
24
    private CData $cdata;
25
26
    public static function getCTypeName(): string
27
    {
28
        return 'struct fuse_pollhandle *';
29
    }
30
31
    public function __construct(CData $cdata)
32
    {
33
        $this->cdata = $cdata;
34
    }
35
36
    /** @return static */
37
    public static function fromCData(CData $cdata): TypedCDataInterface
38
    {
39
        return new self($cdata);
40
    }
41
42
    public function toCData(?CData $cdata): CData
43
    {
44
        return $this->cdata;
45
    }
46
47
    public static function newCData(): CData
48
    {
49
        throw new \LogicException('this type doesn\'t support creation of CData');
50
    }
51
}
52