Skip to content

Commit

Permalink
refactor: Eliminate \OC::$server->get calls
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Wurst <[email protected]>
  • Loading branch information
ChristophWurst committed Sep 10, 2024
1 parent 9854ce5 commit 6133774
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
8 changes: 7 additions & 1 deletion rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,10 @@
->withPreparedSets(
phpunitCodeQuality: true,
phpunit: true,
);
)
->withBootstrapFiles([
__DIR__ . '/../../lib/composer/autoload.php',
])
->withRules([
\ChristophWurst\Nextcloud\Rector\Rector\OcServerToOcpServerRector::class,
]);
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ protected function setUp(): void {
$this->l10n = $this->createMock(IL10N::class);
$this->contactCheck = new ContactCheck($this->contactsIntegration, $this->l10n);
$this->customEmailCheck = new CustomEmailCheck($this->l10n);
$this->dateCheck = new DateCheck($this->l10n, \OC::$server->get(ITimeFactory::class));
$this->dateCheck = new DateCheck($this->l10n, \OCP\Server::get(ITimeFactory::class));
$this->replyToCheck = new ReplyToCheck($this->l10n);
$this->linkCheck = new LinkCheck($this->l10n);
$this->service = new PhishingDetectionService($this->contactCheck, $this->customEmailCheck, $this->dateCheck, $this->replyToCheck, $this->linkCheck);
Expand Down
8 changes: 6 additions & 2 deletions vendor-bin/rector/composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"config": {
"sort-packages": true
},
"require-dev": {
"rector/rector": "^1.2.4"
}
"christophwurst/nextcloud-rector": "^0.0.4",
"rector/rector": "^1.2.4"
}
}

0 comments on commit 6133774

Please sign in to comment.