[TYPO3-v4] RFC: Visibility keywords throught the Core
Sebastian Fischer
sf at marketing-factory.de
Tue Oct 12 09:12:22 CEST 2010
Am 11.10.2010 16:43, schrieb Ernesto Baschny [cron IT]:
> Am 11.10.2010 16:11, Steffen Kamper schrieb:
>> Ernesto Baschny [cron IT] schrieb:
>>> Steffen Kamper schrieb am 11.10.2010 10:18:
>>>> Hi,
>>>>
>>>> the problem is the big amount of classes where it's not set yet. And,
>>>> for mentioned reasons it's not easy to decide public/protected.
>>>>
>>>> I think a good start would be t3lib where all should be public.
>>>
>>> I think that is what Sebastian suggested. If we change it now, everyhing
>>> has to start being public.
>>>
>>> But then, what sense does it make? Default is "public" in PHP, isn't it?
>>>
>>> Adding deprecation logging to methods which might be good candidates
>>> for getting "private" in future might make sense. But we will have to
>>> duplicate the methods to make them "private": because else even internal
>>> calls will get logged to deprecation logs.
>>>
>>
>> i wouldn't go for such logging. It's more a CGL cleanup, as leaving
>> out visibility keyword is public.
>>
>> So starting writing public is enough to have an unique touch and feel.
>
> I don't agree with that. If we simply add "public" everywhere, we cannot
> differenciate anymore from "public for a reason" vs "public because it
> has always been like that".
>
> Currently its pretty easy to see, as every class that has no "public"
> keywords clearly still comes from the "old times".
>
> So we should only starting doing such a "cleanup" when we have a plan on
> how to migrate specific methods to "private / protected". Usually those
> classes needs a refactoring anyway, so it makes no sense in thinking
> about it in a "global scope", but rather from case to case.
>
> Cheers,
> Ernesto
Having read what Ernesto and Steffen wrote i now have a second oppinion.
If we dont intend to make methods protected/private it would be best bet
to keep it like it is.
"Only" for CGL it would be to much changeing. And its no hint at all to
have every function public.
But im still in and would gladly assist if there are intentions to
differentiate the visibility. I dont think that we need to have every
method open to the world.
If it come to logging. Logging makes only sense when not every method
gets logged from tomorrow on, as it doesnt makes sense to make every
method protected then next possible release.
And by the way it makes only sense to log something if it realy
disappears or get protected on the forth coming release. Currently we
log methods that are 3.x old.
And a big but is inside makeing protected whitout logging before. I dont
think that this would be very wise. And no a @deprecated is not enough
on such a change.
Greetings
Sebastian
More information about the TYPO3-project-v4
mailing list