@@ -43,7 +43,7 @@ class ElementPromos extends BaseElement
4343 /**
4444 * @var array
4545 */
46- private static $ styles = array () ;
46+ private static $ styles = [] ;
4747
4848 /**
4949 * @var array
@@ -55,18 +55,18 @@ class ElementPromos extends BaseElement
5555 /**
5656 * @var array
5757 */
58- private static $ many_many = array (
58+ private static $ many_many = [
5959 'Promos ' => PromoObject::class,
60- ) ;
60+ ] ;
6161
6262 /**
6363 * @var array
6464 */
65- private static $ many_many_extraFields = array (
66- 'Promos ' => array (
65+ private static $ many_many_extraFields = [
66+ 'Promos ' => [
6767 'SortOrder ' => 'Int ' ,
68- ) ,
69- ) ;
68+ ] ,
69+ ] ;
7070
7171 /**
7272 * @var array
@@ -88,19 +88,21 @@ class ElementPromos extends BaseElement
8888 * @param bool $includerelations
8989 * @return array
9090 */
91+ #[\Override]
9192 public function fieldLabels ($ includerelations = true )
9293 {
9394 $ labels = parent ::fieldLabels ($ includerelations );
9495
95- $ labels ['Content ' ] = _t (__CLASS__ .'.ContentLabel ' , 'Intro ' );
96- $ labels ['Promos ' ] = _t (__CLASS__ . '.PromosLabel ' , 'Promos ' );
96+ $ labels ['Content ' ] = _t (self ::class .'.ContentLabel ' , 'Intro ' );
97+ $ labels ['Promos ' ] = _t (self ::class . '.PromosLabel ' , 'Promos ' );
9798
9899 return $ labels ;
99100 }
100101
101102 /**
102103 * @return FieldList
103104 */
105+ #[\Override]
104106 public function getCMSFields ()
105107 {
106108 $ this ->beforeUpdateCMSFields (function (FieldList $ fields ) {
@@ -117,13 +119,14 @@ public function getCMSFields()
117119 GridFieldDeleteAction::class,
118120 GridFieldArchiveAction::class,
119121 ])->addComponents (
120- new GridFieldOrderableRows ('SortOrder ' ),
121- new GridFieldAddExistingSearchButton ()
122+ GridFieldOrderableRows:: create ('SortOrder ' ),
123+ GridFieldAddExistingSearchButton:: create ()
122124 );
123125
124- $ fields ->addFieldsToTab ('Root.Main ' , array (
126+
127+ $ fields ->addFieldsToTab ('Root.Main ' , [
125128 $ promoField ,
126- ) );
129+ ] );
127130 }
128131 });
129132
@@ -141,6 +144,7 @@ public function getPromoList()
141144 /**
142145 * @return DBHTMLText
143146 */
147+ #[\Override]
144148 public function getSummary ()
145149 {
146150 $ count = $ this ->Promos ()->count ();
@@ -149,13 +153,14 @@ public function getSummary()
149153 'A promo|{count} promos ' ,
150154 [ 'count ' => $ count ]
151155 );
152-
156+
153157 return DBField::create_field ('HTMLText ' , $ label )->Summary (20 );
154158 }
155159
156160 /**
157161 * @return array
158162 */
163+ #[\Override]
159164 protected function provideBlockSchema ()
160165 {
161166 $ blockSchema = parent ::provideBlockSchema ();
@@ -166,8 +171,9 @@ protected function provideBlockSchema()
166171 /**
167172 * @return string
168173 */
174+ #[\Override]
169175 public function getType ()
170176 {
171- return _t (__CLASS__ .'.BlockType ' , 'Promos ' );
177+ return _t (self ::class .'.BlockType ' , 'Promos ' );
172178 }
173179}
0 commit comments