[REFACTOR] Modernise plugin for ILIAS 10 - #25
Open
chfsx wants to merge 8 commits into
Open
Conversation
Automated rector pass: typed properties, dropped redundant @var/@param/@return docblocks, early returns, strict comparisons, and removal of dead arguments to single-parameter API calls (Translator::translate, getEffectivePaellaPlayerUrl).
- Type ilOpencastEventConfigGUI::$form as protected ilPropertyFormGUI instead of the public untyped property rector emitted. - Remove the payment_enabled assignment and property: the flag no longer exists in ilObjectListGUI and is unused throughout the core.
- Merge setDefaultMemberPerms/TutorPerms/AdminPerms into one grantPermissions() helper driven by a DEFAULT_PERMISSIONS map. - Replace global $ilDB/$ilUser/$ilAccess with the $DIC services and parameterise the checkOnline query via queryF. - Guard setDefaultPerms on ilObjCourse so a non-course parent skips the course-only role getters instead of triggering a TypeError.
Replace the hand-built SQL strings and global $ilDB with the inherited ilObject::$db service: insert()/update()/queryF()/manipulateF() with typed bindings. Also drops the stray $up = assignment in doUpdate.
The GUI and listing helpers fetched the same query parameter twice (once to test, once to return). Collapse to a single retrieve with an empty-fallback, and share one retrieveQueryParam() helper for sort and pagination in the listing.
Introduce getEventObject() returning ilObjOpencastEvent and route the plugin-specific getters/setters through it, removing the 18 per-call @Disregard P1013 annotations that worked around the generic ilObject type.
The listing repeated two shapes: constructing an ilTemplate from the plugin template dir, and the setCurrentBlock/setVariable/parseCurrentBlock triple. Replace both with parameterised template() and fillBlock() helpers, applied across the item spans and the create/edit render methods.
The getWidth()/getHeight() value-or-default fallback was repeated three times each across the player config, edit-form preview and form values. Replace with one parameterised effectiveDimension(value, default) helper.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Modernises the plugin for ILIAS 10 in small, reviewable steps (release_10 only). No behaviour change intended; the plugin still installs, activates and updates cleanly via the setup CLI.
Commits
sr rector:pluginpass (typed properties, dropped redundant docblocks, early returns, strict comparisons, removal of dead arguments to single-parameter API calls).$formtoprotected ilPropertyFormGUI; drop the deadpayment_enabledflag (no longer exists inilObjectListGUI, unused in core).setDefault{Member,Tutor,Admin}Permsinto onegrantPermissions()helper driven by a permission map; replaceglobal $ilDB/$ilUser/$ilAccesswith$DICservices; parameterisecheckOnlineviaqueryF.ilObject::$dbabstraction (insert/update/queryF/manipulateF) inilObjOpencastEventinstead of hand-built SQL strings andglobal $ilDB; drop the stray$up =assignment.retrieveQueryParam()helper for sort and pagination in the listing.getEventObject()accessor and route plugin-specific getters/setters through it, removing the 18 per-call@disregard P1013annotations.License headers were left untouched (
sr rector:plugin --no-license).