Skip to content

Commit 9c26768

Browse files
committed
chore: Fix manually all strict comparaison
Helped a bit by the AI Signed-off-by: Carl Schwan <carl@carlschwan.eu>
1 parent 82429a7 commit 9c26768

171 files changed

Lines changed: 329 additions & 284 deletions

File tree

Some content is hidden

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

‎apps/appstore/lib/Controller/ApiController.php‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,11 @@ public function listApps(bool $details = false): DataResponse {
129129

130130
$appData['groups'] = $groups;
131131
// analyze dependencies
132-
$ignoreMax = in_array($appData['id'], $ignoreMaxApps);
132+
$ignoreMax = in_array($appData['id'], $ignoreMaxApps, true);
133133
$missing = $this->dependencyAnalyzer->analyze($appData, $ignoreMax);
134134
$appData['missingDependencies'] = $missing;
135135
$appData['isCompatible'] = $this->dependencyAnalyzer->isMarkedCompatible($appData);
136-
$appData['internal'] = in_array($appData['id'], $this->appManager->getAlwaysEnabledApps());
136+
$appData['internal'] = in_array($appData['id'], $this->appManager->getAlwaysEnabledApps(), true);
137137

138138
return $appData;
139139
}, $apps);
@@ -332,7 +332,7 @@ private function fetchApps(): void {
332332
$supportedApps = $this->subscriptionRegistry->delegateGetSupportedApps();
333333
$shippedApps = $this->appManager->getAlwaysEnabledApps();
334334
foreach ($apps as $app) {
335-
if (in_array($app['id'], $shippedApps)) {
335+
if (in_array($app['id'], $shippedApps, true)) {
336336
// shipped apps are no longer published on the appstore
337337
// so skip them to avoid confusion with outdated data
338338
continue;
@@ -345,7 +345,7 @@ private function fetchApps(): void {
345345
$this->allApps[$app['id']] = array_merge($app, $this->allApps[$app['id']]);
346346
}
347347

348-
if (in_array($app['id'], $supportedApps)) {
348+
if (in_array($app['id'], $supportedApps, true)) {
349349
$this->allApps[$app['id']]['level'] = \OC_App::supportedApp;
350350
}
351351
}
@@ -463,7 +463,7 @@ private function getAppsForCategory(string $requestedCategory = ''): array {
463463
'license' => $app['releases'][0]['licenses'],
464464
'author' => $authors,
465465
'shipped' => $this->appManager->isShipped($app['id']),
466-
'internal' => in_array($app['id'], $this->appManager->getAlwaysEnabledApps()),
466+
'internal' => in_array($app['id'], $this->appManager->getAlwaysEnabledApps(), true),
467467
'version' => $currentVersion,
468468
'types' => [],
469469
'documentation' => [

‎apps/cloud_federation_api/lib/Controller/RequestHandlerController.php‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ public function addShare($shareWith, $name, $description, $providerId, $owner, $
148148
}
149149

150150
$supportedShareTypes = $this->config->getSupportedShareTypes($resourceType);
151+
// $shareType is an untyped parameter taken directly from the OCS request body
152+
/** @psalm-suppress UnrecognizedExpression */
151153
if (!in_array($shareType, $supportedShareTypes)) {
152154
return new JSONResponse(
153155
['message' => 'Share type "' . $shareType . '" not implemented'],

‎apps/comments/lib/Listener/CommentsEventListener.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function handle(Event $event): void {
6060
CommentsEvent::EVENT_UPDATE,
6161
CommentsEvent::EVENT_DELETE,
6262
];
63-
if (in_array($eventType, $applicableEvents)) {
63+
if (in_array($eventType, $applicableEvents, true)) {
6464
$this->notificationHandler($event);
6565
return;
6666
}

‎apps/dashboard/lib/Controller/DashboardApiController.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ private function getShownWidgets(array $widgetIds): array {
6464
return array_filter(
6565
$this->dashboardManager->getWidgets(),
6666
static function (IWidget $widget) use ($widgetIds) {
67-
return in_array($widget->getId(), $widgetIds);
67+
return in_array($widget->getId(), $widgetIds, true);
6868
},
6969
);
7070
}

‎apps/dav/appinfo/v1/publicwebdav.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ function (\Sabre\DAV\Server $server) use (
9797
$linkCheckPlugin,
9898
$filesDropPlugin
9999
) {
100-
$isAjax = in_array('XMLHttpRequest', explode(',', $_SERVER['HTTP_X_REQUESTED_WITH'] ?? ''));
100+
$isAjax = in_array('XMLHttpRequest', explode(',', $_SERVER['HTTP_X_REQUESTED_WITH'] ?? ''), true);
101101
/** @var FederatedShareProvider $shareProvider */
102102
$federatedShareProvider = Server::get(FederatedShareProvider::class);
103103
if ($federatedShareProvider->isOutgoingServer2serverShareEnabled() === false && !$isAjax) {

‎apps/dav/appinfo/v2/publicremote.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
// GET must be allowed for e.g. showing images and allowing Zip downloads
102102
if ($server->httpRequest->getMethod() !== 'GET') {
103103
// If this is *not* a GET request we only allow access to public DAV from AJAX or when Server2Server is allowed
104-
$isAjax = in_array('XMLHttpRequest', explode(',', $_SERVER['HTTP_X_REQUESTED_WITH'] ?? ''));
104+
$isAjax = in_array('XMLHttpRequest', explode(',', $_SERVER['HTTP_X_REQUESTED_WITH'] ?? ''), true);
105105
$federatedShareProvider = Server::get(FederatedShareProvider::class);
106106
if ($federatedShareProvider->isOutgoingServer2serverShareEnabled() === false && $isAjax === false) {
107107
// this is what is thrown when trying to access a non-existing share

‎apps/dav/lib/CalDAV/Activity/Backend.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ protected function getObjectNameAndType(array $objectData) {
578578
$vObject = Reader::read($objectData['calendardata']);
579579
$component = $componentType = null;
580580
foreach ($vObject->getComponents() as $component) {
581-
if (in_array($component->name, ['VEVENT', 'VTODO'])) {
581+
if (in_array($component->name, ['VEVENT', 'VTODO'], true)) {
582582
$componentType = $component->name;
583583
break;
584584
}

‎apps/dav/lib/CalDAV/CachedSubscriptionProvider.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function getCalendars(string $principalUri, array $calendarUris = []): ar
2323
$calendarInfos = $this->calDavBackend->getSubscriptionsForUser($principalUri);
2424

2525
if (count($calendarUris) > 0) {
26-
$calendarInfos = array_filter($calendarInfos, fn (array $subscription) => in_array($subscription['uri'], $calendarUris));
26+
$calendarInfos = array_filter($calendarInfos, fn (array $subscription) => in_array($subscription['uri'], $calendarUris, true));
2727
}
2828

2929
$calendarInfos = array_values(array_filter($calendarInfos));

‎apps/dav/lib/CalDAV/CalDavBackend.php‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3043,7 +3043,7 @@ public function createSubscription($principalUri, $uri, array $properties) {
30433043
foreach ($this->subscriptionPropertyMap as $xmlName => [$dbName, $type]) {
30443044
if (array_key_exists($xmlName, $properties)) {
30453045
$values[$dbName] = $properties[$xmlName];
3046-
if (in_array($dbName, $propertiesBoolean)) {
3046+
if (in_array($dbName, $propertiesBoolean, true)) {
30473047
$values[$dbName] = true;
30483048
}
30493049
}
@@ -3684,7 +3684,7 @@ public function updateProperties($calendarId, $objectUri, $calendarData, $calend
36843684

36853685
$indexComponents = ['VEVENT', 'VJOURNAL', 'VTODO'];
36863686
foreach ($vCalendar->getComponents() as $component) {
3687-
if (!in_array($component->name, $indexComponents)) {
3687+
if (!in_array($component->name, $indexComponents, true)) {
36883688
continue;
36893689
}
36903690

@@ -3708,7 +3708,7 @@ public function updateProperties($calendarId, $objectUri, $calendarData, $calend
37083708
$indexedParametersForProperty = self::INDEXED_PARAMETERS[$property->name];
37093709

37103710
foreach ($parameters as $key => $value) {
3711-
if (in_array($key, $indexedParametersForProperty)) {
3711+
if (in_array($key, $indexedParametersForProperty, true)) {
37123712
// is this a shitty db?
37133713
if ($this->db->supports4ByteText()) {
37143714
$value = preg_replace('/[\x{10000}-\x{10FFFF}]/u', "\xEF\xBF\xBD", $value);

‎apps/dav/lib/CalDAV/CalendarProvider.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ public function getCalendars(string $principalUri, array $calendarUris = []): ar
3737

3838
if (!empty($calendarUris)) {
3939
$calendarInfos = array_filter($calendarInfos, function ($calendar) use ($calendarUris) {
40-
return in_array($calendar['uri'], $calendarUris);
40+
return in_array($calendar['uri'], $calendarUris, true);
4141
});
4242

4343
$federatedCalendarInfos = array_filter($federatedCalendarInfos, function ($federatedCalendar) use ($calendarUris) {
44-
return in_array($federatedCalendar['uri'], $calendarUris);
44+
return in_array($federatedCalendar['uri'], $calendarUris, true);
4545
});
4646
}
4747

0 commit comments

Comments
 (0)