Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This function is only used in FilterPluginBase, so shall we just move it there?
Comment | File | Size | Author |
---|---|---|---|
#12 | interdiff.txt | 612 bytes | dawehner |
#12 | drupal-1912466-12.patch | 2.62 KB | dawehner |
#9 | 1912466-9.patch | 2.6 KB | damiankloip |
#6 | 1912466-6.patch | 2.6 KB | damiankloip |
#2 | 1912466-2.patch | 2.61 KB | damiankloip |
Comments
Comment #1
dawehnerGood idea!
probably a string?
Would it make sense to have a static function as you don't need any kind of values on the main object. Shouldn't this also be protected?
Comment #2
damiankloip CreditAttribution: damiankloip commentedYeah, that makes sense. I just added a static in #1912476: Move views_trim_text to FieldPluginBase as it happens.
Comment #3
dawehneryou can use static::arrayFilterZero as alternative syntax
Comment #4
damiankloip CreditAttribution: damiankloip commentedNot sure about protected, will we need to use this externally ever? or in tests?
Comment #5
dawehnerThe reasons why it should be protected are the following: a) It's not something which is really useful in connection with other code, so making it public would make the object even more complicated from the outside and b) if someone needs that functionality it's a one line function to implement for their own, that's unneeded abstraction.
Comment #6
damiankloip CreditAttribution: damiankloip commentedFair point, I changed to the static too, that is better.
Comment #7
dawehnerLooks good!
Comment #9
damiankloip CreditAttribution: damiankloip commentedForgot to wrap the callables in array_filter in quotes.
This should be good to go now.
Comment #10
dawehnerRTBC as long it's green.
Comment #11
catchI know it's just moving code around but per coding standards this could be single quotes.
I guess this makes sense as a helper function since it's used in two places, but was also wondering about just a closure?
Comment #12
dawehnerUps :)
Comment #13
damiankloip CreditAttribution: damiankloip commentedThis was RTBC before that small string quote change, that's the only thing dawehner changed. SO I think this can still be RTBC?
Comment #14
catchCommitted/pushed to 8.x, thanks!