Skip to content

Commit 3b251ea

Browse files
Merge pull request #3570 from nextcloud/refactor/rector
2 parents 6158d31 + 6d5c747 commit 3b251ea

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+194
-157
lines changed

β€Žlib/ACL/ACLCacheWrapper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
class ACLCacheWrapper extends CacheWrapper {
1818
public function __construct(
1919
ICache $cache,
20-
private ACLManager $aclManager,
21-
private bool $inShare,
20+
private readonly ACLManager $aclManager,
21+
private readonly bool $inShare,
2222
) {
2323
parent::__construct($cache);
2424
}

β€Žlib/ACL/ACLManager.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@
1717
use RuntimeException;
1818

1919
class ACLManager {
20-
private CappedMemoryCache $ruleCache;
20+
private readonly CappedMemoryCache $ruleCache;
2121

2222
public function __construct(
23-
private RuleManager $ruleManager,
24-
private TrashManager $trashManager,
25-
private LoggerInterface $logger,
26-
private IUser $user,
27-
private \Closure $rootFolderProvider,
23+
private readonly RuleManager $ruleManager,
24+
private readonly TrashManager $trashManager,
25+
private readonly LoggerInterface $logger,
26+
private readonly IUser $user,
27+
private readonly \Closure $rootFolderProvider,
2828
private ?int $rootStorageId = null,
29-
private bool $inheritMergePerUser = false,
29+
private readonly bool $inheritMergePerUser = false,
3030
) {
3131
$this->ruleCache = new CappedMemoryCache();
3232
}

β€Žlib/ACL/ACLManagerFactory.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515

1616
class ACLManagerFactory {
1717
public function __construct(
18-
private RuleManager $ruleManager,
19-
private TrashManager $trashManager,
20-
private IAppConfig $config,
21-
private LoggerInterface $logger,
22-
private \Closure $rootFolderProvider,
18+
private readonly RuleManager $ruleManager,
19+
private readonly TrashManager $trashManager,
20+
private readonly IAppConfig $config,
21+
private readonly LoggerInterface $logger,
22+
private readonly \Closure $rootFolderProvider,
2323
) {
2424
}
2525

β€Žlib/ACL/ACLStorageWrapper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
use OCP\Files\Storage\IStorage;
1818

1919
class ACLStorageWrapper extends Wrapper implements IConstructableStorage {
20-
private ACLManager $aclManager;
21-
private bool $inShare;
20+
private readonly ACLManager $aclManager;
21+
private readonly bool $inShare;
2222

2323
public function __construct($arguments) {
2424
parent::__construct($arguments);

β€Žlib/ACL/Rule.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ class Rule implements XmlSerializable, XmlDeserializable, \JsonSerializable {
4040
* and one that specifies the permissions to set for non inherited values (1-> allow, 0 -> deny)
4141
*/
4242
public function __construct(
43-
private IUserMapping $userMapping,
44-
private int $fileId,
43+
private readonly IUserMapping $userMapping,
44+
private readonly int $fileId,
4545
private int $mask,
4646
int $permissions,
4747
) {
@@ -86,9 +86,6 @@ public function applyPermissions(int $permissions): int {
8686
* Apply the deny permissions this rule to an existing permission set, returning the resulting permissions
8787
*
8888
* Only the deny permissions included in the current mask will overwrite the existing permissions
89-
*
90-
* @param int $permissions
91-
* @return int
9289
*/
9390
public function applyDenyPermissions(int $permissions): int {
9491
$invertedMask = ~$this->mask;
@@ -98,9 +95,6 @@ public function applyDenyPermissions(int $permissions): int {
9895
return $permissions & $denyMask;
9996
}
10097

101-
/**
102-
* @return void
103-
*/
10498
public function xmlSerialize(Writer $writer): void {
10599
$data = [
106100
self::ACL => [

β€Žlib/ACL/RuleManager.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919

2020
class RuleManager {
2121
public function __construct(
22-
private IDBConnection $connection,
23-
private IUserMappingManager $userMappingManager,
24-
private IEventDispatcher $eventDispatcher,
22+
private readonly IDBConnection $connection,
23+
private readonly IUserMappingManager $userMappingManager,
24+
private readonly IEventDispatcher $eventDispatcher,
2525
) {
2626
}
2727

β€Žlib/ACL/UserMapping/UserMapping.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
namespace OCA\GroupFolders\ACL\UserMapping;
1010

1111
class UserMapping implements IUserMapping {
12-
private string $displayName;
12+
private readonly string $displayName;
1313

1414
/**
1515
* @param 'user'|'group'|'dummy' $type
1616
*/
1717
public function __construct(
18-
private string $type,
19-
private string $id,
18+
private readonly string $type,
19+
private readonly string $id,
2020
?string $displayName = null,
2121
) {
2222
$this->displayName = $displayName ?? $id;

β€Žlib/ACL/UserMapping/UserMappingManager.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515

1616
class UserMappingManager implements IUserMappingManager {
1717
public function __construct(
18-
private IGroupManager $groupManager,
19-
private IUserManager $userManager,
18+
private readonly IGroupManager $groupManager,
19+
private readonly IUserManager $userManager,
2020
) {
2121
}
2222

β€Žlib/AppInfo/Application.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ public function register(IRegistrationContext $context): void {
125125
$c->get(FolderManager::class),
126126
$c->get(TrashManager::class),
127127
$c->get('GroupAppFolder'),
128-
$c->get(MountProvider::class),
129128
$c->get(ACLManagerFactory::class),
130129
$c->get(IRootFolder::class),
131130
$c->get(LoggerInterface::class),

β€Žlib/AppInfo/Capabilities.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515

1616
class Capabilities implements ICapability {
1717
public function __construct(
18-
private IUserSession $userSession,
19-
private FolderManager $folderManager,
20-
private IAppManager $appManager,
18+
private readonly IUserSession $userSession,
19+
private readonly FolderManager $folderManager,
20+
private readonly IAppManager $appManager,
2121
) {
2222
}
2323

0 commit comments

Comments
Β (0)