mirror of https://github.com/sualko/cloud_bbb
fix: psalm errors
parent
b54f9db4e4
commit
f78fd5c47e
|
@ -6,7 +6,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
ocp-version: [ 'dev-master', '^20.0' ]
|
ocp-version: [ 'dev-stable21', 'dev-stable20', 'dev-stable19' ]
|
||||||
name: Nextcloud ${{ matrix.ocp-version }}
|
name: Nextcloud ${{ matrix.ocp-version }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -50,7 +50,8 @@ class Application extends App {
|
||||||
}
|
}
|
||||||
|
|
||||||
private function registerAsPersonalSetting() {
|
private function registerAsPersonalSetting() {
|
||||||
$settingsManager = $this->getContainer()->getServer()->getSettingsManager();
|
/** @var ISettingsManager */
|
||||||
|
$settingsManager = $this->getContainer()->query(ISettingsManager::class);
|
||||||
|
|
||||||
$settingsManager->registerSetting(ISettingsManager::KEY_PERSONAL_SETTINGS, \OCA\BigBlueButton\Settings\Personal::class);
|
$settingsManager->registerSetting(ISettingsManager::KEY_PERSONAL_SETTINGS, \OCA\BigBlueButton\Settings\Personal::class);
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,7 +69,7 @@ class RestrictionController extends Controller {
|
||||||
string $groupId
|
string $groupId
|
||||||
): DataResponse {
|
): DataResponse {
|
||||||
if ($this->service->existsByGroupId($groupId)) {
|
if ($this->service->existsByGroupId($groupId)) {
|
||||||
return new DataResponse(null, Http::STATUS_CONFLICT);
|
return new DataResponse([], Http::STATUS_CONFLICT);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new DataResponse($this->service->create(
|
return new DataResponse($this->service->create(
|
||||||
|
|
|
@ -75,22 +75,22 @@ class RoomController extends Controller {
|
||||||
string $access
|
string $access
|
||||||
): DataResponse {
|
): DataResponse {
|
||||||
if (!$this->permission->isAllowedToCreateRoom($this->userId)) {
|
if (!$this->permission->isAllowedToCreateRoom($this->userId)) {
|
||||||
return new DataResponse(null, Http::STATUS_FORBIDDEN);
|
return new DataResponse([], Http::STATUS_FORBIDDEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
$restriction = $this->permission->getRestriction($this->userId);
|
$restriction = $this->permission->getRestriction($this->userId);
|
||||||
|
|
||||||
if ($restriction->getMaxParticipants() > -1 && ($maxParticipants > $restriction->getMaxParticipants() || $maxParticipants <= 0)) {
|
if ($restriction->getMaxParticipants() > -1 && ($maxParticipants > $restriction->getMaxParticipants() || $maxParticipants <= 0)) {
|
||||||
return new DataResponse('Max participants limit exceeded.', Http::STATUS_BAD_REQUEST);
|
return new DataResponse(['message' => 'Max participants limit exceeded.'], Http::STATUS_BAD_REQUEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$restriction->getAllowRecording() && $record) {
|
if (!$restriction->getAllowRecording() && $record) {
|
||||||
return new DataResponse('Not allowed to enable recordings.', Http::STATUS_BAD_REQUEST);
|
return new DataResponse(['message' => 'Not allowed to enable recordings.'], Http::STATUS_BAD_REQUEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
$disabledRoomTypes = \json_decode($restriction->getRoomTypes());
|
$disabledRoomTypes = \json_decode($restriction->getRoomTypes());
|
||||||
if (in_array($access, $disabledRoomTypes) || !in_array($access, Room::ACCESS)) {
|
if (in_array($access, $disabledRoomTypes) || !in_array($access, Room::ACCESS)) {
|
||||||
return new DataResponse('Access type not allowed.', Http::STATUS_BAD_REQUEST);
|
return new DataResponse(['message' => 'Access type not allowed.'], Http::STATUS_BAD_REQUEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new DataResponse($this->service->create(
|
return new DataResponse($this->service->create(
|
||||||
|
@ -126,16 +126,16 @@ class RoomController extends Controller {
|
||||||
$restriction = $this->permission->getRestriction($this->userId);
|
$restriction = $this->permission->getRestriction($this->userId);
|
||||||
|
|
||||||
if ($restriction->getMaxParticipants() > -1 && $maxParticipants !== $room->getMaxParticipants() && ($maxParticipants > $restriction->getMaxParticipants() || $maxParticipants <= 0)) {
|
if ($restriction->getMaxParticipants() > -1 && $maxParticipants !== $room->getMaxParticipants() && ($maxParticipants > $restriction->getMaxParticipants() || $maxParticipants <= 0)) {
|
||||||
return new DataResponse('Max participants limit exceeded.', Http::STATUS_BAD_REQUEST);
|
return new DataResponse(['message' => 'Max participants limit exceeded.'], Http::STATUS_BAD_REQUEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$restriction->getAllowRecording() && $record !== $room->getRecord()) {
|
if (!$restriction->getAllowRecording() && $record !== $room->getRecord()) {
|
||||||
return new DataResponse('Not allowed to enable recordings.', Http::STATUS_BAD_REQUEST);
|
return new DataResponse(['message' => 'Not allowed to enable recordings.'], Http::STATUS_BAD_REQUEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
$disabledRoomTypes = \json_decode($restriction->getRoomTypes());
|
$disabledRoomTypes = \json_decode($restriction->getRoomTypes());
|
||||||
if ((in_array($access, $disabledRoomTypes) && $access !== $room->getAccess()) || !in_array($access, Room::ACCESS)) {
|
if ((in_array($access, $disabledRoomTypes) && $access !== $room->getAccess()) || !in_array($access, Room::ACCESS)) {
|
||||||
return new DataResponse('Access type not allowed.', Http::STATUS_BAD_REQUEST);
|
return new DataResponse(['message' => 'Access type not allowed.'], Http::STATUS_BAD_REQUEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->handleNotFound(function () use ($id, $name, $welcome, $maxParticipants, $record, $access, $everyoneIsModerator, $requireModerator, $moderatorToken) {
|
return $this->handleNotFound(function () use ($id, $name, $welcome, $maxParticipants, $record, $access, $everyoneIsModerator, $requireModerator, $moderatorToken) {
|
||||||
|
@ -150,7 +150,7 @@ class RoomController extends Controller {
|
||||||
$room = $this->service->find($id);
|
$room = $this->service->find($id);
|
||||||
|
|
||||||
if (!$this->permission->isAdmin($room, $this->userId)) {
|
if (!$this->permission->isAdmin($room, $this->userId)) {
|
||||||
return new DataResponse(null, Http::STATUS_FORBIDDEN);
|
return new DataResponse([], Http::STATUS_FORBIDDEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->handleNotFound(function () use ($id) {
|
return $this->handleNotFound(function () use ($id) {
|
||||||
|
|
|
@ -108,7 +108,7 @@ class RoomShareController extends Controller {
|
||||||
int $permission
|
int $permission
|
||||||
): DataResponse {
|
): DataResponse {
|
||||||
if (!$this->isUserAllowed($roomId)) {
|
if (!$this->isUserAllowed($roomId)) {
|
||||||
return new DataResponse(null, Http::STATUS_FORBIDDEN);
|
return new DataResponse([], Http::STATUS_FORBIDDEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new DataResponse($this->service->create(
|
return new DataResponse($this->service->create(
|
||||||
|
@ -130,7 +130,7 @@ class RoomShareController extends Controller {
|
||||||
int $permission
|
int $permission
|
||||||
): DataResponse {
|
): DataResponse {
|
||||||
if (!$this->isUserAllowed($roomId)) {
|
if (!$this->isUserAllowed($roomId)) {
|
||||||
return new DataResponse(null, Http::STATUS_FORBIDDEN);
|
return new DataResponse([], Http::STATUS_FORBIDDEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->handleNotFound(function () use (
|
return $this->handleNotFound(function () use (
|
||||||
|
@ -157,7 +157,7 @@ class RoomShareController extends Controller {
|
||||||
$roomShare = $this->service->find($id);
|
$roomShare = $this->service->find($id);
|
||||||
|
|
||||||
if (!$this->isUserAllowed($roomShare->getRoomId())) {
|
if (!$this->isUserAllowed($roomShare->getRoomId())) {
|
||||||
return new DataResponse(null, Http::STATUS_FORBIDDEN);
|
return new DataResponse([], Http::STATUS_FORBIDDEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->service->delete($id);
|
return $this->service->delete($id);
|
||||||
|
|
|
@ -57,11 +57,11 @@ class HookMiddleware extends Middleware {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($exception instanceof NotFoundException) {
|
if ($exception instanceof NotFoundException) {
|
||||||
return new JSONResponse(null, Http::STATUS_NOT_FOUND);
|
return new JSONResponse([], Http::STATUS_NOT_FOUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($exception instanceof NoPermissionException) {
|
if ($exception instanceof NoPermissionException) {
|
||||||
return new JSONResponse(null, Http::STATUS_FORBIDDEN);
|
return new JSONResponse([], Http::STATUS_FORBIDDEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
throw $exception;
|
throw $exception;
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xmlns="https://getpsalm.org/schema/config"
|
xmlns="https://getpsalm.org/schema/config"
|
||||||
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
|
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
|
||||||
|
errorBaseline="tests/psalm-baseline.xml"
|
||||||
>
|
>
|
||||||
<projectFiles>
|
<projectFiles>
|
||||||
<directory name="lib" />
|
<directory name="lib" />
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<files psalm-version="4.5.1@257a1ca672a79dedc852be1285a7b97154646418">
|
||||||
|
<file src="lib/CircleHelper.php">
|
||||||
|
<UndefinedClass occurrences="3">
|
||||||
|
<code>\OCA\Circles\Api\v1\Circles</code>
|
||||||
|
<code>\OCA\Circles\Model\Circle</code>
|
||||||
|
<code>\OCA\Circles\Model\Member</code>
|
||||||
|
</UndefinedClass>
|
||||||
|
</file>
|
||||||
|
<file src="lib/Controller/RoomController.php">
|
||||||
|
<NullArgument occurrences="1">
|
||||||
|
<code>null</code>
|
||||||
|
</NullArgument>
|
||||||
|
</file>
|
||||||
|
<file src="lib/Controller/ServerController.php">
|
||||||
|
<InvalidArgument occurrences="1">
|
||||||
|
<code>$success</code>
|
||||||
|
</InvalidArgument>
|
||||||
|
</file>
|
||||||
|
<file src="lib/NoPermissionResponse.php">
|
||||||
|
<MissingDependency occurrences="1">
|
||||||
|
<code>Template</code>
|
||||||
|
</MissingDependency>
|
||||||
|
</file>
|
||||||
|
<file src="lib/NotFoundResponse.php">
|
||||||
|
<MissingDependency occurrences="1">
|
||||||
|
<code>Template</code>
|
||||||
|
</MissingDependency>
|
||||||
|
</file>
|
||||||
|
<file src="lib/Service/RestrictionService.php">
|
||||||
|
<InvalidReturnType occurrences="3">
|
||||||
|
<code>Restriction</code>
|
||||||
|
<code>Restriction</code>
|
||||||
|
<code>Restriction</code>
|
||||||
|
</InvalidReturnType>
|
||||||
|
</file>
|
||||||
|
<file src="lib/Service/RoomService.php">
|
||||||
|
<InvalidReturnType occurrences="1">
|
||||||
|
<code>Room</code>
|
||||||
|
</InvalidReturnType>
|
||||||
|
</file>
|
||||||
|
<file src="lib/Service/RoomShareService.php">
|
||||||
|
<InvalidReturnType occurrences="3">
|
||||||
|
<code>RoomShare</code>
|
||||||
|
<code>RoomShare</code>
|
||||||
|
<code>RoomShare</code>
|
||||||
|
</InvalidReturnType>
|
||||||
|
</file>
|
||||||
|
</files>
|
Loading…
Reference in New Issue