Review main Abandoned

52381[WIP][FEATURE] Add a modern API for typolink

Elmar Hinz CR 0 V 0 Nightmare +2267 −965 updated 02/08/18, 14:46

Commit message

- Move typoLink and related methods into a new class LinkRenderer.
- Define a public API:

  - buildLink()
  - buildLinkFromArguments()
  - buildLinkFromTypoScript()

  - buildURL()
  - buildURLFromArguments()
  - buildURLFromTypoScript()

  - buildTag()
  - buildTagFromArguments()
  - buildTagFromTypoScript()

  - buildArray()
  - buildArrayFromArguments()
  - buildArrayFromTypoScript()

The four short forms are overloaded to delegate to the long forms by the
signature of the parameters. The long forms provide type hints for the
IDE. The short forms are handy for non-IDE editing.

- Provides feature ReST.
- Provides deprecation ReST of the old API.
- The modern API is applied throughout the core.
- Unit tests are provided, that cover all branches of the new API.
- Does strict type checking.

The typolink method itself still isn't fully coverd by unit tests.
(That will be really hard to do). It just has been moved into a
different place and the smoketests show, it's well enough wired.

Note on some ugly public properties
-----------------------------------

Three public properties of ContentObjectRenderer are touched:

$lastTypoLinkLD
$lastTypoLinkUrl
$lastTypoLinkTarget

These are only used in three places:

- AbstractMenuContentObject::menuTypoLink()
- DatabaseRecordLinkBuilder::build()
- PageLinkBuilder::build()

The public properties should soon be deprecated and __set(), __get(),
_isset() are prepared to take up deprecation notices.

Unfortunatly it would add too much complexity to this patch to improve the
three above locations within this patch. It's not a trivial concern and
deserves an own commit, once this is accepted.

Note on the choice of the method names
--------------------------------------

Arguments are, what is passed into a method.
The passed in arguments are parameters inside a method.

For the difference of the terms arguments and parameters see:

    http://stackoverflow.com/questions/427653/arguments-or-parameters

Review

  • Code review CR 0

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V 0

    Imported before Forger kept the single votes, the next import adds them.

Issues 1

Files 17