Task #53335

Replace magic __call method in NodeType

Added by Bastian Waidelich over 1 year ago. Updated over 1 year ago.

Status:Resolved Start date:2013-11-05
Priority:Should have Due date:
Assigned To:Bastian Waidelich % Done:

100%

Category:Nodetype support
Target version:Base Distribution - 1.0 beta 2
Sprint:

Description

Magic __call() methods have a lot of drawbacks. We should replace

$nodeType->getSomeFoo()

with
$nodeType->getConfiguration('someFoo');

Associated revisions

Revision 82a3e848
Added by Bastian Waidelich over 1 year ago

[!!!][TASK] Deprecate magic call method in NodeType

This deprecates the magic __call method in NodeType that was used to
check and retrieve single configuration options and replaces them
with two explicit methods ``hasConfiguration()`` and
``getConfiguration()``.

Background: magic __call methods have some severe drawbacks as they
are error prone, slow and hidden from IDEs.

This is not a breaking change in the technical sense because the
magic method still exists for compatibility reasons. But it replaces
the @api annotation by a @deprecated annotation requiring calling
code to adjust to the new API.
However, it replaces the (non-API) method ``getConfiguration()`` by
a new method ``getFullConfiguration()``.

Change-Id: I20abd27b137c1fec9ff351b17a97c5c93c15d287
Resolves: #53335
Reviewed-on: https://review.typo3.org/25173
Tested-by: Bastian Waidelich
Reviewed-by: Dominique Feyer
Tested-by: Dominique Feyer
Reviewed-by: Rens Admiraal
Tested-by: Rens Admiraal
Reviewed-by: Bastian Waidelich

History

#1 Updated by Bastian Waidelich over 1 year ago

Obviously NodeType::getConfiguration() is a bad idea as that already returns the complete configuration. What about getConfigurationOption() or just getOption() ?

#2 Updated by Gerrit Code Review over 1 year ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.TYPO3CR has been pushed to the review server.
It is available at https://review.typo3.org/25173

#3 Updated by Gerrit Code Review over 1 year ago

Patch set 2 for branch master of project Packages/TYPO3.TYPO3CR has been pushed to the review server.
It is available at https://review.typo3.org/25173

#4 Updated by Gerrit Code Review over 1 year ago

Patch set 3 for branch master of project Packages/TYPO3.TYPO3CR has been pushed to the review server.
It is available at https://review.typo3.org/25173

#5 Updated by Bastian Waidelich over 1 year ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#6 Updated by Bastian Waidelich over 1 year ago

  • Target version set to 1.0 beta 2

Also available in: Atom PDF