mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 09:14:06 +02:00
code style
This commit is contained in:
parent
208057e445
commit
dae8dea06c
8 changed files with 15 additions and 15 deletions
|
|
@ -18,7 +18,7 @@ jobs:
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
uses: https://github.com/shivammathur/setup-php@v2
|
uses: https://github.com/shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: '8.0'
|
php-version: '8.1'
|
||||||
extensions: apcu
|
extensions: apcu
|
||||||
- name: Composer
|
- name: Composer
|
||||||
run: composer install
|
run: composer install
|
||||||
|
|
|
||||||
|
|
@ -9,13 +9,16 @@ $finder = PhpCsFixer\Finder::create()
|
||||||
->exclude('vendor')
|
->exclude('vendor')
|
||||||
->in(__DIR__)
|
->in(__DIR__)
|
||||||
;
|
;
|
||||||
return PhpCsFixer\Config::create()
|
return (new PhpCsFixer\Config())
|
||||||
->setRules([
|
->setRules([
|
||||||
'@PSR2' => true,
|
'@PSR2' => true,
|
||||||
|
'curly_braces_position' => [
|
||||||
|
'classes_opening_brace' => 'same_line',
|
||||||
|
'functions_opening_brace' => 'same_line',
|
||||||
|
],
|
||||||
'array_syntax' => ['syntax' => 'short'],
|
'array_syntax' => ['syntax' => 'short'],
|
||||||
'braces' => ['position_after_functions_and_oop_constructs' => 'same'],
|
'braces' => ['position_after_functions_and_oop_constructs' => 'same'],
|
||||||
'binary_operator_spaces' => ['align_double_arrow' => true, 'align_equals' => false],
|
'binary_operator_spaces' => ['operators' => ['=>' => 'align_single_space']],
|
||||||
])
|
])
|
||||||
->setIndent("\t")
|
->setIndent("\t")
|
||||||
->setFinder($finder)
|
->setFinder($finder);
|
||||||
;
|
|
||||||
|
|
@ -9,5 +9,4 @@ declare(strict_types=1);
|
||||||
namespace Icewind\SMB\Exception;
|
namespace Icewind\SMB\Exception;
|
||||||
|
|
||||||
class InvalidTicket extends Exception {
|
class InvalidTicket extends Exception {
|
||||||
|
}
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -12,4 +12,4 @@ class RevisionMismatchException extends Exception {
|
||||||
public function __construct(string $message = 'Protocol version mismatch', int $code = 0, ?Throwable $previous = null) {
|
public function __construct(string $message = 'Protocol version mismatch', int $code = 0, ?Throwable $previous = null) {
|
||||||
parent::__construct($message, $code, $previous);
|
parent::__construct($message, $code, $previous);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ class KerberosTicket {
|
||||||
return $this->cacheName;
|
return $this->cacheName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getName(): string{
|
public function getName(): string {
|
||||||
return $this->krb5->getName();
|
return $this->krb5->getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -82,4 +82,4 @@ class KerberosTicket {
|
||||||
}
|
}
|
||||||
return $ticket;
|
return $ticket;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -430,4 +430,4 @@ class NativeState {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -349,7 +349,7 @@ class Share extends AbstractShare {
|
||||||
$connection->write('get ' . $source . ' ' . $this->system->getFD(5));
|
$connection->write('get ' . $source . ' ' . $this->system->getFD(5));
|
||||||
$connection->write('exit');
|
$connection->write('exit');
|
||||||
$fh = $connection->getFileOutputStream();
|
$fh = $connection->getFileOutputStream();
|
||||||
$fh = CallbackWrapper::wrap($fh, function() use ($connection) {
|
$fh = CallbackWrapper::wrap($fh, function () use ($connection) {
|
||||||
$connection->write('');
|
$connection->write('');
|
||||||
});
|
});
|
||||||
if (!is_resource($fh)) {
|
if (!is_resource($fh)) {
|
||||||
|
|
@ -379,7 +379,7 @@ class Share extends AbstractShare {
|
||||||
|
|
||||||
// use a close callback to ensure the upload is finished before continuing
|
// use a close callback to ensure the upload is finished before continuing
|
||||||
// this also serves as a way to keep the connection in scope
|
// this also serves as a way to keep the connection in scope
|
||||||
$stream = CallbackWrapper::wrap($fh, function() use ($connection) {
|
$stream = CallbackWrapper::wrap($fh, function () use ($connection) {
|
||||||
$connection->write('');
|
$connection->write('');
|
||||||
}, null, function () use ($connection) {
|
}, null, function () use ($connection) {
|
||||||
$connection->close(false); // dont terminate, give the upload some time
|
$connection->close(false); // dont terminate, give the upload some time
|
||||||
|
|
|
||||||
|
|
@ -48,8 +48,6 @@ abstract class AbstractShareTest extends TestCase {
|
||||||
abstract public function getServerClass(): string;
|
abstract public function getServerClass(): string;
|
||||||
|
|
||||||
public function setUp(): void {
|
public function setUp(): void {
|
||||||
// ob_end_flush();
|
|
||||||
// var_dump($this->getName());
|
|
||||||
$this->config = json_decode(file_get_contents(__DIR__ . '/config.json'));
|
$this->config = json_decode(file_get_contents(__DIR__ . '/config.json'));
|
||||||
$options = new Options();
|
$options = new Options();
|
||||||
$options->setMinProtocol(IOptions::PROTOCOL_SMB2);
|
$options->setMinProtocol(IOptions::PROTOCOL_SMB2);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue