add final to classes

This commit is contained in:
Robin Appelman 2025-10-25 17:51:52 +02:00
commit edc9703e6b
50 changed files with 50 additions and 49 deletions

View file

@ -6,7 +6,7 @@
namespace Icewind\SMB;
class ACL {
final class ACL {
const TYPE_ALLOW = 0;
const TYPE_DENY = 1;

View file

@ -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;
}

View file

@ -6,7 +6,7 @@
namespace Icewind\SMB;
class BasicAuth implements IAuth {
final class BasicAuth implements IAuth {
/** @var string */
private $username;
/** @var string|null */

View file

@ -6,7 +6,7 @@
namespace Icewind\SMB;
class Change {
final class Change {
/** @var int */
private $code;
/** @var string */

View file

@ -6,5 +6,5 @@
namespace Icewind\SMB\Exception;
class AccessDeniedException extends ConnectException {
final class AccessDeniedException extends ConnectException {
}

View file

@ -6,5 +6,5 @@
namespace Icewind\SMB\Exception;
class AlreadyExistsException extends InvalidRequestException {
final class AlreadyExistsException extends InvalidRequestException {
}

View file

@ -6,5 +6,5 @@
namespace Icewind\SMB\Exception;
class AuthenticationException extends ConnectException {
final class AuthenticationException extends ConnectException {
}

View file

@ -6,5 +6,5 @@
namespace Icewind\SMB\Exception;
class ConnectionAbortedException extends ConnectException {
final class ConnectionAbortedException extends ConnectException {
}

View file

@ -6,5 +6,5 @@
namespace Icewind\SMB\Exception;
class ConnectionException extends ConnectException {
final class ConnectionException extends ConnectException {
}

View file

@ -6,5 +6,5 @@
namespace Icewind\SMB\Exception;
class ConnectionRefusedException extends ConnectException {
final class ConnectionRefusedException extends ConnectException {
}

View file

@ -6,5 +6,5 @@
namespace Icewind\SMB\Exception;
class ConnectionResetException extends ConnectException {
final class ConnectionResetException extends ConnectException {
}

View file

@ -6,5 +6,5 @@
namespace Icewind\SMB\Exception;
class DependencyException extends Exception {
final class DependencyException extends Exception {
}

View file

@ -6,5 +6,5 @@
namespace Icewind\SMB\Exception;
class FileInUseException extends InvalidRequestException {
final class FileInUseException extends InvalidRequestException {
}

View file

@ -6,5 +6,5 @@
namespace Icewind\SMB\Exception;
class ForbiddenException extends InvalidRequestException {
final class ForbiddenException extends InvalidRequestException {
}

View file

@ -6,5 +6,5 @@
namespace Icewind\SMB\Exception;
class HostDownException extends ConnectException {
final class HostDownException extends ConnectException {
}

View file

@ -6,5 +6,5 @@
namespace Icewind\SMB\Exception;
class InvalidArgumentException extends InvalidRequestException {
final class InvalidArgumentException extends InvalidRequestException {
}

View file

@ -6,5 +6,5 @@
namespace Icewind\SMB\Exception;
class InvalidHostException extends ConnectException {
final class InvalidHostException extends ConnectException {
}

View file

@ -6,5 +6,5 @@
namespace Icewind\SMB\Exception;
class InvalidParameterException extends InvalidRequestException {
final class InvalidParameterException extends InvalidRequestException {
}

View file

@ -6,5 +6,5 @@
namespace Icewind\SMB\Exception;
class InvalidPathException extends InvalidRequestException {
final class InvalidPathException extends InvalidRequestException {
}

View file

@ -6,5 +6,5 @@
namespace Icewind\SMB\Exception;
class InvalidResourceException extends Exception {
final class InvalidResourceException extends Exception {
}

View file

@ -8,5 +8,5 @@ declare(strict_types=1);
namespace Icewind\SMB\Exception;
class InvalidTicket extends Exception {
final class InvalidTicket extends Exception {
}

View file

@ -6,5 +6,5 @@
namespace Icewind\SMB\Exception;
class InvalidTypeException extends InvalidRequestException {
final class InvalidTypeException extends InvalidRequestException {
}

View file

@ -6,5 +6,5 @@
namespace Icewind\SMB\Exception;
class NoLoginServerException extends ConnectException {
final class NoLoginServerException extends ConnectException {
}

View file

@ -6,5 +6,5 @@
namespace Icewind\SMB\Exception;
class NoRouteToHostException extends ConnectException {
final class NoRouteToHostException extends ConnectException {
}

View file

@ -6,5 +6,5 @@
namespace Icewind\SMB\Exception;
class NotEmptyException extends InvalidRequestException {
final class NotEmptyException extends InvalidRequestException {
}

View file

@ -6,5 +6,5 @@
namespace Icewind\SMB\Exception;
class NotFoundException extends InvalidRequestException {
final class NotFoundException extends InvalidRequestException {
}

View file

@ -6,5 +6,5 @@
namespace Icewind\SMB\Exception;
class OutOfSpaceException extends InvalidRequestException {
final class OutOfSpaceException extends InvalidRequestException {
}

View file

@ -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);
}

View file

@ -6,5 +6,5 @@
namespace Icewind\SMB\Exception;
class TimedOutException extends ConnectException {
final class TimedOutException extends ConnectException {
}

View file

@ -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();

View file

@ -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 */

View file

@ -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 */

View file

@ -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 */

View file

@ -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
*/

View file

@ -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
*/

View file

@ -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;

View file

@ -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 */

View file

@ -6,7 +6,7 @@
namespace Icewind\SMB;
class Options implements IOptions {
final class Options implements IOptions {
/** @var int */
private $timeout = 20;

View file

@ -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

View file

@ -8,7 +8,7 @@ declare(strict_types=1);
namespace Icewind\SMB;
class StringBuffer {
final class StringBuffer {
/** @var string */
private $buffer = "";
/** @var int */

View file

@ -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 = [];

View file

@ -5,7 +5,7 @@
*/
namespace Icewind\SMB;
class TimeZoneProvider implements ITimeZoneProvider {
final class TimeZoneProvider implements ITimeZoneProvider {
/**
* @var string[]
*/

View file

@ -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;

View file

@ -6,7 +6,7 @@
namespace Icewind\SMB\Wrapped;
class ErrorCodes {
final class ErrorCodes {
/**
* connection errors
*/

View file

@ -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 */

View file

@ -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;

View file

@ -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 ';
/**

View 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
*

View file

@ -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
*/