Skip to content

[REFACTOR] Modernise plugin for ILIAS 10 - #25

Open
chfsx wants to merge 8 commits into
opencast-ilias:release_10from
srsolutionsag:modernize/10
Open

[REFACTOR] Modernise plugin for ILIAS 10#25
chfsx wants to merge 8 commits into
opencast-ilias:release_10from
srsolutionsag:modernize/10

Conversation

@chfsx

@chfsx chfsx commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

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

  1. sr rector:plugin pass (typed properties, dropped redundant docblocks, early returns, strict comparisons, removal of dead arguments to single-parameter API calls).
  2. Tighten $form to protected ilPropertyFormGUI; drop the dead payment_enabled flag (no longer exists in ilObjectListGUI, unused in core).
  3. Collapse the three near-identical setDefault{Member,Tutor,Admin}Perms into one grantPermissions() helper driven by a permission map; replace global $ilDB/$ilUser/$ilAccess with $DIC services; parameterise checkOnline via queryF.
  4. Use the inherited ilObject::$db abstraction (insert/update/queryF/manipulateF) in ilObjOpencastEvent instead of hand-built SQL strings and global $ilDB; drop the stray $up = assignment.
  5. Retrieve each query parameter only once (was fetched twice — to test then to return); share one retrieveQueryParam() helper for sort and pagination in the listing.
  6. Add a typed getEventObject() accessor and route plugin-specific getters/setters through it, removing the 18 per-call @disregard P1013 annotations.

License headers were left untouched (sr rector:plugin --no-license).

chfsx added 8 commits June 5, 2026 14:54
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant