mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 17:24:07 +02:00
run php-cs-fixer
This commit is contained in:
parent
de8e83ce7e
commit
2842dffb51
41 changed files with 151 additions and 141 deletions
|
|
@ -25,7 +25,6 @@ class NativeReadStream extends NativeStream {
|
|||
$this->readBuffer = fopen('php://memory', 'r+');
|
||||
|
||||
return parent::stream_open($path, $mode, $options, $opened_path);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -39,13 +38,13 @@ class NativeReadStream extends NativeStream {
|
|||
*/
|
||||
public static function wrap($state, $smbStream, $mode, $url) {
|
||||
stream_wrapper_register('nativesmb', NativeReadStream::class);
|
||||
$context = stream_context_create(array(
|
||||
'nativesmb' => array(
|
||||
$context = stream_context_create([
|
||||
'nativesmb' => [
|
||||
'state' => $state,
|
||||
'handle' => $smbStream,
|
||||
'url' => $url
|
||||
)
|
||||
));
|
||||
]
|
||||
]);
|
||||
$fh = fopen('nativesmb://', $mode, false, $context);
|
||||
stream_wrapper_unregister('nativesmb');
|
||||
return $fh;
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ class NativeServer extends AbstractServer {
|
|||
*/
|
||||
public function listShares() {
|
||||
$this->connect();
|
||||
$shares = array();
|
||||
$shares = [];
|
||||
$dh = $this->state->opendir('smb://' . $this->getHost());
|
||||
while ($share = $this->state->readdir($dh)) {
|
||||
if ($share['type'] === 'file share') {
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ class NativeShare extends AbstractShare {
|
|||
* @throws \Icewind\SMB\Exception\InvalidTypeException
|
||||
*/
|
||||
public function dir($path) {
|
||||
$files = array();
|
||||
$files = [];
|
||||
|
||||
$dh = $this->getState()->opendir($this->buildUrl($path));
|
||||
while ($file = $this->getState()->readdir($dh)) {
|
||||
|
|
@ -277,7 +277,6 @@ class NativeShare extends AbstractShare {
|
|||
* @return string the attribute value
|
||||
*/
|
||||
public function setAttribute($path, $attribute, $value) {
|
||||
|
||||
if ($attribute === 'system.dos_attr.mode' and is_int($value)) {
|
||||
$value = '0x' . dechex($value);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,13 +48,13 @@ class NativeStream implements File {
|
|||
*/
|
||||
public static function wrap($state, $smbStream, $mode, $url) {
|
||||
stream_wrapper_register('nativesmb', NativeStream::class);
|
||||
$context = stream_context_create(array(
|
||||
'nativesmb' => array(
|
||||
$context = stream_context_create([
|
||||
'nativesmb' => [
|
||||
'state' => $state,
|
||||
'handle' => $smbStream,
|
||||
'url' => $url
|
||||
)
|
||||
));
|
||||
]
|
||||
]);
|
||||
$fh = fopen('nativesmb://', $mode, false, $context);
|
||||
stream_wrapper_unregister('nativesmb');
|
||||
return $fh;
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ class NativeWriteStream extends NativeStream {
|
|||
$this->writeBuffer = fopen('php://memory', 'r+');
|
||||
|
||||
return parent::stream_open($path, $mode, $options, $opened_path);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -39,13 +38,13 @@ class NativeWriteStream extends NativeStream {
|
|||
*/
|
||||
public static function wrap($state, $smbStream, $mode, $url) {
|
||||
stream_wrapper_register('nativesmb', NativeWriteStream::class);
|
||||
$context = stream_context_create(array(
|
||||
'nativesmb' => array(
|
||||
$context = stream_context_create([
|
||||
'nativesmb' => [
|
||||
'state' => $state,
|
||||
'handle' => $smbStream,
|
||||
'url' => $url
|
||||
)
|
||||
));
|
||||
]
|
||||
]);
|
||||
$fh = fopen('nativesmb://', $mode, false, $context);
|
||||
stream_wrapper_unregister('nativesmb');
|
||||
return $fh;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue