mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 17:24:07 +02:00
psalm fixes
This commit is contained in:
parent
05cc363c9f
commit
4a93467905
12 changed files with 61 additions and 33 deletions
|
|
@ -76,7 +76,7 @@ class Share extends AbstractShare {
|
|||
}
|
||||
|
||||
private function getAuthFileArgument(): string {
|
||||
if ($this->server->getAuth()->getUsername()) {
|
||||
if ($this->server->getAuth()->getUsername() !== null) {
|
||||
return '--authentication-file=' . $this->system->getFD(3);
|
||||
} else {
|
||||
return '';
|
||||
|
|
@ -94,13 +94,13 @@ class Share extends AbstractShare {
|
|||
$command = sprintf(
|
||||
'%s %s%s -t %s %s %s %s %s %s',
|
||||
self::EXEC_CMD,
|
||||
$stdBuf ? $stdBuf . ' -o0 ' : '',
|
||||
($stdBuf !== null) ? $stdBuf . ' -o0 ' : '',
|
||||
$smbClient,
|
||||
$this->server->getOptions()->getTimeout(),
|
||||
$this->getAuthFileArgument(),
|
||||
$this->server->getAuth()->getExtraCommandLineArguments(),
|
||||
$maxProtocol ? "--option='client max protocol=" . $maxProtocol . "'" : "",
|
||||
$minProtocol ? "--option='client min protocol=" . $minProtocol . "'" : "",
|
||||
($maxProtocol !== null) ? "--option='client max protocol=" . $maxProtocol . "'" : "",
|
||||
($minProtocol !== null) ? "--option='client min protocol=" . $minProtocol . "'" : "",
|
||||
escapeshellarg('//' . $this->server->getHost() . '/' . $this->name)
|
||||
);
|
||||
$connection = new Connection($command, $this->parser);
|
||||
|
|
@ -439,7 +439,7 @@ class Share extends AbstractShare {
|
|||
* @throws DependencyException
|
||||
*/
|
||||
public function notify(string $path): INotifyHandler {
|
||||
if (!$this->system->getStdBufPath()) { //stdbuf is required to disable smbclient's output buffering
|
||||
if ($this->system->getStdBufPath() == null) { //stdbuf is required to disable smbclient's output buffering
|
||||
throw new DependencyException('stdbuf is required for usage of the notify command');
|
||||
}
|
||||
$connection = $this->getConnection(); // use a fresh connection since the notify command blocks the process
|
||||
|
|
@ -519,7 +519,7 @@ class Share extends AbstractShare {
|
|||
*/
|
||||
protected function getAcls(string $path): array {
|
||||
$commandPath = $this->system->getSmbcAclsPath();
|
||||
if (!$commandPath) {
|
||||
if ($commandPath === null) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue