[TYPO3-v4] RFC: Visibility keywords throught the Core

Ernesto Baschny [cron IT] ernst at cron-it.de
Mon Oct 11 16:43:07 CEST 2010


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


More information about the TYPO3-project-v4 mailing list