in core/Command/Info, /Integrity, and /Preview classes.
Signed-off-by: Faraz Samapoor <fsa@adlas.at>
class File extends Command {
private IL10N $l10n;
- private FileUtils $fileUtils;
- public function __construct(IFactory $l10nFactory, FileUtils $fileUtils) {
+ public function __construct(
+ IFactory $l10nFactory,
+ private FileUtils $fileUtils,
+ ) {
$this->l10n = $l10nFactory->get("core");
- $this->fileUtils = $fileUtils;
parent::__construct();
}
namespace OC\Core\Command\Info;
-use OC\Files\SetupManager;
use OCA\Circles\MountManager\CircleMount;
use OCA\Files_External\Config\ExternalMountPoint;
use OCA\Files_Sharing\SharedMount;
use OCP\Files\FileInfo;
use OCP\Files\IHomeStorage;
use OCP\Files\IRootFolder;
-use OCP\Files\Mount\IMountManager;
use OCP\Files\Mount\IMountPoint;
use OCP\Files\Node;
use OCP\Files\NotFoundException;
use OCP\Files\Folder;
class FileUtils {
- private IRootFolder $rootFolder;
- private IUserMountCache $userMountCache;
- private IMountManager $mountManager;
- private SetupManager $setupManager;
-
public function __construct(
- IRootFolder $rootFolder,
- IUserMountCache $userMountCache,
- IMountManager $mountManager,
- SetupManager $setupManager
+ private IRootFolder $rootFolder,
+ private IUserMountCache $userMountCache,
) {
- $this->rootFolder = $rootFolder;
- $this->userMountCache = $userMountCache;
- $this->mountManager = $mountManager;
- $this->setupManager = $setupManager;
}
/**
use Symfony\Component\Console\Output\OutputInterface;
class Space extends Command {
- private FileUtils $fileUtils;
-
- public function __construct(FileUtils $fileUtils) {
- $this->fileUtils = $fileUtils;
+ public function __construct(private FileUtils $fileUtils) {
parent::__construct();
}
* @package OC\Core\Command\Integrity
*/
class CheckApp extends Base {
- private Checker $checker;
-
- public function __construct(Checker $checker) {
+ public function __construct(private Checker $checker) {
parent::__construct();
- $this->checker = $checker;
}
/**
* @package OC\Core\Command\Integrity
*/
class CheckCore extends Base {
- private Checker $checker;
-
- public function __construct(Checker $checker) {
+ public function __construct(private Checker $checker) {
parent::__construct();
- $this->checker = $checker;
}
/**
* @package OC\Core\Command\Integrity
*/
class SignApp extends Command {
- private Checker $checker;
- private FileAccessHelper $fileAccessHelper;
- private IURLGenerator $urlGenerator;
-
- public function __construct(Checker $checker,
- FileAccessHelper $fileAccessHelper,
- IURLGenerator $urlGenerator) {
+ public function __construct(
+ private Checker $checker,
+ private FileAccessHelper $fileAccessHelper,
+ private IURLGenerator $urlGenerator,
+ ) {
parent::__construct(null);
- $this->checker = $checker;
- $this->fileAccessHelper = $fileAccessHelper;
- $this->urlGenerator = $urlGenerator;
}
protected function configure() {
* @package OC\Core\Command\Integrity
*/
class SignCore extends Command {
- private Checker $checker;
- private FileAccessHelper $fileAccessHelper;
-
- public function __construct(Checker $checker,
- FileAccessHelper $fileAccessHelper) {
+ public function __construct(
+ private Checker $checker,
+ private FileAccessHelper $fileAccessHelper,
+ ) {
parent::__construct(null);
- $this->checker = $checker;
- $this->fileAccessHelper = $fileAccessHelper;
}
protected function configure() {
use Symfony\Component\Console\Output\OutputInterface;
class Generate extends Command {
- private IRootFolder $rootFolder;
- private IUserMountCache $userMountCache;
- private IPreview $previewManager;
-
- public function __construct(IRootFolder $rootFolder, IUserMountCache $userMountCache, IPreview $previewManager) {
- $this->rootFolder = $rootFolder;
- $this->userMountCache = $userMountCache;
- $this->previewManager = $previewManager;
-
+ public function __construct(
+ private IRootFolder $rootFolder,
+ private IUserMountCache $userMountCache,
+ private IPreview $previewManager,
+ ) {
parent::__construct();
}
use function pcntl_signal;
class Repair extends Command {
- protected IConfig $config;
- private IRootFolder $rootFolder;
- private LoggerInterface $logger;
private bool $stopSignalReceived = false;
private int $memoryLimit;
private int $memoryTreshold;
- private ILockingProvider $lockingProvider;
-
- public function __construct(IConfig $config, IRootFolder $rootFolder, LoggerInterface $logger, IniGetWrapper $phpIni, ILockingProvider $lockingProvider) {
- $this->config = $config;
- $this->rootFolder = $rootFolder;
- $this->logger = $logger;
- $this->lockingProvider = $lockingProvider;
+ public function __construct(
+ protected IConfig $config,
+ private IRootFolder $rootFolder,
+ private LoggerInterface $logger,
+ IniGetWrapper $phpIni,
+ private ILockingProvider $lockingProvider,
+ ) {
$this->memoryLimit = (int)$phpIni->getBytes('memory_limit');
$this->memoryTreshold = $this->memoryLimit - 25 * 1024 * 1024;
use Symfony\Component\Console\Output\OutputInterface;
class ResetRenderedTexts extends Command {
- protected IDBConnection $connection;
- protected IUserManager $userManager;
- protected IAvatarManager $avatarManager;
- private Root $previewFolder;
- private IMimeTypeLoader $mimeTypeLoader;
-
- public function __construct(IDBConnection $connection,
- IUserManager $userManager,
- IAvatarManager $avatarManager,
- Root $previewFolder,
- IMimeTypeLoader $mimeTypeLoader) {
+ public function __construct(
+ protected IDBConnection $connection,
+ protected IUserManager $userManager,
+ protected IAvatarManager $avatarManager,
+ private Root $previewFolder,
+ private IMimeTypeLoader $mimeTypeLoader,
+ ) {
parent::__construct();
-
- $this->connection = $connection;
- $this->userManager = $userManager;
- $this->avatarManager = $avatarManager;
- $this->previewFolder = $previewFolder;
- $this->mimeTypeLoader = $mimeTypeLoader;
}
protected function configure() {