rfc:stringable

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
rfc:stringable [2020/01/22 15:34] nicolasgrekasrfc:stringable [2020/01/25 12:16] nicolasgrekas
Line 21: Line 21:
 By being simple and without any magic capabilities on its own, this interface is trivially polyfilled on PHP < 8. By being simple and without any magic capabilities on its own, this interface is trivially polyfilled on PHP < 8.
  
-Once a polyfill becomes widely available (e.g. as part of symfony/polyfill-php80), we can expect code style checkers to be able to enforce declaring the interface when ''%%__toString()%%'' is used. For projects that don't use cs checkers, they'll notice quickly that they missed adding the interface when their users will ask for it if they do.+Once a polyfill becomes widely available (e.g. [[https://github.com/symfony/polyfill/pull/224|as part of symfony/polyfill-php80]]), we can expect code style checkers to be able to enforce declaring the interface when ''%%__toString()%%'' is used. For projects that don't use cs checkers, they'll notice quickly that they missed adding the interface when their users will ask for it if they do.
  
 Here is the stub declaration of the interface: Here is the stub declaration of the interface:
Line 50: Line 50:
 ===== RFC Impact ===== ===== RFC Impact =====
 ==== To Existing Extensions ==== ==== To Existing Extensions ====
-Extensions will need to add the ''string'' return type when they declare ''%%__toString()%%'' methods.+Extensions will need to add the ''string'' return type when they declare ''%%__toString()%%'' methods if they want to adopt the new interface.
  
 ===== Open Issues ===== ===== Open Issues =====
rfc/stringable.txt · Last modified: 2020/08/01 23:38 by carusogabriel