4
4
5
5
namespace Phplrt \Source ;
6
6
7
+ use Phplrt \Contracts \Source \SourceFactoryInterface ;
7
8
use Phplrt \Contracts \Source \FileInterface ;
8
9
use Phplrt \Contracts \Source \ReadableInterface ;
9
- use Phplrt \Contracts \Source \SourceFactoryInterface ;
10
10
use Phplrt \Source \Exception \NotCreatableException ;
11
11
use Phplrt \Source \Exception \NotFoundException ;
12
12
use Phplrt \Source \Exception \NotReadableException ;
@@ -41,21 +41,18 @@ final class SourceFactory implements SourceFactoryInterface
41
41
42
42
/**
43
43
* @var non-empty-string
44
- *
45
44
* @psalm-readonly-allow-private-mutation
46
45
*/
47
46
public string $ algo = self ::DEFAULT_HASH_ALGO ;
48
47
49
48
/**
50
49
* @var non-empty-string
51
- *
52
50
* @psalm-readonly-allow-private-mutation
53
51
*/
54
52
public string $ temp = self ::DEFAULT_TEMP_STREAM ;
55
53
56
54
/**
57
55
* @var int<1, max>
58
- *
59
56
* @psalm-readonly-allow-private-mutation
60
57
*/
61
58
public int $ chunkSize = self ::DEFAULT_CHUNK_SIZE ;
@@ -66,12 +63,12 @@ final class SourceFactory implements SourceFactoryInterface
66
63
private array $ providers = [];
67
64
68
65
/**
69
- * @param non-empty-string $algo hashing algorithm for the sources
70
- * @param non-empty-string $temp the name of the temporary stream, which is
71
- * used as a resource during the reading of the source
72
- * @param int<1, max> $chunkSize the chunk size used while non-blocking
73
- * reading the file inside the {@see \Fiber} context
74
- * @param list<SourceProviderInterface> $providers list of source providers
66
+ * @param non-empty-string $algo Hashing algorithm for the sources.
67
+ * @param non-empty-string $temp The name of the temporary stream, which is
68
+ * used as a resource during the reading of the source.
69
+ * @param int<1, max> $chunkSize The chunk size used while non-blocking
70
+ * reading the file inside the {@see \Fiber} context.
71
+ * @param list<SourceProviderInterface> $providers List of source providers.
75
72
*/
76
73
public function __construct (
77
74
string $ algo = self ::DEFAULT_HASH_ALGO ,
@@ -139,7 +136,7 @@ public function create($source): ReadableInterface
139
136
throw NotCreatableException::fromInvalidType ($ source );
140
137
}
141
138
142
- public function createFromString (string $ content = '' , ? string $ name = null ): ReadableInterface
139
+ public function createFromString (string $ content = '' , string $ name = null ): ReadableInterface
143
140
{
144
141
assert ($ name !== '' , 'Name must not be empty ' );
145
142
@@ -166,7 +163,7 @@ public function createFromFile(string $filename): FileInterface
166
163
/**
167
164
* @throws NotReadableException
168
165
*/
169
- public function createFromStream ($ stream , ? string $ name = null ): ReadableInterface
166
+ public function createFromStream ($ stream , string $ name = null ): ReadableInterface
170
167
{
171
168
assert ($ name !== '' , 'Name must not be empty ' );
172
169
0 commit comments