Skip to content

Conversation

@splitbrain
Copy link
Member

This fixes most of the code style issues. PHP Code Sniffer and Rector have been applied file by file, so it's easier to review individual commits than everything at once.

This mostly addresses the obvious style issues but does not refactor the code (except for some smaller things I noticed while going through the code). Especially helper and action would need some more love (and doc blocks).

Note: for PSR-2 compatibility I had to rename a whole bunch of methods. Theoretically only the getFlags() method is supposed to be used from outside as it is the only one returned in getMethods, but I doubt that is the case. This branch should be checked at least with the blog plugin before merging.

splitbrain added 14 commits July 4, 2025 17:53
removed old compatibility checks
(auto) reformatted the code
used guardian pattern to reduce complexity
removed unneeded line feeds
(auto) reformatted
removed unneeded line feeds
(auto) reformatted
guardian pattern
removed old compatibility checks
(auto) reformatted
droped line feeds
guardian pattern
dropped old compatibility
(auto) reformatted
(auto) reformatted
guardian pattern
removed old compability
(auto) reformatting
guardian
mostly (auto) reformatting

The render method is quite long and complex and proabably should be
split up later
(auto) reformatting
PSR-2 renaming

I started on cleaning up the instruction handling methods, but left most
of them as is. This needs a more detail oriented refactoring. The
passing of an instruction array that is modified by reference is not
ideal.

Methods still need type hints and parameter doc blocks.
(auto) reformatting
PSR-2 name changes
@splitbrain splitbrain requested review from Klap-in and michitux July 4, 2025 17:54
Copy link
Member

@Klap-in Klap-in left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks logical from the diff. Not tested further. Some minor notes.

@Klap-in
Copy link
Member

Klap-in commented Jul 6, 2025

Other plugins that needs a fix for this:

  • blog: get_flags, _get_instructions
  • randominc: get_flags, _get_included_pages, _get_instructions
  • tipoftheday: _get_instructions

(Results from codesearch with 2 year old indexation)

First thought https://www.dokuwiki.org/plugin:mediasyntax was also using the include plugin, but it copied quite a bit. So we could give a notice, such that it can keep inline eventually.

@splitbrain
Copy link
Member Author

@Klap-in I added support for those three methods via a __call() method. Haven't tested this though.

@Klap-in
Copy link
Member

Klap-in commented Jul 7, 2025

With the updated index I found also ‘tagfilter’ uses this helper, but the used methods are already covered. Thanks, fine for me! I have not yet an opportunity to test.

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.

3 participants