FakeHttpWrapper::stream_eof()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Sonata Project package.
7
 *
8
 * (c) Thomas Rabaix <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Sonata\MediaBundle\Tests\Provider;
15
16
class FakeHttpWrapper
17
{
18
    public static $ref = [
19
        // youtube content
20
        'http://www.youtube.com/oembed?url=http://www.youtube.com/watch?v=BDYAbAtaDzA&format=json' => 'valide_youtube.txt',
21
        'http://i3.ytimg.com/vi/BDYAbAtaDzA/hqdefault.jpg' => 'logo.jpg',
22
23
        // dailymotion content
24
        'http://www.dailymotion.com/services/oembed?url=http://www.dailymotion.com/video/x9wjql&format=json' => 'valide_dailymotion.txt',
25
        'http://ak2.static.dailymotion.com/static/video/711/536/16635117:jpeg_preview_large.jpg?20100801072241' => 'logo.jpg',
26
27
        // vimeo content
28
        'http://vimeo.com/api/oembed.json?url=http://vimeo.com/BDYAbAtaDzA' => 'valide_vimeo.txt',
29
        'http://b.vimeocdn.com/ts/136/375/136375440_1280.jpg' => 'logo.jpg',
30
    ];
31
32
    /* Properties */
33
    public $context;
34
35
    public $fp;
36
37
    /* Methods */
38
    public function __construct()
39
    {
40
    }
41
42
    public function dir_closedir(): void
43
    {
44
    }
45
46
    public function dir_opendir($path, $options): void
0 ignored issues
show
Unused Code introduced by
The parameter $path is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $options is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
47
    {
48
    }
49
50
    public function dir_readdir(): void
51
    {
52
    }
53
54
    public function dir_rewinddir(): void
55
    {
56
    }
57
58
    public function mkdir($path, $mode, $options): void
0 ignored issues
show
Unused Code introduced by
The parameter $path is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $mode is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $options is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
59
    {
60
    }
61
62
    public function rename($path_from, $path_to): void
0 ignored issues
show
Unused Code introduced by
The parameter $path_from is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $path_to is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
63
    {
64
    }
65
66
    public function rmdir($path, $options): void
0 ignored issues
show
Unused Code introduced by
The parameter $path is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $options is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
67
    {
68
    }
69
70
    public function stream_cast($cast_as): void
0 ignored issues
show
Unused Code introduced by
The parameter $cast_as is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
71
    {
72
    }
73
74
    public function stream_close(): bool
75
    {
76
        return true;
77
    }
78
79
    public function stream_eof(): bool
80
    {
81
        return 0 === feof($this->fp);
82
    }
83
84
    public function stream_flush(): void
85
    {
86
    }
87
88
    public function stream_lock($operation): void
0 ignored issues
show
Unused Code introduced by
The parameter $operation is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
89
    {
90
    }
91
92
    public function stream_open($path, $mode, $options, &$opened_path): bool
0 ignored issues
show
Unused Code introduced by
The parameter $options is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $opened_path is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
93
    {
94
        $file = __DIR__.'/../fixtures/'.self::$ref[$path];
95
96
        if (!is_file($file)) {
97
            var_dump('unable to retrieve the file : '.$file);
0 ignored issues
show
Security Debugging Code introduced by
var_dump('unable to retr... the file : ' . $file); looks like debug code. Are you sure you do not want to remove it? This might expose sensitive data.
Loading history...
98
        }
99
100
        $this->fp = fopen($file, $mode);
101
102
        return true;
103
    }
104
105
    public function stream_read($count)
106
    {
107
        return fread($this->fp, $count);
108
    }
109
110
    public function stream_seek($offset, $whence = SEEK_SET): void
0 ignored issues
show
Unused Code introduced by
The parameter $offset is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $whence is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
111
    {
112
    }
113
114
    public function stream_set_option($option, $arg1, $arg2): void
0 ignored issues
show
Unused Code introduced by
The parameter $option is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $arg1 is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $arg2 is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
115
    {
116
    }
117
118
    public function stream_stat(): void
119
    {
120
    }
121
122
    public function stream_tell(): void
123
    {
124
    }
125
126
    public function stream_write($data): void
0 ignored issues
show
Unused Code introduced by
The parameter $data is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
127
    {
128
    }
129
130
    public function unlink($path): void
0 ignored issues
show
Unused Code introduced by
The parameter $path is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
131
    {
132
    }
133
134
    public function url_stat($path, $flags): void
0 ignored issues
show
Unused Code introduced by
The parameter $path is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $flags is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
135
    {
136
    }
137
}
138