Code Duplication    Length = 13-13 lines in 2 locations

src/Native/NativeStream.php 1 location

@@ 53-65 (lines=13) @@
50
	 * @param string $url
51
	 * @return resource
52
	 */
53
	public static function wrap($state, $smbStream, $mode, $url) {
54
		stream_wrapper_register('nativesmb', NativeStream::class);
55
		$context = stream_context_create([
56
			'nativesmb' => [
57
				'state'  => $state,
58
				'handle' => $smbStream,
59
				'url'    => $url
60
			]
61
		]);
62
		$fh = fopen('nativesmb://', $mode, false, $context);
63
		stream_wrapper_unregister('nativesmb');
64
		return $fh;
65
	}
66
67
	public function stream_close() {
68
		try {

src/Native/NativeWriteStream.php 1 location

@@ 41-53 (lines=13) @@
38
	 * @param string $url
39
	 * @return resource
40
	 */
41
	public static function wrap($state, $smbStream, $mode, $url) {
42
		stream_wrapper_register('nativesmb', NativeWriteStream::class);
43
		$context = stream_context_create([
44
			'nativesmb' => [
45
				'state'  => $state,
46
				'handle' => $smbStream,
47
				'url'    => $url
48
			]
49
		]);
50
		$fh = fopen('nativesmb://', $mode, false, $context);
51
		stream_wrapper_unregister('nativesmb');
52
		return $fh;
53
	}
54
55
	public function stream_seek($offset, $whence = SEEK_SET) {
56
		$this->flushWrite();