diff --git a/REUSE.toml b/REUSE.toml
index 1b4fa908d..fc1b58b3d 100644
--- a/REUSE.toml
+++ b/REUSE.toml
@@ -36,7 +36,7 @@ SPDX-FileCopyrightText = "2023 Nextcloud GmbH and Nextcloud contributors"
SPDX-License-Identifier = "AGPL-3.0-or-later"
[[annotations]]
-path = ["vendor-bin/cs-fixer/composer.json", "vendor-bin/cs-fixer/composer.lock", "vendor-bin/psalm/composer.json", "vendor-bin/psalm/composer.lock", "vendor-bin/phpunit/composer.json", "vendor-bin/phpunit/composer.lock"]
+path = ["vendor-bin/cs-fixer/composer.json", "vendor-bin/cs-fixer/composer.lock", "vendor-bin/psalm/composer.json", "vendor-bin/psalm/composer.lock", "vendor-bin/phpunit/composer.json", "vendor-bin/phpunit/composer.lock", "vendor-bin/rector/composer.json", "vendor-bin/rector/composer.lock"]
precedence = "aggregate"
SPDX-FileCopyrightText = "2025 Nextcloud GmbH and Nextcloud contributors"
SPDX-License-Identifier = "AGPL-3.0-or-later"
diff --git a/composer.json b/composer.json
index c5268caf5..afad94b2f 100644
--- a/composer.json
+++ b/composer.json
@@ -42,7 +42,8 @@
"@test:unit"
],
"test:unit": "vendor/bin/phpunit -c tests/phpunit.xml",
- "lint": "find . -name \\*.php -not -path './vendor/*' -not -path './tests/stubs/*' -print0 | xargs -0 -n1 php -l"
+ "lint": "find . -name \\*.php -not -path './vendor/*' -not -path './tests/stubs/*' -print0 | xargs -0 -n1 php -l",
+ "rector": "rector && composer cs:fix"
},
"require-dev": {
"nextcloud/ocp": "dev-master",
diff --git a/lib/Api/v1/Circles.php b/lib/Api/v1/Circles.php
index fc96d666a..94ed72140 100644
--- a/lib/Api/v1/Circles.php
+++ b/lib/Api/v1/Circles.php
@@ -23,6 +23,7 @@
use OCA\Circles\Service\CircleService;
use OCA\Circles\Service\FederatedUserService;
use OCA\Circles\Service\ShareWrapperService;
+use OCP\Server;
class Circles {
public const API_VERSION = [0, 10, 0];
@@ -65,8 +66,7 @@ class Circles {
* @return Circle[]
*/
public static function listCircles($type, $name = '', $level = 0, $userId = '', $forceAll = false) {
- /** @var FederatedUserService $federatedUserService */
- $federatedUserService = \OC::$server->get(FederatedUserService::class);
+ $federatedUserService = Server::get(FederatedUserService::class);
$personalCircle = false;
if ($forceAll) {
@@ -79,8 +79,7 @@ public static function listCircles($type, $name = '', $level = 0, $userId = '',
$federatedUserService->setLocalCurrentUserId($userId);
}
- /** @var CircleService $circleService */
- $circleService = \OC::$server->get(CircleService::class);
+ $circleService = Server::get(CircleService::class);
$probe = new CircleProbe();
$probe->includePersonalCircles($personalCircle);
@@ -109,8 +108,7 @@ public static function listCircles($type, $name = '', $level = 0, $userId = '',
* Return all the circle the current user is a member.
*/
public static function joinedCircles($userId = '', $forceAll = false) {
- /** @var FederatedUserService $federatedUserService */
- $federatedUserService = \OC::$server->get(FederatedUserService::class);
+ $federatedUserService = Server::get(FederatedUserService::class);
$personalCircle = false;
if ($forceAll) {
@@ -123,8 +121,7 @@ public static function joinedCircles($userId = '', $forceAll = false) {
$federatedUserService->setLocalCurrentUserId($userId);
}
- /** @var CircleService $circleService */
- $circleService = \OC::$server->get(CircleService::class);
+ $circleService = Server::get(CircleService::class);
$probe = new CircleProbe();
$probe->mustBeMember();
@@ -162,16 +159,14 @@ public static function joinedCircles($userId = '', $forceAll = false) {
*
*/
public static function detailsCircle(string $circleUniqueId, bool $forceAll = false): Circle {
- /** @var FederatedUserService $federatedUserService */
- $federatedUserService = \OC::$server->get(FederatedUserService::class);
+ $federatedUserService = Server::get(FederatedUserService::class);
if ($forceAll || \OC::$CLI) {
$federatedUserService->bypassCurrentUserCondition(true);
} else {
$federatedUserService->initCurrentUser();
}
- /** @var CircleService $circleService */
- $circleService = \OC::$server->get(CircleService::class);
+ $circleService = Server::get(CircleService::class);
return $circleService->getCircle($circleUniqueId);
}
@@ -194,8 +189,7 @@ public static function detailsCircle(string $circleUniqueId, bool $forceAll = fa
*
*/
public static function getMember($circleUniqueId, $ident, $type, $forceAll = false) {
- /** @var CirclesManager $circlesManager */
- $circlesManager = \OC::$server->get(CirclesManager::class);
+ $circlesManager = Server::get(CirclesManager::class);
$federatedUser = $circlesManager->getFederatedUser($ident, $type);
return $circlesManager->getLink($circleUniqueId, $federatedUser->getSingleId());
@@ -216,9 +210,9 @@ public static function getMember($circleUniqueId, $ident, $type, $forceAll = fal
*/
public static function getFilesForCircles(array $circleUniqueIds): array {
try {
- $circleService = \OC::$server->get(CircleService::class);
- $federatedUserService = \OC::$server->get(FederatedUserService::class);
- $shareWrapperService = \OC::$server->get(ShareWrapperService::class);
+ $circleService = Server::get(CircleService::class);
+ $federatedUserService = Server::get(FederatedUserService::class);
+ $shareWrapperService = Server::get(ShareWrapperService::class);
$federatedUserService->initCurrentUser();
} catch (\Exception $e) {
diff --git a/lib/Circles/FileSharingBroadcaster.php b/lib/Circles/FileSharingBroadcaster.php
index 4f83aa0bb..5bd630829 100644
--- a/lib/Circles/FileSharingBroadcaster.php
+++ b/lib/Circles/FileSharingBroadcaster.php
@@ -34,6 +34,7 @@
use OCP\IUserManager;
use OCP\Mail\IEMailTemplate;
use OCP\Mail\IMailer;
+use OCP\Server;
use OCP\Share\Exceptions\IllegalIDChangeException;
use OCP\Share\IShare;
use OCP\Util;
@@ -101,26 +102,25 @@ public function init() {
$this->initiated = true;
$this->l10n = OC::$server->getL10N(Application::APP_ID);
- $this->mailer = OC::$server->getMailer();
- $this->rootFolder = OC::$server->getLazyRootFolder();
- $this->userManager = OC::$server->getUserManager();
- $this->federationCloudIdManager = OC::$server->getCloudIdManager();
- $this->logger = \OCP\Server::get(LoggerInterface::class);
- $this->urlGenerator = OC::$server->getURLGenerator();
+ $this->mailer = Server::get(IMailer::class);
+ $this->rootFolder = Server::get(IRootFolder::class);
+ $this->userManager = Server::get(IUserManager::class);
+ $this->federationCloudIdManager = Server::get(ICloudIdManager::class);
+ $this->logger = Server::get(LoggerInterface::class);
+ $this->urlGenerator = Server::get(IURLGenerator::class);
try {
- $this->defaults = OC::$server->query(Defaults::class);
- $this->fileSharesRequest = OC::$server->query(FileSharesRequest::class);
- $this->tokensRequest = OC::$server->query(TokensRequest::class);
- $this->configService = OC::$server->query(ConfigService::class);
- $this->miscService = OC::$server->query(MiscService::class);
+ $this->defaults = Server::get(Defaults::class);
+ $this->fileSharesRequest = Server::get(FileSharesRequest::class);
+ $this->tokensRequest = Server::get(TokensRequest::class);
+ $this->configService = Server::get(ConfigService::class);
+ $this->miscService = Server::get(MiscService::class);
} catch (QueryException $e) {
- OC::$server->getLogger()
- ->log(1, 'Circles: cannot init FileSharingBroadcaster - ' . $e->getMessage());
+ $this->logger->info('Circles: cannot init FileSharingBroadcaster - ' . $e->getMessage(), ['exception' => $e]);
}
try {
$this->federationNotifications =
- OC::$server->query(Notifications::class);
+ Server::get(Notifications::class);
$this->federatedEnabled = true;
} catch (QueryException $e) {
}
@@ -399,8 +399,7 @@ private function sharedByMail(
);
$this->sendPasswordByMail($share, $displayName, $email, $password);
} catch (Exception $e) {
- OC::$server->getLogger()
- ->log(1, 'Circles::sharedByMail - mail were not sent: ' . $e->getMessage());
+ $this->logger->info('Circles::sharedByMail - mail were not sent: ' . $e->getMessage(), ['exception' => $e]);
}
}
@@ -509,7 +508,7 @@ protected function sendPasswordByMail(IShare $share, $circleName, $email, $passw
$instanceName
]
);
- $message->setFrom([\OCP\Util::getDefaultEmailAddress($instanceName) => $senderName]);
+ $message->setFrom([Util::getDefaultEmailAddress($instanceName) => $senderName]);
if ($initiatorEmailAddress !== null) {
$message->setReplyTo([$initiatorEmailAddress => $initiatorDisplayName]);
$emailTemplate->addFooter($instanceName . ' - ' . $this->defaults->getSlogan());
@@ -655,7 +654,7 @@ protected function sendPasswordExistingShares(DeprecatedMember $author, string $
]
);
- $message->setFrom([\OCP\Util::getDefaultEmailAddress($instanceName) => $senderName]);
+ $message->setFrom([Util::getDefaultEmailAddress($instanceName) => $senderName]);
if ($authorEmail !== null) {
$message->setReplyTo([$authorEmail => $authorName]);
$emailTemplate->addFooter($instanceName . ' - ' . $this->defaults->getSlogan());
diff --git a/lib/Command/CirclesTest.php b/lib/Command/CirclesTest.php
index 6e567ed74..039128eeb 100644
--- a/lib/Command/CirclesTest.php
+++ b/lib/Command/CirclesTest.php
@@ -27,6 +27,7 @@
use OCA\Circles\Tools\Traits\TArrayTools;
use OCA\Circles\Tools\Traits\TDeserialize;
use OCA\Circles\Tools\Traits\TStringTools;
+use OCP\Server;
use Symfony\Component\Console\Helper\Table;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
@@ -135,8 +136,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
// loading CirclesManager
- /** @var CirclesManager $circlesManager */
- $circlesManager = \OC::$server->get(CirclesManager::class);
+ $circlesManager = Server::get(CirclesManager::class);
// $circlesManager->startSuperSession();
diff --git a/lib/Db/CoreQueryBuilder.php b/lib/Db/CoreQueryBuilder.php
index 2a83d8859..e0bbfa66e 100644
--- a/lib/Db/CoreQueryBuilder.php
+++ b/lib/Db/CoreQueryBuilder.php
@@ -12,7 +12,6 @@
namespace OCA\Circles\Db;
use Doctrine\DBAL\Query\QueryBuilder;
-use OC;
use OCA\Circles\Exceptions\RequestBuilderException;
use OCA\Circles\IFederatedModel;
use OCA\Circles\IFederatedUser;
@@ -26,6 +25,7 @@
use OCA\Circles\Tools\Traits\TArrayTools;
use OCP\DB\QueryBuilder\ICompositeExpression;
use OCP\DB\QueryBuilder\IQueryBuilder;
+use OCP\Server;
/**
* Class CoreQueryBuilder
@@ -223,7 +223,7 @@ class CoreQueryBuilder extends ExtendedQueryBuilder {
public function __construct() {
parent::__construct();
- $this->configService = OC::$server->get(ConfigService::class);
+ $this->configService = Server::get(ConfigService::class);
}
diff --git a/lib/Db/CoreRequestBuilder.php b/lib/Db/CoreRequestBuilder.php
index 28d820ffd..6aba23fbd 100644
--- a/lib/Db/CoreRequestBuilder.php
+++ b/lib/Db/CoreRequestBuilder.php
@@ -18,6 +18,7 @@
use OCA\Circles\Service\ConfigService;
use OCA\Circles\Service\TimezoneService;
use OCP\DB\QueryBuilder\IQueryBuilder;
+use OCP\Server;
use OCP\Share\IShare;
/**
@@ -267,7 +268,7 @@ public function uninstall(): void {
* this just empty all tables from the app.
*/
public function uninstallAppTables() {
- $dbConn = \OC::$server->get(Connection::class);
+ $dbConn = Server::get(Connection::class);
$schema = new SchemaWrapper($dbConn);
foreach (array_keys(self::$tables) as $table) {
diff --git a/lib/Db/TokensRequest.php b/lib/Db/TokensRequest.php
index 9f943d3e6..cc3c6ed5e 100644
--- a/lib/Db/TokensRequest.php
+++ b/lib/Db/TokensRequest.php
@@ -12,6 +12,8 @@
use OCA\Circles\Exceptions\TokenDoesNotExistException;
use OCA\Circles\Model\DeprecatedMember;
use OCA\Circles\Model\SharesToken;
+use OCP\Security\IHasher;
+use OCP\Server;
/**
* @deprecated
@@ -100,7 +102,7 @@ public function generateTokenForMember(DeprecatedMember $member, int $shareId, s
$token = $this->miscService->token(15);
if ($password !== '') {
- $hasher = \OC::$server->getHasher();
+ $hasher = Server::get(IHasher::class);
$password = $hasher->hash($password);
}
@@ -147,7 +149,7 @@ public function updateSinglePassword(string $circleId, string $password) {
$qb = $this->getTokensUpdateSql();
if ($password !== '') {
- $hasher = \OC::$server->getHasher();
+ $hasher = Server::get(IHasher::class);
$password = $hasher->hash($password);
}
diff --git a/lib/Model/Circle.php b/lib/Model/Circle.php
index ef4ddf5e5..3682bec04 100644
--- a/lib/Model/Circle.php
+++ b/lib/Model/Circle.php
@@ -33,6 +33,7 @@
use OCA\Circles\Tools\Traits\TArrayTools;
use OCA\Circles\Tools\Traits\TDeserialize;
use OCP\Security\IHasher;
+use OCP\Server;
/**
* Class Circle
@@ -904,10 +905,8 @@ public function importFromDatabase(array $data, string $prefix = ''): IQueryRow
// if password is not hashed (pre-22), hash it and update new settings in DB
$curr = $this->get('password_single', $this->getSettings());
if (strlen($curr) >= 1 && strlen($curr) < 64) {
- /** @var IHasher $hasher */
- $hasher = \OC::$server->get(IHasher::class);
- /** @var CircleRequest $circleRequest */
- $circleRequest = \OC::$server->get(CircleRequest::class);
+ $hasher = Server::get(IHasher::class);
+ $circleRequest = Server::get(CircleRequest::class);
$new = $hasher->hash($curr);
$settings = $this->getSettings();
diff --git a/lib/Model/ManagedModel.php b/lib/Model/ManagedModel.php
index 78ed80e49..5569c3fa9 100644
--- a/lib/Model/ManagedModel.php
+++ b/lib/Model/ManagedModel.php
@@ -11,8 +11,8 @@
namespace OCA\Circles\Model;
-use OC;
use OCA\Circles\IFederatedUser;
+use OCP\Server;
/**
* Class ManagedModel
@@ -32,7 +32,7 @@ class ManagedModel {
*/
protected function getManager(): ModelManager {
if ($this->modelManager === null) {
- $this->modelManager = OC::$server->get(ModelManager::class);
+ $this->modelManager = Server::get(ModelManager::class);
}
return $this->modelManager;
diff --git a/lib/Model/ShareWrapper.php b/lib/Model/ShareWrapper.php
index 631de236f..c469b0e83 100644
--- a/lib/Model/ShareWrapper.php
+++ b/lib/Model/ShareWrapper.php
@@ -13,7 +13,6 @@
use DateTime;
use JsonSerializable;
-use OC;
use OC\Files\Cache\Cache;
use OC\Share20\Share;
use OC\Share20\ShareAttributes;
@@ -24,10 +23,12 @@
use OCA\Circles\Tools\IDeserializable;
use OCA\Circles\Tools\Traits\TArrayTools;
use OCA\Circles\Tools\Traits\TDeserialize;
+use OCP\Files\IMimeTypeLoader;
use OCP\Files\IRootFolder;
use OCP\IURLGenerator;
use OCP\IUserManager;
use OCP\L10N\IFactory;
+use OCP\Server;
use OCP\Share\Exceptions\IllegalIDChangeException;
use OCP\Share\IAttributes;
use OCP\Share\IShare;
@@ -422,7 +423,7 @@ public function getShare(
return null;
}
$share->setNodeCacheEntry(
- Cache::cacheEntryFromData($this->getFileCache()->toCache(), OC::$server->getMimeTypeLoader())
+ Cache::cacheEntryFromData($this->getFileCache()->toCache(), Server::get(IMimeTypeLoader::class))
);
} elseif ($nullOnMissingFileCache) {
return null;
@@ -447,7 +448,7 @@ private function setShareDisplay(IShare $share, IURLGenerator $urlGenerator): vo
$display = $circle->getDisplayName();
if ($circle->getSource() === Member::TYPE_CIRCLE) {
- $l10n = \OCP\Server::get(IFactory::class)->get('circles');
+ $l10n = Server::get(IFactory::class)->get('circles');
$display = $l10n->t('%s (Team owned by %s)', [$display, $circle->getOwner()->getDisplayName()]);
} else {
$display .= ' (' . Circle::$DEF_SOURCE[$circle->getSource()] . ')';
diff --git a/lib/Search/Contacts.php b/lib/Search/Contacts.php
index e139ac4f8..1cbdd061e 100644
--- a/lib/Search/Contacts.php
+++ b/lib/Search/Contacts.php
@@ -11,6 +11,8 @@
use OCA\Circles\Model\DeprecatedMember;
use OCA\Circles\Model\SearchResult;
use OCA\Circles\Service\MiscService;
+use OCP\Contacts\IManager;
+use OCP\Server;
class Contacts implements ISearch {
/**
@@ -18,7 +20,7 @@ class Contacts implements ISearch {
*/
public function search($needle): array {
$result = [];
- $contactManager = \OC::$server->getContactsManager();
+ $contactManager = Server::get(IManager::class);
// Add 'ADR' to search also in the address
$contacts = $contactManager->search($needle, ['FN', 'ORG', 'EMAIL']);
diff --git a/lib/Search/LocalGroups.php b/lib/Search/LocalGroups.php
index 02b8cfabd..32778e22c 100644
--- a/lib/Search/LocalGroups.php
+++ b/lib/Search/LocalGroups.php
@@ -10,6 +10,8 @@
use OCA\Circles\ISearch;
use OCA\Circles\Model\DeprecatedMember;
use OCA\Circles\Model\SearchResult;
+use OCP\IGroupManager;
+use OCP\Server;
class LocalGroups implements ISearch {
/**
@@ -17,7 +19,7 @@ class LocalGroups implements ISearch {
*/
public function search($needle): array {
$result = [];
- $groupManager = \OC::$server->getGroupManager();
+ $groupManager = Server::get(IGroupManager::class);
$groups = $groupManager->search($needle);
foreach ($groups as $group) {
diff --git a/lib/Search/LocalUsers.php b/lib/Search/LocalUsers.php
index b6db7138d..25f392a92 100644
--- a/lib/Search/LocalUsers.php
+++ b/lib/Search/LocalUsers.php
@@ -13,6 +13,8 @@
use OCA\Circles\Service\ConfigService;
use OCA\Circles\Tools\Traits\TArrayTools;
use OCP\Collaboration\Collaborators\ISearch as ICollaboratorSearch;
+use OCP\IUserManager;
+use OCP\Server;
use OCP\Share\IShare;
class LocalUsers implements ISearch {
@@ -46,7 +48,7 @@ public function __construct(
*/
public function search($needle): array {
$result = [];
- $userManager = \OC::$server->getUserManager();
+ $userManager = Server::get(IUserManager::class);
if ($this->configService->getAppValue(ConfigService::CIRCLES_SEARCH_FROM_COLLABORATOR) === '1') {
return $this->searchFromCollaborator($needle);
diff --git a/lib/Service/ContactService.php b/lib/Service/ContactService.php
index 492e6ff7e..692cbdc45 100644
--- a/lib/Service/ContactService.php
+++ b/lib/Service/ContactService.php
@@ -12,7 +12,6 @@
namespace OCA\Circles\Service;
use Exception;
-use OC;
use OCA\Circles\Exceptions\ContactAddressBookNotFoundException;
use OCA\Circles\Exceptions\ContactFormatException;
use OCA\Circles\Exceptions\ContactNotFoundException;
@@ -24,6 +23,7 @@
use OCP\Contacts\IManager;
use OCP\IAddressBook;
use OCP\IURLGenerator;
+use OCP\Server;
/**
* Class ContactService
@@ -114,8 +114,8 @@ private function getContact(string $contactPath): array {
throw new ContactFormatException('issue with contact format USERID/ADDRESSBOOK/CONTACTID');
}
- $contactsManager = OC::$server->get(ContactsManager::class);
- $cm = OC::$server->get(IManager::class);
+ $contactsManager = Server::get(ContactsManager::class);
+ $cm = Server::get(IManager::class);
$contactsManager->setupContactsProvider($cm, $userId, $this->urlGenerator);
$addressBook = $this->getAddressBook($cm, $addressBookUri);
diff --git a/lib/Service/FederatedEventService.php b/lib/Service/FederatedEventService.php
index a9e1f3e0a..8fc155d50 100644
--- a/lib/Service/FederatedEventService.php
+++ b/lib/Service/FederatedEventService.php
@@ -10,7 +10,6 @@
namespace OCA\Circles\Service;
-use OC;
use OCA\Circles\Db\EventWrapperRequest;
use OCA\Circles\Db\MemberRequest;
use OCA\Circles\Db\RemoteRequest;
@@ -53,6 +52,7 @@
use OCA\Circles\Tools\Model\Request;
use OCA\Circles\Tools\Traits\TNCRequest;
use OCA\Circles\Tools\Traits\TStringTools;
+use OCP\Server;
use ReflectionClass;
use ReflectionException;
@@ -248,7 +248,7 @@ public function getFederatedItem(FederatedEvent $event, bool $checkLocalOnly = t
throw new FederatedEventException($class . ' does not implements IFederatedItem');
}
- $item = OC::$server->get($class);
+ $item = Server::get($class);
if (!($item instanceof IFederatedItem)) {
throw new FederatedEventException($class . ' not an IFederatedItem');
}
diff --git a/lib/Service/MigrationService.php b/lib/Service/MigrationService.php
index 09ba724c9..c56fd4659 100644
--- a/lib/Service/MigrationService.php
+++ b/lib/Service/MigrationService.php
@@ -12,7 +12,6 @@
namespace OCA\Circles\Service;
use Exception;
-use OC;
use OCA\Circles\AppInfo\Application;
use OCA\Circles\Db\CircleRequest;
use OCA\Circles\Db\MemberRequest;
@@ -48,6 +47,7 @@
use OCP\Contacts\IManager;
use OCP\IDBConnection;
use OCP\IURLGenerator;
+use OCP\Server;
use OCP\Share\IShare;
/**
@@ -563,10 +563,9 @@ private function updateSubShare(SimpleDataStore $data, FederatedUser $federatedU
private function fixContactId(Member $member) {
[$userId, $contactId] = explode(':', $member->getUserId());
- $contactsManager = OC::$server->get(ContactsManager::class);
+ $contactsManager = Server::get(ContactsManager::class);
- /** @var IManager $cm */
- $cm = OC::$server->get(IManager::class);
+ $cm = Server::get(IManager::class);
$contactsManager->setupContactsProvider($cm, $userId, $this->urlGenerator);
$contact = $cm->search($contactId, ['UID']);
diff --git a/lib/Service/MiscService.php b/lib/Service/MiscService.php
index a4a7abed2..fd37ee5ab 100644
--- a/lib/Service/MiscService.php
+++ b/lib/Service/MiscService.php
@@ -8,16 +8,19 @@
namespace OCA\Circles\Service;
use Exception;
-use OC;
use OC\User\NoUserException;
use OCA\Circles\AppInfo\Application;
use OCA\Circles\Exceptions\MissingKeyInArrayException;
use OCA\Circles\Model\DeprecatedMember;
use OCA\Circles\Tools\Traits\TArrayTools;
+use OCA\DAV\CardDAV\ContactsManager;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
use OCP\Contacts\ContactsMenu\IContactsStore;
+use OCP\Contacts\IManager;
+use OCP\IURLGenerator;
use OCP\IUserManager;
+use OCP\Server;
use Psr\Log\LoggerInterface;
class MiscService {
@@ -138,18 +141,18 @@ public function getRealUserId($userId) {
* @return string
*/
public function getContactDisplayName(string $ident): string {
- if (!class_exists(\OCA\DAV\CardDAV\ContactsManager::class) || !strpos($ident, ':')) {
+ if (!class_exists(ContactsManager::class) || !strpos($ident, ':')) {
return '';
}
[$userId, $contactId] = explode(':', $ident);
$entries = [];
try {
- /** @var \OCA\DAV\CardDAV\ContactsManager $cManager */
- $cManager = OC::$server->query(\OCA\DAV\CardDAV\ContactsManager::class);
- $urlGenerator = OC::$server->getURLGenerator();
+ /** @var ContactsManager $cManager */
+ $cManager = Server::get(ContactsManager::class);
+ $urlGenerator = Server::get(IURLGenerator::class);
- $cm = OC::$server->getContactsManager();
+ $cm = Server::get(IManager::class);
$cManager->setupContactsProvider($cm, $userId, $urlGenerator);
$contact = $cm->search($contactId, ['UID']);
@@ -195,7 +198,7 @@ private static function getDisplayMember(&$display, $ident, $type) {
return;
}
- $user = OC::$server->getUserManager()
+ $user = Server::get(IUserManager::class)
->get($ident);
if ($user !== null) {
$display = $user->getDisplayName();
@@ -229,18 +232,18 @@ private static function getDisplayContact(&$display, $ident, $type) {
*
*/
public static function getContactData($ident) {
- if (!class_exists(\OCA\DAV\CardDAV\ContactsManager::class) || !strpos($ident, ':')) {
+ if (!class_exists(ContactsManager::class) || !strpos($ident, ':')) {
return [];
}
[$userId, $contactId] = explode(':', $ident);
try {
- /** @var \OCA\DAV\CardDAV\ContactsManager $cManager */
- $cManager = OC::$server->query(\OCA\DAV\CardDAV\ContactsManager::class);
- $urlGenerator = OC::$server->getURLGenerator();
+ /** @var ContactsManager $cManager */
+ $cManager = Server::get(ContactsManager::class);
+ $urlGenerator = Server::get(IURLGenerator::class);
- $cm = OC::$server->getContactsManager();
+ $cm = Server::get(IManager::class);
$cManager->setupContactsProvider($cm, $userId, $urlGenerator);
$contact = $cm->search($contactId, ['UID']);
diff --git a/lib/Service/SearchService.php b/lib/Service/SearchService.php
index 900e4f648..bc98e9412 100644
--- a/lib/Service/SearchService.php
+++ b/lib/Service/SearchService.php
@@ -11,7 +11,6 @@
namespace OCA\Circles\Service;
-use OC;
use OCA\Circles\AppInfo\Application;
use OCA\Circles\Exceptions\InitiatorNotFoundException;
use OCA\Circles\Exceptions\RequestBuilderException;
@@ -25,6 +24,7 @@
use OCA\Circles\Search\UnifiedSearchResult;
use OCA\Circles\Tools\Traits\TArrayTools;
use OCP\IURLGenerator;
+use OCP\Server;
class SearchService {
use TArrayTools;
@@ -65,7 +65,7 @@ public function search(string $needle): array {
foreach (self::$SERVICES as $entry) {
/** @var ISearch $service */
- $service = OC::$server->get($entry);
+ $service = Server::get($entry);
$result = array_merge($result, $service->search($needle));
}
diff --git a/lib/Service/SendMailService.php b/lib/Service/SendMailService.php
index 691f29f2d..30e2a8f5e 100644
--- a/lib/Service/SendMailService.php
+++ b/lib/Service/SendMailService.php
@@ -260,7 +260,7 @@ private function sendMailPassword(
$instanceName
]
);
- $message->setFrom([\OCP\Util::getDefaultEmailAddress($instanceName) => $senderName]);
+ $message->setFrom([Util::getDefaultEmailAddress($instanceName) => $senderName]);
// if ($initiatorEmailAddress !== null) {
// $message->setReplyTo([$initiatorEmailAddress => $initiatorDisplayName]);
// $emailTemplate->addFooter($instanceName . ' - ' . $this->defaults->getSlogan());
diff --git a/lib/ShareByCircleProvider.php b/lib/ShareByCircleProvider.php
index 74ce0cd0a..59651b111 100644
--- a/lib/ShareByCircleProvider.php
+++ b/lib/ShareByCircleProvider.php
@@ -12,7 +12,6 @@
namespace OCA\Circles;
use Exception;
-use OC;
use OCA\Circles\Exceptions\CircleNotFoundException;
use OCA\Circles\Exceptions\ContactAddressBookNotFoundException;
use OCA\Circles\Exceptions\ContactFormatException;
@@ -58,6 +57,7 @@
use OCP\IURLGenerator;
use OCP\IUserManager;
use OCP\Security\ISecureRandom;
+use OCP\Server;
use OCP\Share\Exceptions\AlreadySharedException;
use OCP\Share\Exceptions\IllegalIDChangeException;
use OCP\Share\Exceptions\ShareNotFound;
@@ -103,15 +103,15 @@ public function __construct(
$this->userManager = $userManager;
$this->rootFolder = $rootFolder;
$this->l10n = $l10n;
- $this->logger = OC::$server->get(LoggerInterface::class);
+ $this->logger = Server::get(LoggerInterface::class);
$this->urlGenerator = $urlGenerator;
- $this->federatedUserService = OC::$server->get(FederatedUserService::class);
- $this->federatedEventService = OC::$server->get(FederatedEventService::class);
- $this->shareWrapperService = OC::$server->get(ShareWrapperService::class);
- $this->shareTokenService = OC::$server->get(ShareTokenService::class);
- $this->circleService = OC::$server->get(CircleService::class);
- $this->eventService = OC::$server->get(EventService::class);
+ $this->federatedUserService = Server::get(FederatedUserService::class);
+ $this->federatedEventService = Server::get(FederatedEventService::class);
+ $this->shareWrapperService = Server::get(ShareWrapperService::class);
+ $this->shareTokenService = Server::get(ShareTokenService::class);
+ $this->circleService = Server::get(CircleService::class);
+ $this->eventService = Server::get(EventService::class);
}
diff --git a/lib/Tools/ActivityPub/NCSignature.php b/lib/Tools/ActivityPub/NCSignature.php
index ff5aa4265..82c3d31f6 100644
--- a/lib/Tools/ActivityPub/NCSignature.php
+++ b/lib/Tools/ActivityPub/NCSignature.php
@@ -38,7 +38,6 @@
use DateTime;
use Exception;
-use OC;
use OCA\Circles\Tools\Exceptions\InvalidOriginException;
use OCA\Circles\Tools\Exceptions\ItemNotFoundException;
use OCA\Circles\Tools\Exceptions\MalformedArrayException;
@@ -50,6 +49,7 @@
use OCA\Circles\Tools\Model\SimpleDataStore;
use OCA\Circles\Tools\Traits\TNCSignatory;
use OCP\IRequest;
+use OCP\Server;
class NCSignature {
public const DATE_HEADER = 'D, d M Y H:i:s T';
@@ -83,7 +83,7 @@ public function incomingSignedRequest(string $body = ''): NCSignedRequest {
$this->debug('[<<] incoming', ['body' => $body]);
$signedRequest = new NCSignedRequest($body);
- $signedRequest->setIncomingRequest(OC::$server->get(IRequest::class));
+ $signedRequest->setIncomingRequest(Server::get(IRequest::class));
$this->verifyIncomingRequestTime($signedRequest);
$this->verifyIncomingRequestContent($signedRequest);
diff --git a/lib/Tools/Db/ExtendedQueryBuilder.php b/lib/Tools/Db/ExtendedQueryBuilder.php
index d88c9275e..0ce682c6e 100644
--- a/lib/Tools/Db/ExtendedQueryBuilder.php
+++ b/lib/Tools/Db/ExtendedQueryBuilder.php
@@ -15,7 +15,6 @@
use DateTime;
use Doctrine\DBAL\Query\QueryBuilder as DBALQueryBuilder;
use Exception;
-use OC;
use OC\DB\QueryBuilder\QueryBuilder;
use OC\SystemConfig;
use OCA\Circles\Tools\Exceptions\DateTimeException;
@@ -25,6 +24,7 @@
use OCP\DB\QueryBuilder\ICompositeExpression;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\IDBConnection;
+use OCP\Server;
use Psr\Log\LoggerInterface;
class ExtendedQueryBuilder extends QueryBuilder {
@@ -40,9 +40,9 @@ class ExtendedQueryBuilder extends QueryBuilder {
public function __construct() {
parent::__construct(
- OC::$server->get(IDBConnection::class),
- OC::$server->get(SystemConfig::class),
- OC::$server->get(LoggerInterface::class)
+ Server::get(IDBConnection::class),
+ Server::get(SystemConfig::class),
+ Server::get(LoggerInterface::class)
);
}
diff --git a/lib/Tools/Traits/TNCLocalSignatory.php b/lib/Tools/Traits/TNCLocalSignatory.php
index bafcd2cbc..5b7f5675e 100644
--- a/lib/Tools/Traits/TNCLocalSignatory.php
+++ b/lib/Tools/Traits/TNCLocalSignatory.php
@@ -11,10 +11,10 @@
namespace OCA\Circles\Tools\Traits;
-use OC;
use OCA\Circles\Tools\Exceptions\SignatoryException;
use OCA\Circles\Tools\Model\NCSignatory;
use OCP\IConfig;
+use OCP\Server;
trait TNCLocalSignatory {
use TNCSignatory;
@@ -30,7 +30,7 @@ trait TNCLocalSignatory {
*/
public function fillSimpleSignatory(NCSignatory $signatory, bool $generate = false): void {
$app = $this->setup('app', '', self::$SIGNATORIES_APP);
- $signatories = json_decode(OC::$server->get(IConfig::class)->getAppValue($app, 'key_pairs'), true);
+ $signatories = json_decode(Server::get(IConfig::class)->getAppValue($app, 'key_pairs'), true);
if (!is_array($signatories)) {
$signatories = [];
}
@@ -63,7 +63,7 @@ public function createSimpleSignatory(NCSignatory $signatory): void {
$this->generateKeys($signatory);
$signatories =
- json_decode(OC::$server->get(IConfig::class)->getAppValue($app, 'key_pairs', '[]'), true);
+ json_decode(Server::get(IConfig::class)->getAppValue($app, 'key_pairs', '[]'), true);
$signatories[$signatory->getId()] = [
'keyId' => $signatory->getKeyId(),
'keyOwner' => $signatory->getKeyOwner(),
@@ -71,7 +71,7 @@ public function createSimpleSignatory(NCSignatory $signatory): void {
'privateKey' => $signatory->getPrivateKey()
];
- OC::$server->get(IConfig::class)->setAppValue($app, 'key_pairs', json_encode($signatories));
+ Server::get(IConfig::class)->setAppValue($app, 'key_pairs', json_encode($signatories));
}
@@ -80,12 +80,12 @@ public function createSimpleSignatory(NCSignatory $signatory): void {
*/
public function removeSimpleSignatory(NCSignatory $signatory): void {
$app = $this->setup('app', '', self::$SIGNATORIES_APP);
- $signatories = json_decode(OC::$server->get(IConfig::class)->getAppValue($app, 'key_pairs'), true);
+ $signatories = json_decode(Server::get(IConfig::class)->getAppValue($app, 'key_pairs'), true);
if (!is_array($signatories)) {
$signatories = [];
}
unset($signatories[$signatory->getId()]);
- OC::$server->get(IConfig::class)->setAppValue($app, 'key_pairs', json_encode($signatories));
+ Server::get(IConfig::class)->setAppValue($app, 'key_pairs', json_encode($signatories));
}
}
diff --git a/lib/Tools/Traits/TNCLogger.php b/lib/Tools/Traits/TNCLogger.php
index 5ffe44bf5..ea6b53f5a 100644
--- a/lib/Tools/Traits/TNCLogger.php
+++ b/lib/Tools/Traits/TNCLogger.php
@@ -12,8 +12,8 @@
namespace OCA\Circles\Tools\Traits;
use Exception;
-use OC;
use OC\HintException;
+use OCP\Server;
use Psr\Log\LoggerInterface;
use Throwable;
@@ -175,7 +175,7 @@ public function logger(): LoggerInterface {
if (isset($this->logger)) {
return $this->logger;
} else {
- return OC::$server->get(LoggerInterface::class);
+ return Server::get(LoggerInterface::class);
}
}
}
diff --git a/lib/Tools/Traits/TNCRequest.php b/lib/Tools/Traits/TNCRequest.php
index 6d15ec59d..94d2977f7 100644
--- a/lib/Tools/Traits/TNCRequest.php
+++ b/lib/Tools/Traits/TNCRequest.php
@@ -13,13 +13,13 @@
use Exception;
use GuzzleHttp\Exception\ClientException;
-use OC;
use OCA\Circles\Tools\Exceptions\RequestNetworkException;
use OCA\Circles\Tools\Model\NCRequest;
use OCA\Circles\Tools\Model\NCRequestResult;
use OCA\Circles\Tools\Model\Request;
use OCP\Http\Client\IClientService;
use OCP\Http\Client\IResponse;
+use OCP\Server;
trait TNCRequest {
use TNCLogger;
@@ -89,7 +89,7 @@ public function clientService(): IClientService {
if (isset($this->clientService) && $this->clientService instanceof IClientService) {
return $this->clientService;
} else {
- return OC::$server->get(IClientService::class);
+ return Server::get(IClientService::class);
}
}
diff --git a/lib/Tools/Traits/TNCSetup.php b/lib/Tools/Traits/TNCSetup.php
index 07a9cf0ca..9262abc84 100644
--- a/lib/Tools/Traits/TNCSetup.php
+++ b/lib/Tools/Traits/TNCSetup.php
@@ -11,8 +11,8 @@
namespace OCA\Circles\Tools\Traits;
-use OC;
use OCP\IConfig;
+use OCP\Server;
trait TNCSetup {
use TArrayTools;
@@ -79,8 +79,7 @@ public function appConfig(string $key): string {
return '';
}
- /** @var IConfig $config */
- $config = OC::$server->get(IConfig::class);
+ $config = Server::get(IConfig::class);
return $config->getAppValue($app, $key, '');
}
diff --git a/rector.php b/rector.php
new file mode 100644
index 000000000..0bbc87cb0
--- /dev/null
+++ b/rector.php
@@ -0,0 +1,22 @@
+withPaths([
+ __DIR__ . '/appinfo',
+ __DIR__ . '/lib',
+ __DIR__ . '/tests/unit',
+ ])
+ ->withImportNames(importShortClasses: false)
+ ->withSets([
+ NextcloudSets::NEXTCLOUD_25,
+ ]);
diff --git a/tests/TestSuiteListener.php b/tests/TestSuiteListener.php
index 89932d9d3..0b4aaf5a8 100644
--- a/tests/TestSuiteListener.php
+++ b/tests/TestSuiteListener.php
@@ -8,6 +8,9 @@
namespace OCA\Circles\Tests;
use OCA\Circles\Model\DeprecatedCircle;
+use OCP\IUserManager;
+use OCP\IUserSession;
+use OCP\Server;
use PHPUnit\Framework\AssertionFailedError;
use PHPUnit\Framework\Test;
use PHPUnit\Framework\TestListener;
@@ -68,7 +71,7 @@ public function startTestSuite(TestSuite $suite): void {
return;
}
- $userManager = \OC::$server->getUserManager();
+ $userManager = Server::get(IUserManager::class);
$this->users = self::listUsers();
foreach ($this->users as $UID) {
@@ -84,7 +87,7 @@ public function endTestSuite(TestSuite $suite): void {
}
foreach ($this->users as $UID) {
- $user = \OC::$server->getUserManager()
+ $user = Server::get(IUserManager::class)
->get($UID);
if ($user !== null) {
$user->delete();
@@ -97,9 +100,9 @@ public function addWarning(Test $test, Warning $e, float $time,
}
public static function setUser($which) {
- $userSession = \OC::$server->getUserSession();
+ $userSession = Server::get(IUserSession::class);
$userSession->setUser(
- \OC::$server->getUserManager()
+ Server::get(IUserManager::class)
->get($which)
);
@@ -107,13 +110,13 @@ public static function setUser($which) {
}
public static function currentUser() {
- $userSession = \OC::$server->getUserSession();
+ $userSession = Server::get(IUserSession::class);
return $userSession->getUser()
->getUID();
}
public static function logout() {
- $userSession = \OC::$server->getUserSession();
+ $userSession = Server::get(IUserSession::class);
$userSession->setUser(null);
}
diff --git a/tests/psalm-baseline.xml b/tests/psalm-baseline.xml
index bb54ed451..f17d28283 100644
--- a/tests/psalm-baseline.xml
+++ b/tests/psalm-baseline.xml
@@ -14,10 +14,6 @@
-
-
-
-
diff --git a/tests/unit/CirclesManagerTest.php b/tests/unit/CirclesManagerTest.php
index abcb1d7a0..b0d819411 100644
--- a/tests/unit/CirclesManagerTest.php
+++ b/tests/unit/CirclesManagerTest.php
@@ -14,6 +14,7 @@
use OCA\Circles\Model\Probes\DataProbe;
use OCP\IGroupManager;
use OCP\IUserManager;
+use OCP\Server;
use Test\TestCase;
/**
@@ -32,7 +33,7 @@ public function setUp(): void {
$this->circleName = sha1(uniqId(mt_rand(), true));
// Create test user
- $userManager = \OC::$server->get(IUserManager::class);
+ $userManager = Server::get(IUserManager::class);
if (!$userManager->userExists($this->userId)) {
$user = $userManager->createUser($this->userId, $this->userId);
} else {
@@ -40,13 +41,13 @@ public function setUp(): void {
}
// Create test group and add user
- $groupManager = \OC::$server->get(IGroupManager::class);
+ $groupManager = Server::get(IGroupManager::class);
if (!$groupManager->groupExists($this->groupId)) {
$group = $groupManager->createGroup($this->groupId);
$group->addUser($user);
}
- $this->circlesManager = \OC::$server->get(CirclesManager::class);
+ $this->circlesManager = Server::get(CirclesManager::class);
}
diff --git a/vendor-bin/rector/composer.json b/vendor-bin/rector/composer.json
new file mode 100644
index 000000000..e15d69867
--- /dev/null
+++ b/vendor-bin/rector/composer.json
@@ -0,0 +1,5 @@
+{
+ "require-dev": {
+ "nextcloud/rector": "^0.4.1"
+ }
+}
diff --git a/vendor-bin/rector/composer.lock b/vendor-bin/rector/composer.lock
new file mode 100644
index 000000000..a4fd27766
--- /dev/null
+++ b/vendor-bin/rector/composer.lock
@@ -0,0 +1,508 @@
+{
+ "_readme": [
+ "This file locks the dependencies of your project to a known state",
+ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
+ "This file is @generated automatically"
+ ],
+ "content-hash": "26aaa848025cd6f0772e4d158f5c25fb",
+ "packages": [],
+ "packages-dev": [
+ {
+ "name": "nextcloud/ocp",
+ "version": "v31.0.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/nextcloud-deps/ocp.git",
+ "reference": "1fb984268039921920ade298ef5a58e8fe3de7da"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/nextcloud-deps/ocp/zipball/1fb984268039921920ade298ef5a58e8fe3de7da",
+ "reference": "1fb984268039921920ade298ef5a58e8fe3de7da",
+ "shasum": ""
+ },
+ "require": {
+ "php": "~8.1 || ~8.2 || ~8.3 || ~8.4",
+ "psr/clock": "^1.0",
+ "psr/container": "^2.0.2",
+ "psr/event-dispatcher": "^1.0",
+ "psr/log": "^3.0.2"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-stable31": "31.0.0-dev"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "AGPL-3.0-or-later"
+ ],
+ "authors": [
+ {
+ "name": "Christoph Wurst",
+ "email": "christoph@winzerhof-wurst.at"
+ },
+ {
+ "name": "Joas Schilling",
+ "email": "coding@schilljs.com"
+ }
+ ],
+ "description": "Composer package containing Nextcloud's public OCP API and the unstable NCU API",
+ "support": {
+ "issues": "https://github.com/nextcloud-deps/ocp/issues",
+ "source": "https://github.com/nextcloud-deps/ocp/tree/v31.0.4"
+ },
+ "time": "2025-04-15T00:50:16+00:00"
+ },
+ {
+ "name": "nextcloud/rector",
+ "version": "v0.4.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/nextcloud-libraries/rector.git",
+ "reference": "9c5c78cc323537ec6dba5b3cd9c422ff9524d8cf"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/nextcloud-libraries/rector/zipball/9c5c78cc323537ec6dba5b3cd9c422ff9524d8cf",
+ "reference": "9c5c78cc323537ec6dba5b3cd9c422ff9524d8cf",
+ "shasum": ""
+ },
+ "require": {
+ "nextcloud/ocp": ">=27",
+ "php": "^8.1",
+ "rector/rector": "^2.0.4",
+ "webmozart/assert": "^1.11"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^10.5",
+ "ramsey/devtools": "^2.0"
+ },
+ "type": "library",
+ "extra": {
+ "captainhook": {
+ "force-install": true
+ },
+ "ramsey/devtools": {
+ "memory-limit": "-1",
+ "command-prefix": "dev"
+ },
+ "ramsey/conventional-commits": {
+ "configFile": "conventional-commits.json"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "OCP\\": "vendor/nextcloud/ocp/OCP",
+ "Nextcloud\\Rector\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "AGPL-3.0-or-later"
+ ],
+ "authors": [
+ {
+ "name": "Christoph Wurst",
+ "email": "christoph@winzerhof-wurst.at",
+ "homepage": "https://wuc.me"
+ }
+ ],
+ "description": "Rector upgrade rules for Nextcloud",
+ "keywords": [
+ "nextcloud",
+ "refactoring"
+ ],
+ "support": {
+ "issues": "https://github.com/nextcloud-libraries/rector/issues",
+ "source": "https://github.com/nextcloud-libraries/rector/tree/v0.4.1"
+ },
+ "time": "2025-03-31T15:27:10+00:00"
+ },
+ {
+ "name": "phpstan/phpstan",
+ "version": "2.1.15",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phpstan/phpstan.git",
+ "reference": "402d11c1aa40ae2e1c3a512e6a4edb957527b20b"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phpstan/phpstan/zipball/402d11c1aa40ae2e1c3a512e6a4edb957527b20b",
+ "reference": "402d11c1aa40ae2e1c3a512e6a4edb957527b20b",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.4|^8.0"
+ },
+ "conflict": {
+ "phpstan/phpstan-shim": "*"
+ },
+ "bin": [
+ "phpstan",
+ "phpstan.phar"
+ ],
+ "type": "library",
+ "autoload": {
+ "files": [
+ "bootstrap.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "description": "PHPStan - PHP Static Analysis Tool",
+ "keywords": [
+ "dev",
+ "static analysis"
+ ],
+ "support": {
+ "docs": "https://phpstan.org/user-guide/getting-started",
+ "forum": "https://github.com/phpstan/phpstan/discussions",
+ "issues": "https://github.com/phpstan/phpstan/issues",
+ "security": "https://github.com/phpstan/phpstan/security/policy",
+ "source": "https://github.com/phpstan/phpstan-src"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/ondrejmirtes",
+ "type": "github"
+ },
+ {
+ "url": "https://github.com/phpstan",
+ "type": "github"
+ }
+ ],
+ "time": "2025-05-14T11:16:08+00:00"
+ },
+ {
+ "name": "psr/clock",
+ "version": "1.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/clock.git",
+ "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/clock/zipball/e41a24703d4560fd0acb709162f73b8adfc3aa0d",
+ "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.0 || ^8.0"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Psr\\Clock\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "https://www.php-fig.org/"
+ }
+ ],
+ "description": "Common interface for reading the clock.",
+ "homepage": "https://github.com/php-fig/clock",
+ "keywords": [
+ "clock",
+ "now",
+ "psr",
+ "psr-20",
+ "time"
+ ],
+ "support": {
+ "issues": "https://github.com/php-fig/clock/issues",
+ "source": "https://github.com/php-fig/clock/tree/1.0.0"
+ },
+ "time": "2022-11-25T14:36:26+00:00"
+ },
+ {
+ "name": "psr/container",
+ "version": "2.0.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/container.git",
+ "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963",
+ "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.4.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Psr\\Container\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "https://www.php-fig.org/"
+ }
+ ],
+ "description": "Common Container Interface (PHP FIG PSR-11)",
+ "homepage": "https://github.com/php-fig/container",
+ "keywords": [
+ "PSR-11",
+ "container",
+ "container-interface",
+ "container-interop",
+ "psr"
+ ],
+ "support": {
+ "issues": "https://github.com/php-fig/container/issues",
+ "source": "https://github.com/php-fig/container/tree/2.0.2"
+ },
+ "time": "2021-11-05T16:47:00+00:00"
+ },
+ {
+ "name": "psr/event-dispatcher",
+ "version": "1.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/event-dispatcher.git",
+ "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0",
+ "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.2.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Psr\\EventDispatcher\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "http://www.php-fig.org/"
+ }
+ ],
+ "description": "Standard interfaces for event handling.",
+ "keywords": [
+ "events",
+ "psr",
+ "psr-14"
+ ],
+ "support": {
+ "issues": "https://github.com/php-fig/event-dispatcher/issues",
+ "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0"
+ },
+ "time": "2019-01-08T18:20:26+00:00"
+ },
+ {
+ "name": "psr/log",
+ "version": "3.0.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/log.git",
+ "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3",
+ "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.0.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Psr\\Log\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "https://www.php-fig.org/"
+ }
+ ],
+ "description": "Common interface for logging libraries",
+ "homepage": "https://github.com/php-fig/log",
+ "keywords": [
+ "log",
+ "psr",
+ "psr-3"
+ ],
+ "support": {
+ "source": "https://github.com/php-fig/log/tree/3.0.2"
+ },
+ "time": "2024-09-11T13:17:53+00:00"
+ },
+ {
+ "name": "rector/rector",
+ "version": "2.0.16",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/rectorphp/rector.git",
+ "reference": "f1366d1f8c7490541c8f7af6e5c7cef7cca1b5a2"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/rectorphp/rector/zipball/f1366d1f8c7490541c8f7af6e5c7cef7cca1b5a2",
+ "reference": "f1366d1f8c7490541c8f7af6e5c7cef7cca1b5a2",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.4|^8.0",
+ "phpstan/phpstan": "^2.1.14"
+ },
+ "conflict": {
+ "rector/rector-doctrine": "*",
+ "rector/rector-downgrade-php": "*",
+ "rector/rector-phpunit": "*",
+ "rector/rector-symfony": "*"
+ },
+ "suggest": {
+ "ext-dom": "To manipulate phpunit.xml via the custom-rule command"
+ },
+ "bin": [
+ "bin/rector"
+ ],
+ "type": "library",
+ "autoload": {
+ "files": [
+ "bootstrap.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "description": "Instant Upgrade and Automated Refactoring of any PHP code",
+ "keywords": [
+ "automation",
+ "dev",
+ "migration",
+ "refactoring"
+ ],
+ "support": {
+ "issues": "https://github.com/rectorphp/rector/issues",
+ "source": "https://github.com/rectorphp/rector/tree/2.0.16"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/tomasvotruba",
+ "type": "github"
+ }
+ ],
+ "time": "2025-05-12T16:37:16+00:00"
+ },
+ {
+ "name": "webmozart/assert",
+ "version": "1.11.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/webmozarts/assert.git",
+ "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991",
+ "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991",
+ "shasum": ""
+ },
+ "require": {
+ "ext-ctype": "*",
+ "php": "^7.2 || ^8.0"
+ },
+ "conflict": {
+ "phpstan/phpstan": "<0.12.20",
+ "vimeo/psalm": "<4.6.1 || 4.6.2"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^8.5.13"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.10-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Webmozart\\Assert\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Bernhard Schussek",
+ "email": "bschussek@gmail.com"
+ }
+ ],
+ "description": "Assertions to validate method input/output with nice error messages.",
+ "keywords": [
+ "assert",
+ "check",
+ "validate"
+ ],
+ "support": {
+ "issues": "https://github.com/webmozarts/assert/issues",
+ "source": "https://github.com/webmozarts/assert/tree/1.11.0"
+ },
+ "time": "2022-06-03T18:03:27+00:00"
+ }
+ ],
+ "aliases": [],
+ "minimum-stability": "stable",
+ "stability-flags": {},
+ "prefer-stable": false,
+ "prefer-lowest": false,
+ "platform": {},
+ "platform-dev": {},
+ "plugin-api-version": "2.6.0"
+}