toString and __toString()

28 views
Skip to first unread message

Christophe Demko

unread,
Dec 17, 2009, 11:18:02 AM12/17/09
to Joomla! CMS Development
Hi to all,

In Joomla Code there remains a lot of calls to $object->toString()
method. Do we generalize the use of __toString() magic method (replace
$object->toString() by (string)$object) and deprecate the toString
method or do we wait for 1.7?

Sam Moffatt

unread,
Dec 17, 2009, 2:59:06 PM12/17/09
to joomla-...@googlegroups.com
I'd suggest that as you see it replace it out and where it is in a
library or some other place that is expected to be called by third
party code make sure that you leave the old method in and marked with
a deprecated tag so that we can remove the function in a later
release.

Cheers,

Sam Moffatt
http://pasamio.id.au

> --
>
> You received this message because you are subscribed to the Google Groups "Joomla! CMS Development" group.
> To post to this group, send an email to joomla-...@googlegroups.com.
> To unsubscribe from this group, send email to joomla-dev-cm...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/joomla-dev-cms?hl=en-GB.
>
>
>

Christophe Demko

unread,
Dec 17, 2009, 3:37:31 PM12/17/09
to Joomla! CMS Development
Hi sam,

I will do that on the chdemko branch after my work on com_categories
would have been included (or not) in the trunk. But I will be less
working on Joomla during our winter holidays.
So may be at the beginning of january

Christophe

On 17 déc, 20:59, Sam Moffatt <pasa...@gmail.com> wrote:
> I'd suggest that as you see it replace it out and where it is in a
> library or some other place that is expected to be called by third
> party code make sure that you leave the old method in and marked with
> a deprecated tag so that we can remove the function in a later
> release.
>
> Cheers,
>

> Sam Moffatthttp://pasamio.id.au

Christophe Demko

unread,
Jan 4, 2010, 6:47:17 AM1/4/10
to Joomla! CMS Development
Hi,

I've created a tostring branch (http://joomlacode.org/svn/joomla/
development/branches/tostring) and change all calls from $object-
>toString() to (string)$object or directly $object if php do the work
(echo $object is equivalent to echo (string)$object if there is a
__toString() method)

Ch.D

Reply all
Reply to author
Forward
0 new messages