mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 09:14:06 +02:00
add final to classes
This commit is contained in:
parent
9fe44e475a
commit
edc9703e6b
50 changed files with 50 additions and 49 deletions
|
|
@ -6,6 +6,7 @@
|
|||
xmlns="https://getpsalm.org/schema/config"
|
||||
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
|
||||
findUnusedCode="false"
|
||||
ensureOverrideAttribute="false"
|
||||
>
|
||||
<stubs>
|
||||
<file name="tests/krb.phpstub" preloadClasses="true"/>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
namespace Icewind\SMB;
|
||||
|
||||
class ACL {
|
||||
final class ACL {
|
||||
const TYPE_ALLOW = 0;
|
||||
const TYPE_DENY = 1;
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ namespace Icewind\SMB;
|
|||
|
||||
use Icewind\SMB\Exception\Exception;
|
||||
|
||||
class AnonymousAuth implements IAuth {
|
||||
final class AnonymousAuth implements IAuth {
|
||||
public function getUsername(): ?string {
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
namespace Icewind\SMB;
|
||||
|
||||
class BasicAuth implements IAuth {
|
||||
final class BasicAuth implements IAuth {
|
||||
/** @var string */
|
||||
private $username;
|
||||
/** @var string|null */
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
namespace Icewind\SMB;
|
||||
|
||||
class Change {
|
||||
final class Change {
|
||||
/** @var int */
|
||||
private $code;
|
||||
/** @var string */
|
||||
|
|
|
|||
|
|
@ -6,5 +6,5 @@
|
|||
|
||||
namespace Icewind\SMB\Exception;
|
||||
|
||||
class AccessDeniedException extends ConnectException {
|
||||
final class AccessDeniedException extends ConnectException {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,5 +6,5 @@
|
|||
|
||||
namespace Icewind\SMB\Exception;
|
||||
|
||||
class AlreadyExistsException extends InvalidRequestException {
|
||||
final class AlreadyExistsException extends InvalidRequestException {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,5 +6,5 @@
|
|||
|
||||
namespace Icewind\SMB\Exception;
|
||||
|
||||
class AuthenticationException extends ConnectException {
|
||||
final class AuthenticationException extends ConnectException {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,5 +6,5 @@
|
|||
|
||||
namespace Icewind\SMB\Exception;
|
||||
|
||||
class ConnectionAbortedException extends ConnectException {
|
||||
final class ConnectionAbortedException extends ConnectException {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,5 +6,5 @@
|
|||
|
||||
namespace Icewind\SMB\Exception;
|
||||
|
||||
class ConnectionException extends ConnectException {
|
||||
final class ConnectionException extends ConnectException {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,5 +6,5 @@
|
|||
|
||||
namespace Icewind\SMB\Exception;
|
||||
|
||||
class ConnectionRefusedException extends ConnectException {
|
||||
final class ConnectionRefusedException extends ConnectException {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,5 +6,5 @@
|
|||
|
||||
namespace Icewind\SMB\Exception;
|
||||
|
||||
class ConnectionResetException extends ConnectException {
|
||||
final class ConnectionResetException extends ConnectException {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,5 +6,5 @@
|
|||
|
||||
namespace Icewind\SMB\Exception;
|
||||
|
||||
class DependencyException extends Exception {
|
||||
final class DependencyException extends Exception {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,5 +6,5 @@
|
|||
|
||||
namespace Icewind\SMB\Exception;
|
||||
|
||||
class FileInUseException extends InvalidRequestException {
|
||||
final class FileInUseException extends InvalidRequestException {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,5 +6,5 @@
|
|||
|
||||
namespace Icewind\SMB\Exception;
|
||||
|
||||
class ForbiddenException extends InvalidRequestException {
|
||||
final class ForbiddenException extends InvalidRequestException {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,5 +6,5 @@
|
|||
|
||||
namespace Icewind\SMB\Exception;
|
||||
|
||||
class HostDownException extends ConnectException {
|
||||
final class HostDownException extends ConnectException {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,5 +6,5 @@
|
|||
|
||||
namespace Icewind\SMB\Exception;
|
||||
|
||||
class InvalidArgumentException extends InvalidRequestException {
|
||||
final class InvalidArgumentException extends InvalidRequestException {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,5 +6,5 @@
|
|||
|
||||
namespace Icewind\SMB\Exception;
|
||||
|
||||
class InvalidHostException extends ConnectException {
|
||||
final class InvalidHostException extends ConnectException {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,5 +6,5 @@
|
|||
|
||||
namespace Icewind\SMB\Exception;
|
||||
|
||||
class InvalidParameterException extends InvalidRequestException {
|
||||
final class InvalidParameterException extends InvalidRequestException {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,5 +6,5 @@
|
|||
|
||||
namespace Icewind\SMB\Exception;
|
||||
|
||||
class InvalidPathException extends InvalidRequestException {
|
||||
final class InvalidPathException extends InvalidRequestException {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,5 +6,5 @@
|
|||
|
||||
namespace Icewind\SMB\Exception;
|
||||
|
||||
class InvalidResourceException extends Exception {
|
||||
final class InvalidResourceException extends Exception {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,5 +8,5 @@ declare(strict_types=1);
|
|||
|
||||
namespace Icewind\SMB\Exception;
|
||||
|
||||
class InvalidTicket extends Exception {
|
||||
final class InvalidTicket extends Exception {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,5 +6,5 @@
|
|||
|
||||
namespace Icewind\SMB\Exception;
|
||||
|
||||
class InvalidTypeException extends InvalidRequestException {
|
||||
final class InvalidTypeException extends InvalidRequestException {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,5 +6,5 @@
|
|||
|
||||
namespace Icewind\SMB\Exception;
|
||||
|
||||
class NoLoginServerException extends ConnectException {
|
||||
final class NoLoginServerException extends ConnectException {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,5 +6,5 @@
|
|||
|
||||
namespace Icewind\SMB\Exception;
|
||||
|
||||
class NoRouteToHostException extends ConnectException {
|
||||
final class NoRouteToHostException extends ConnectException {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,5 +6,5 @@
|
|||
|
||||
namespace Icewind\SMB\Exception;
|
||||
|
||||
class NotEmptyException extends InvalidRequestException {
|
||||
final class NotEmptyException extends InvalidRequestException {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,5 +6,5 @@
|
|||
|
||||
namespace Icewind\SMB\Exception;
|
||||
|
||||
class NotFoundException extends InvalidRequestException {
|
||||
final class NotFoundException extends InvalidRequestException {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,5 +6,5 @@
|
|||
|
||||
namespace Icewind\SMB\Exception;
|
||||
|
||||
class OutOfSpaceException extends InvalidRequestException {
|
||||
final class OutOfSpaceException extends InvalidRequestException {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ namespace Icewind\SMB\Exception;
|
|||
|
||||
use Throwable;
|
||||
|
||||
class RevisionMismatchException extends Exception {
|
||||
final class RevisionMismatchException extends Exception {
|
||||
public function __construct(string $message = 'Protocol version mismatch', int $code = 0, ?Throwable $previous = null) {
|
||||
parent::__construct($message, $code, $previous);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,5 +6,5 @@
|
|||
|
||||
namespace Icewind\SMB\Exception;
|
||||
|
||||
class TimedOutException extends ConnectException {
|
||||
final class TimedOutException extends ConnectException {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ use Icewind\SMB\Exception\InvalidTicket;
|
|||
*
|
||||
* @deprecated Use `KerberosAuth` with `$auth->setTicket(KerberosTicket::fromEnv())` instead
|
||||
*/
|
||||
class KerberosApacheAuth extends KerberosAuth implements IAuth {
|
||||
final class KerberosApacheAuth extends KerberosAuth implements IAuth {
|
||||
public function getTicket(): KerberosTicket {
|
||||
if ($this->ticket === null) {
|
||||
$ticket = KerberosTicket::fromEnv();
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ namespace Icewind\SMB;
|
|||
use Icewind\SMB\Exception\InvalidTicket;
|
||||
use KRB5CCache;
|
||||
|
||||
class KerberosTicket {
|
||||
final class KerberosTicket {
|
||||
/** @var KRB5CCache */
|
||||
private $krb5;
|
||||
/** @var string */
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ use Icewind\SMB\Exception\Exception;
|
|||
use Icewind\SMB\Exception\NotFoundException;
|
||||
use Icewind\SMB\IFileInfo;
|
||||
|
||||
class NativeFileInfo implements IFileInfo {
|
||||
final class NativeFileInfo implements IFileInfo {
|
||||
/** @var string */
|
||||
protected $path;
|
||||
/** @var string */
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ use Icewind\SMB\StringBuffer;
|
|||
/**
|
||||
* Stream optimized for read only usage
|
||||
*/
|
||||
class NativeReadStream extends NativeStream {
|
||||
final class NativeReadStream extends NativeStream {
|
||||
const CHUNK_SIZE = 1048576; // 1MB chunks
|
||||
|
||||
/** @var StringBuffer */
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ use Icewind\SMB\IShare;
|
|||
use Icewind\SMB\ISystem;
|
||||
use Icewind\SMB\ITimeZoneProvider;
|
||||
|
||||
class NativeServer extends AbstractServer {
|
||||
final class NativeServer extends AbstractServer {
|
||||
/**
|
||||
* @var NativeState
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ use Icewind\SMB\IServer;
|
|||
use Icewind\SMB\Wrapped\Server;
|
||||
use Icewind\SMB\Wrapped\Share;
|
||||
|
||||
class NativeShare extends AbstractShare {
|
||||
final class NativeShare extends AbstractShare {
|
||||
/**
|
||||
* @var IServer $server
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ use Icewind\SMB\IOptions;
|
|||
/**
|
||||
* Low level wrapper for libsmbclient-php with error handling
|
||||
*/
|
||||
class NativeState {
|
||||
final class NativeState {
|
||||
/** @var resource|null */
|
||||
protected $state = null;
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ use Icewind\SMB\StringBuffer;
|
|||
/**
|
||||
* Stream optimized for write only usage
|
||||
*/
|
||||
class NativeWriteStream extends NativeStream {
|
||||
final class NativeWriteStream extends NativeStream {
|
||||
const CHUNK_SIZE = 1048576; // 1MB chunks
|
||||
|
||||
/** @var StringBuffer */
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
namespace Icewind\SMB;
|
||||
|
||||
class Options implements IOptions {
|
||||
final class Options implements IOptions {
|
||||
/** @var int */
|
||||
private $timeout = 20;
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ use Icewind\SMB\Exception\DependencyException;
|
|||
use Icewind\SMB\Native\NativeServer;
|
||||
use Icewind\SMB\Wrapped\Server;
|
||||
|
||||
class ServerFactory {
|
||||
final class ServerFactory {
|
||||
const BACKENDS = [
|
||||
NativeServer::class,
|
||||
Server::class
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace Icewind\SMB;
|
||||
|
||||
class StringBuffer {
|
||||
final class StringBuffer {
|
||||
/** @var string */
|
||||
private $buffer = "";
|
||||
/** @var int */
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ namespace Icewind\SMB;
|
|||
|
||||
use Icewind\SMB\Exception\Exception;
|
||||
|
||||
class System implements ISystem {
|
||||
final class System implements ISystem {
|
||||
/** @var (string|null)[] */
|
||||
private $paths = [];
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
namespace Icewind\SMB;
|
||||
|
||||
class TimeZoneProvider implements ITimeZoneProvider {
|
||||
final class TimeZoneProvider implements ITimeZoneProvider {
|
||||
/**
|
||||
* @var string[]
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ use Icewind\SMB\Exception\ConnectionRefusedException;
|
|||
use Icewind\SMB\Exception\InvalidHostException;
|
||||
use Icewind\SMB\Exception\NoLoginServerException;
|
||||
|
||||
class Connection extends RawConnection {
|
||||
final class Connection extends RawConnection {
|
||||
const DELIMITER = 'smb:';
|
||||
const DELIMITER_LENGTH = 4;
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
namespace Icewind\SMB\Wrapped;
|
||||
|
||||
class ErrorCodes {
|
||||
final class ErrorCodes {
|
||||
/**
|
||||
* connection errors
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ namespace Icewind\SMB\Wrapped;
|
|||
use Icewind\SMB\ACL;
|
||||
use Icewind\SMB\IFileInfo;
|
||||
|
||||
class FileInfo implements IFileInfo {
|
||||
final class FileInfo implements IFileInfo {
|
||||
/** @var string */
|
||||
protected $path;
|
||||
/** @var string */
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ use Icewind\SMB\Exception\Exception;
|
|||
use Icewind\SMB\Exception\RevisionMismatchException;
|
||||
use Icewind\SMB\INotifyHandler;
|
||||
|
||||
class NotifyHandler implements INotifyHandler {
|
||||
final class NotifyHandler implements INotifyHandler {
|
||||
/** @var Connection */
|
||||
private $connection;
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ use Icewind\SMB\Exception\NoLoginServerException;
|
|||
use Icewind\SMB\Exception\NotEmptyException;
|
||||
use Icewind\SMB\Exception\NotFoundException;
|
||||
|
||||
class Parser {
|
||||
final class Parser {
|
||||
const MSG_NOT_FOUND = 'Error opening local file ';
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ use Icewind\SMB\Exception\InvalidHostException;
|
|||
use Icewind\SMB\IShare;
|
||||
use Icewind\SMB\ISystem;
|
||||
|
||||
class Server extends AbstractServer {
|
||||
final class Server extends AbstractServer {
|
||||
/**
|
||||
* Check if the smbclient php extension is available
|
||||
*
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ use Icewind\Streams\CallbackWrapper;
|
|||
use Icewind\SMB\Native\NativeShare;
|
||||
use Icewind\SMB\Native\NativeServer;
|
||||
|
||||
class Share extends AbstractShare {
|
||||
final class Share extends AbstractShare {
|
||||
/**
|
||||
* @var IServer $server
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue