Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MAINTENANCE] Ignore errors related to classes coming from slub-web-digas repository #59

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions .github/phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
parameters:
level: 5
paths:
- ../Classes/
treatPhpDocTypesAsCertain: false
ignoreErrors:
- '#Call to method getRecordId\(\) on an unknown class Slub\\SlubWebDigas\\Domain\\Model\\KitodoDocument\.#'
- '#Call to method getTitle\(\) on an unknown class Slub\\SlubWebDigas\\Domain\\Model\\KitodoDocument\.#'
- '#Call to method getUid\(\) on an unknown class Slub\\SlubWebDigas\\Domain\\Model\\KitodoDocument\.#'
- '#Call to method findOneByRecordId\(\) on an unknown class Slub\\SlubWebDigas\\Domain\\Repository\\KitodoDocumentRepository\.#'
- '#Call to method setDefaultQuerySettings\(\) on an unknown class Slub\\SlubWebDigas\\Domain\\Repository\\KitodoDocumentRepository\.#'
- '#Class Slub\\SlubWebDigas\\Domain\\Model\\KitodoDocument not found\.#'
- '#Method Slub\\DigasFeManagement\\Domain\\Repository\\KitodoDocumentRepository::dataMapQueryResult\(\) has invalid return type Slub\\SlubWebDigas\\Domain\\Model\\KitodoDocument\.#'
- '#Method Slub\\DigasFeManagement\\ViewHelpers\\KitodoAccessViewHelper::getDlfDocument\(\) has invalid return type Slub\\SlubWebDigas\\Domain\\Model\\KitodoDocument\.#'
- '#Parameter \$kitodoDocumentRepository of method Slub\\DigasFeManagement\\Controller\\StatisticController::injectKitodoDocumentRepository\(\) has invalid type Slub\\SlubWebDigas\\Domain\\Repository\\KitodoDocumentRepository\.#'
- '#Parameter \$dlfDocument of method Slub\\DigasFeManagement\\Domain\\Model\\Access::setDlfDocument\(\) has invalid type Slub\\SlubWebDigas\\Domain\\Model\\KitodoDocument\.#'
- '#Parameter \$documents of method Slub\\DigasFeManagement\\Controller\\BasketController::sendRequestAccessMail\(\) has invalid type Slub\\SlubWebDigas\\Domain\\Model\\KitodoDocument\.#'
- '#Property Slub\\DigasFeManagement\\Controller\\StatisticController::\$kitodoDocumentRepository has unknown class Slub\\SlubWebDigas\\Domain\\Repository\\KitodoDocumentRepository as its type\.#'
level: 5
paths:
- ../Classes/
treatPhpDocTypesAsCertain: false
2 changes: 2 additions & 0 deletions Classes/ViewHelpers/KitodoAccessViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ public static function renderStatic(array $arguments, \Closure $renderChildrenCl

// check if document has public access
// restrictions === 'nein' means, there are no restrictions.
// @phpstan-ignore-next-line
if ($kitodoDocument['restrictions'] === 'nein' ) {
return true;
}
Expand All @@ -116,6 +117,7 @@ public static function renderStatic(array $arguments, \Closure $renderChildrenCl
//get accessible documents of current fe_user
$accessIds = KitodoAccessViewHelper::getKitodoDocumentAccessIdsAsArray($currentUser->getKitodoDocumentAccess());

// @phpstan-ignore-next-line
return in_array($kitodoDocument['record_id'], $accessIds);
}
return false;
Expand Down
Loading