@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | <div id="content" class="item-content tab-pane fade" role="tablist" aria-labelledby="content"> |
26 | 26 | |
27 | 27 | <div id="item-content-group" |
28 | - data-items="<?= $enc->attr( $this->get( 'contentData', [] ) ); ?>" |
|
28 | + data-items="<?= $enc->attr($this->get('contentData', [])); ?>" |
|
29 | 29 | data-siteid="<?= $this->site()->siteid() ?>" |
30 | 30 | data-domain="cms" > |
31 | 31 | |
@@ -37,24 +37,24 @@ discard block |
||
37 | 37 | v-bind:data-target="'#item-text-group-data-' + idx" data-bs-toggle="collapse" role="tab" class="card-header header" |
38 | 38 | v-bind:aria-controls="'item-text-group-data-' + idx" aria-expanded="false" v-on:click="toggle('_show', idx)"> |
39 | 39 | <div class="card-tools-left"> |
40 | - <div class="btn btn-card-header act-show fa" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
41 | - title="<?= $enc->attr( $this->translate( 'admin', 'Show/hide this entry' ) ); ?>"> |
|
40 | + <div class="btn btn-card-header act-show fa" tabindex="<?= $this->get('tabindex'); ?>" |
|
41 | + title="<?= $enc->attr($this->translate('admin', 'Show/hide this entry')); ?>"> |
|
42 | 42 | </div> |
43 | 43 | </div> |
44 | 44 | <span class="item-label header-label" v-bind:class="{disabled: !active(idx)}">{{ label(idx) }}</span> |
45 | 45 | |
46 | 46 | <div class="card-tools-right"> |
47 | - <div class="btn btn-card-header act-copy fa" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
48 | - title="<?= $enc->attr( $this->translate( 'admin', 'Duplicate entry (Ctrl+D)' ) ); ?>" |
|
47 | + <div class="btn btn-card-header act-copy fa" tabindex="<?= $this->get('tabindex'); ?>" |
|
48 | + title="<?= $enc->attr($this->translate('admin', 'Duplicate entry (Ctrl+D)')); ?>" |
|
49 | 49 | v-on:click.stop="duplicate(idx)"> |
50 | 50 | </div> |
51 | 51 | <div v-if="item['cms.lists.siteid'] == siteid && !item['_nosort']" |
52 | - class="btn btn-card-header act-move fa" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
53 | - title="<?= $enc->attr( $this->translate( 'admin', 'Move this entry up/down' ) ); ?>"> |
|
52 | + class="btn btn-card-header act-move fa" tabindex="<?= $this->get('tabindex'); ?>" |
|
53 | + title="<?= $enc->attr($this->translate('admin', 'Move this entry up/down')); ?>"> |
|
54 | 54 | </div> |
55 | 55 | <div v-if="item['cms.lists.siteid'] == siteid" |
56 | - class="btn btn-card-header act-delete fa" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
57 | - title="<?= $enc->attr( $this->translate( 'admin', 'Delete this entry' ) ); ?>" |
|
56 | + class="btn btn-card-header act-delete fa" tabindex="<?= $this->get('tabindex'); ?>" |
|
57 | + title="<?= $enc->attr($this->translate('admin', 'Delete this entry')); ?>" |
|
58 | 58 | v-on:click.stop="remove(idx)"> |
59 | 59 | </div> |
60 | 60 | </div> |
@@ -64,29 +64,29 @@ discard block |
||
64 | 64 | v-bind:aria-labelledby="'item-text-group-item-' + idx" role="tabpanel" class="card-block collapse row"> |
65 | 65 | |
66 | 66 | <input type="hidden" v-model="item['text.id']" |
67 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'content', '_idx_', 'text.id' ) ) ); ?>'.replace('_idx_', idx)" /> |
|
67 | + v-bind:name="'<?= $enc->attr($this->formparam(array('content', '_idx_', 'text.id'))); ?>'.replace('_idx_', idx)" /> |
|
68 | 68 | |
69 | 69 | <div class="col-xl-6"> |
70 | 70 | |
71 | 71 | <div class="form-group row mandatory"> |
72 | - <label class="col-sm-4 form-control-label"><?= $enc->html( $this->translate( 'admin', 'Status' ) ); ?></label> |
|
72 | + <label class="col-sm-4 form-control-label"><?= $enc->html($this->translate('admin', 'Status')); ?></label> |
|
73 | 73 | <div class="col-sm-8"> |
74 | - <select class="form-control form-select item-status" required="required" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
75 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'content', '_idx_', 'text.status' ) ) ); ?>'.replace('_idx_', idx)" |
|
74 | + <select class="form-control form-select item-status" required="required" tabindex="<?= $this->get('tabindex'); ?>" |
|
75 | + v-bind:name="'<?= $enc->attr($this->formparam(array('content', '_idx_', 'text.status'))); ?>'.replace('_idx_', idx)" |
|
76 | 76 | v-bind:readonly="item['text.siteid'] != siteid" |
77 | 77 | v-model="item['text.status']" > |
78 | - <option value=""><?= $enc->html( $this->translate( 'admin', 'Please select' ) ); ?></option> |
|
78 | + <option value=""><?= $enc->html($this->translate('admin', 'Please select')); ?></option> |
|
79 | 79 | <option value="1" v-bind:selected="item['text.status'] == 1" > |
80 | - <?= $enc->html( $this->translate( 'mshop/code', 'status:1' ) ); ?> |
|
80 | + <?= $enc->html($this->translate('mshop/code', 'status:1')); ?> |
|
81 | 81 | </option> |
82 | 82 | <option value="0" v-bind:selected="item['text.status'] == 0" > |
83 | - <?= $enc->html( $this->translate( 'mshop/code', 'status:0' ) ); ?> |
|
83 | + <?= $enc->html($this->translate('mshop/code', 'status:0')); ?> |
|
84 | 84 | </option> |
85 | 85 | <option value="-1" v-bind:selected="item['text.status'] == -1" > |
86 | - <?= $enc->html( $this->translate( 'mshop/code', 'status:-1' ) ); ?> |
|
86 | + <?= $enc->html($this->translate('mshop/code', 'status:-1')); ?> |
|
87 | 87 | </option> |
88 | 88 | <option value="-2" v-bind:selected="item['text.status'] == -2" > |
89 | - <?= $enc->html( $this->translate( 'mshop/code', 'status:-2' ) ); ?> |
|
89 | + <?= $enc->html($this->translate('mshop/code', 'status:-2')); ?> |
|
90 | 90 | </option> |
91 | 91 | </select> |
92 | 92 | </div> |
@@ -95,35 +95,35 @@ discard block |
||
95 | 95 | </div> |
96 | 96 | <div class="col-xl-6"> |
97 | 97 | |
98 | - <?php if( !( $languages = $this->get( 'pageLangItems', map() ) )->count() !== 1 ) : ?> |
|
98 | + <?php if (!($languages = $this->get('pageLangItems', map()))->count() !== 1) : ?> |
|
99 | 99 | <div class="form-group row mandatory"> |
100 | - <label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'Language' ) ); ?></label> |
|
100 | + <label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'Language')); ?></label> |
|
101 | 101 | <div class="col-sm-8"> |
102 | - <select is="select-component" required class="form-control form-select item-languageid" tabindex="<?= $enc->attr( $this->get( 'tabindex' ) ); ?>" |
|
103 | - v-bind:items="JSON.parse('<?= $enc->attr( $languages->col( 'locale.language.label', 'locale.language.id' )->toArray() ) ?>')" |
|
104 | - v-bind:name="'<?= $enc->attr( $this->formparam( ['content', '_idx_', 'text.languageid'] ) ); ?>'.replace('_idx_', idx)" |
|
105 | - v-bind:text="'<?= $enc->html( $this->translate( 'admin', 'Please select' ) ); ?>'" |
|
106 | - v-bind:all="'<?= $enc->html( $this->translate( 'admin', 'All' ) ); ?>'" |
|
102 | + <select is="select-component" required class="form-control form-select item-languageid" tabindex="<?= $enc->attr($this->get('tabindex')); ?>" |
|
103 | + v-bind:items="JSON.parse('<?= $enc->attr($languages->col('locale.language.label', 'locale.language.id')->toArray()) ?>')" |
|
104 | + v-bind:name="'<?= $enc->attr($this->formparam(['content', '_idx_', 'text.languageid'])); ?>'.replace('_idx_', idx)" |
|
105 | + v-bind:text="'<?= $enc->html($this->translate('admin', 'Please select')); ?>'" |
|
106 | + v-bind:all="'<?= $enc->html($this->translate('admin', 'All')); ?>'" |
|
107 | 107 | v-bind:readonly="item['text.siteid'] != siteid" |
108 | 108 | v-model="item['text.languageid']" > |
109 | 109 | </select> |
110 | 110 | </div> |
111 | 111 | <div class="col-sm-12 form-text text-muted help-text"> |
112 | - <?= $enc->html( $this->translate( 'admin', 'Language of the entered text' ) ); ?> |
|
112 | + <?= $enc->html($this->translate('admin', 'Language of the entered text')); ?> |
|
113 | 113 | </div> |
114 | 114 | </div> |
115 | 115 | <?php else : ?> |
116 | 116 | <input class="text-langid" type="hidden" |
117 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'content', '_idx_', 'text.languageid' ) ) ); ?>'.replace('_idx_', idx)" |
|
118 | - value="<?= $enc->attr( $languages->getCode()->first() ) ?>" /> |
|
117 | + v-bind:name="'<?= $enc->attr($this->formparam(array('content', '_idx_', 'text.languageid'))); ?>'.replace('_idx_', idx)" |
|
118 | + value="<?= $enc->attr($languages->getCode()->first()) ?>" /> |
|
119 | 119 | <?php endif; ?> |
120 | 120 | |
121 | 121 | </div> |
122 | 122 | |
123 | 123 | <div class="col-xl-12"> |
124 | 124 | <grapesjs v-bind:setup="Aimeos.CMSContent.GrapesJS" |
125 | - v-bind:tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
126 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'content', '_idx_', 'text.content' ) ) ); ?>'.replace('_idx_', idx)" |
|
125 | + v-bind:tabindex="<?= $this->get('tabindex'); ?>" |
|
126 | + v-bind:name="'<?= $enc->attr($this->formparam(array('content', '_idx_', 'text.content'))); ?>'.replace('_idx_', idx)" |
|
127 | 127 | v-bind:readonly="item['text.siteid'] != siteid" |
128 | 128 | v-bind:value="item['text.content']" |
129 | 129 | v-model="item['text.content']" |
@@ -132,85 +132,85 @@ discard block |
||
132 | 132 | |
133 | 133 | <div v-on:click="toggle('_ext', idx)" class="col-xl-12 advanced" v-bind:class="{'collapsed': !item['_ext']}"> |
134 | 134 | <div class="card-tools-left"> |
135 | - <div class="btn act-show fa" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
136 | - title="<?= $enc->attr( $this->translate( 'admin', 'Show/hide advanced data' ) ); ?>"> |
|
135 | + <div class="btn act-show fa" tabindex="<?= $this->get('tabindex'); ?>" |
|
136 | + title="<?= $enc->attr($this->translate('admin', 'Show/hide advanced data')); ?>"> |
|
137 | 137 | </div> |
138 | 138 | </div> |
139 | - <span class="header-label"><?= $enc->html( $this->translate( 'admin', 'Advanced' ) ); ?></span> |
|
139 | + <span class="header-label"><?= $enc->html($this->translate('admin', 'Advanced')); ?></span> |
|
140 | 140 | </div> |
141 | 141 | |
142 | 142 | <div v-show="item['_ext']" class="col-xl-6 secondary"> |
143 | 143 | |
144 | - <?php if( !( $listTypes = $this->get( 'textListTypes', map() ) )->count() !== 1 ) : ?> |
|
144 | + <?php if (!($listTypes = $this->get('textListTypes', map()))->count() !== 1) : ?> |
|
145 | 145 | <div class="form-group row mandatory"> |
146 | - <label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'List type' ) ); ?></label> |
|
146 | + <label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'List type')); ?></label> |
|
147 | 147 | <div class="col-sm-8"> |
148 | - <select is="select-component" required class="form-control form-select listitem-type" tabindex="<?= $enc->attr( $this->get( 'tabindex' ) ); ?>" |
|
149 | - v-bind:items="JSON.parse('<?= $enc->attr( $listTypes->col( 'cms.lists.type.label', 'cms.lists.type.code' )->toArray() ) ?>')" |
|
150 | - v-bind:name="'<?= $enc->attr( $this->formparam( ['content', '_idx_', 'cms.lists.type'] ) ); ?>'.replace('_idx_', idx)" |
|
151 | - v-bind:text="'<?= $enc->html( $this->translate( 'admin', 'Please select' ) ); ?>'" |
|
148 | + <select is="select-component" required class="form-control form-select listitem-type" tabindex="<?= $enc->attr($this->get('tabindex')); ?>" |
|
149 | + v-bind:items="JSON.parse('<?= $enc->attr($listTypes->col('cms.lists.type.label', 'cms.lists.type.code')->toArray()) ?>')" |
|
150 | + v-bind:name="'<?= $enc->attr($this->formparam(['content', '_idx_', 'cms.lists.type'])); ?>'.replace('_idx_', idx)" |
|
151 | + v-bind:text="'<?= $enc->html($this->translate('admin', 'Please select')); ?>'" |
|
152 | 152 | v-bind:readonly="item['cms.lists.siteid'] != siteid" |
153 | 153 | v-model="item['cms.lists.type']" > |
154 | 154 | </select> |
155 | 155 | </div> |
156 | 156 | <div class="col-sm-12 form-text text-muted help-text"> |
157 | - <?= $enc->html( $this->translate( 'admin', 'Second level type for grouping items' ) ); ?> |
|
157 | + <?= $enc->html($this->translate('admin', 'Second level type for grouping items')); ?> |
|
158 | 158 | </div> |
159 | 159 | </div> |
160 | 160 | <?php else : ?> |
161 | 161 | <input class="listitem-type" type="hidden" |
162 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'content', '_idx_', 'cms.lists.type' ) ) ); ?>'.replace('_idx_', idx)" |
|
163 | - value="<?= $enc->attr( $listTypes->getCode()->first() ) ?>" /> |
|
162 | + v-bind:name="'<?= $enc->attr($this->formparam(array('content', '_idx_', 'cms.lists.type'))); ?>'.replace('_idx_', idx)" |
|
163 | + value="<?= $enc->attr($listTypes->getCode()->first()) ?>" /> |
|
164 | 164 | <?php endif; ?> |
165 | 165 | |
166 | 166 | <div class="form-group row optional"> |
167 | - <label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'Start date' ) ); ?></label> |
|
167 | + <label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'Start date')); ?></label> |
|
168 | 168 | <div class="col-sm-8"> |
169 | - <input is="flat-pickr" class="form-control listitem-datestart" type="datetime-local" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
170 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'content', '_idx_', 'cms.lists.datestart' ) ) ); ?>'.replace('_idx_', idx)" |
|
171 | - placeholder="<?= $enc->attr( $this->translate( 'admin', 'YYYY-MM-DD hh:mm:ss (optional)' ) ); ?>" |
|
169 | + <input is="flat-pickr" class="form-control listitem-datestart" type="datetime-local" tabindex="<?= $this->get('tabindex'); ?>" |
|
170 | + v-bind:name="'<?= $enc->attr($this->formparam(array('content', '_idx_', 'cms.lists.datestart'))); ?>'.replace('_idx_', idx)" |
|
171 | + placeholder="<?= $enc->attr($this->translate('admin', 'YYYY-MM-DD hh:mm:ss (optional)')); ?>" |
|
172 | 172 | v-bind:disabled="item['cms.lists.siteid'] != siteid" |
173 | 173 | v-bind:config="Aimeos.flatpickr.datetime" |
174 | 174 | v-model="item['cms.lists.datestart']" /> |
175 | 175 | </div> |
176 | 176 | <div class="col-sm-12 form-text text-muted help-text"> |
177 | - <?= $enc->html( $this->translate( 'admin', 'The item is only shown on the web site after that date and time' ) ); ?> |
|
177 | + <?= $enc->html($this->translate('admin', 'The item is only shown on the web site after that date and time')); ?> |
|
178 | 178 | </div> |
179 | 179 | </div> |
180 | 180 | <div class="form-group row optional"> |
181 | - <label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'End date' ) ); ?></label> |
|
181 | + <label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'End date')); ?></label> |
|
182 | 182 | <div class="col-sm-8"> |
183 | - <input is="flat-pickr" class="form-control listitem-dateend" type="datetime-local" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
184 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'content', '_idx_', 'cms.lists.dateend' ) ) ); ?>'.replace('_idx_', idx)" |
|
185 | - placeholder="<?= $enc->attr( $this->translate( 'admin', 'YYYY-MM-DD hh:mm:ss (optional)' ) ); ?>" |
|
183 | + <input is="flat-pickr" class="form-control listitem-dateend" type="datetime-local" tabindex="<?= $this->get('tabindex'); ?>" |
|
184 | + v-bind:name="'<?= $enc->attr($this->formparam(array('content', '_idx_', 'cms.lists.dateend'))); ?>'.replace('_idx_', idx)" |
|
185 | + placeholder="<?= $enc->attr($this->translate('admin', 'YYYY-MM-DD hh:mm:ss (optional)')); ?>" |
|
186 | 186 | v-bind:disabled="item['cms.lists.siteid'] != siteid" |
187 | 187 | v-bind:config="Aimeos.flatpickr.datetime" |
188 | 188 | v-model="item['cms.lists.dateend']" /> |
189 | 189 | </div> |
190 | 190 | <div class="col-sm-12 form-text text-muted help-text"> |
191 | - <?= $enc->html( $this->translate( 'admin', 'The item is only shown on the web site until that date and time' ) ); ?> |
|
191 | + <?= $enc->html($this->translate('admin', 'The item is only shown on the web site until that date and time')); ?> |
|
192 | 192 | </div> |
193 | 193 | </div> |
194 | 194 | </div> |
195 | 195 | |
196 | 196 | <div v-show="item['_ext']" class="col-xl-6 secondary" v-bind:class="{readonly: item['cms.lists.siteid'] != siteid}"> |
197 | - <config-table v-bind:tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
198 | - v-bind:keys="JSON.parse('<?= $enc->attr( $this->config( 'admin/jqadm/cms/item/content/config/suggest', [] ) ) ?>')" |
|
199 | - v-bind:name="'<?= $enc->attr( $this->formparam( ['content', '_idx_', 'config', '_pos_', '_key_'] ) ); ?>'" |
|
197 | + <config-table v-bind:tabindex="<?= $this->get('tabindex'); ?>" |
|
198 | + v-bind:keys="JSON.parse('<?= $enc->attr($this->config('admin/jqadm/cms/item/content/config/suggest', [])) ?>')" |
|
199 | + v-bind:name="'<?= $enc->attr($this->formparam(['content', '_idx_', 'config', '_pos_', '_key_'])); ?>'" |
|
200 | 200 | v-bind:index="idx" v-bind:readonly="item['cms.lists.siteid'] != siteid" |
201 | 201 | v-bind:items="item['config']" v-on:update:config="item['config'] = $event"> |
202 | 202 | </config-table> |
203 | 203 | </div> |
204 | 204 | |
205 | - <?= $this->get( 'contentBody' ); ?> |
|
205 | + <?= $this->get('contentBody'); ?> |
|
206 | 206 | |
207 | 207 | </div> |
208 | 208 | </div> |
209 | 209 | </div> |
210 | 210 | |
211 | 211 | <div slot="footer" class="card-tools-more"> |
212 | - <div class="btn btn-primary btn-card-more act-add fa" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
213 | - title="<?= $enc->attr( $this->translate( 'admin', 'Insert new entry (Ctrl+I)' ) ); ?>" |
|
212 | + <div class="btn btn-primary btn-card-more act-add fa" tabindex="<?= $this->get('tabindex'); ?>" |
|
213 | + title="<?= $enc->attr($this->translate('admin', 'Insert new entry (Ctrl+I)')); ?>" |
|
214 | 214 | v-on:click="add()" > |
215 | 215 | </div> |
216 | 216 | </div> |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | * @param string|null $name Name of the controller implementaton (default: "Standard") |
29 | 29 | * @return \Aimeos\Controller\Frontend\Cms\Iface Controller object |
30 | 30 | */ |
31 | - public static function create( \Aimeos\MShop\Context\Item\Iface $context, string $name = null ) : \Aimeos\Controller\Frontend\Iface |
|
31 | + public static function create(\Aimeos\MShop\Context\Item\Iface $context, string $name = null) : \Aimeos\Controller\Frontend\Iface |
|
32 | 32 | { |
33 | 33 | /** controller/frontend/cms/name |
34 | 34 | * Class name of the used cms frontend controller implementation |
@@ -63,18 +63,18 @@ discard block |
||
63 | 63 | * @since 2021.04 |
64 | 64 | * @category Developer |
65 | 65 | */ |
66 | - if( $name === null ) { |
|
67 | - $name = $context->getConfig()->get( 'controller/frontend/cms/name', 'Standard' ); |
|
66 | + if ($name === null) { |
|
67 | + $name = $context->getConfig()->get('controller/frontend/cms/name', 'Standard'); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | $iface = '\\Aimeos\\Controller\\Frontend\\Cms\\Iface'; |
71 | 71 | $classname = '\\Aimeos\\Controller\\Frontend\\Cms\\' . $name; |
72 | 72 | |
73 | - if( ctype_alnum( $name ) === false ) { |
|
74 | - throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
|
73 | + if (ctype_alnum($name) === false) { |
|
74 | + throw new \Aimeos\Controller\Frontend\Exception(sprintf('Invalid characters in class name "%1$s"', $classname)); |
|
75 | 75 | } |
76 | 76 | |
77 | - $manager = self::createController( $context, $classname, $iface ); |
|
77 | + $manager = self::createController($context, $classname, $iface); |
|
78 | 78 | |
79 | 79 | /** controller/frontend/cms/decorators/excludes |
80 | 80 | * Excludes decorators added by the "common" option from the cms frontend controllers |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | * @see controller/frontend/cms/decorators/excludes |
151 | 151 | * @see controller/frontend/cms/decorators/global |
152 | 152 | */ |
153 | - return self::addControllerDecorators( $context, $manager, 'cms' ); |
|
153 | + return self::addControllerDecorators($context, $manager, 'cms'); |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | } |
@@ -30,12 +30,12 @@ discard block |
||
30 | 30 | * @param \Aimeos\Controller\Frontend\Iface $controller Controller object |
31 | 31 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object with required objects |
32 | 32 | */ |
33 | - public function __construct( \Aimeos\Controller\Frontend\Iface $controller, \Aimeos\MShop\Context\Item\Iface $context ) |
|
33 | + public function __construct(\Aimeos\Controller\Frontend\Iface $controller, \Aimeos\MShop\Context\Item\Iface $context) |
|
34 | 34 | { |
35 | - parent::__construct( $context ); |
|
35 | + parent::__construct($context); |
|
36 | 36 | |
37 | 37 | $iface = \Aimeos\Controller\Frontend\Cms\Iface::class; |
38 | - $this->controller = \Aimeos\MW\Common\Base::checkClass( $iface, $controller ); |
|
38 | + $this->controller = \Aimeos\MW\Common\Base::checkClass($iface, $controller); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | |
@@ -47,9 +47,9 @@ discard block |
||
47 | 47 | * @return mixed Returns the value of the called method |
48 | 48 | * @throws \Aimeos\Controller\Frontend\Exception If method call failed |
49 | 49 | */ |
50 | - public function __call( string $name, array $param ) |
|
50 | + public function __call(string $name, array $param) |
|
51 | 51 | { |
52 | - return @call_user_func_array( array( $this->controller, $name ), $param ); |
|
52 | + return @call_user_func_array(array($this->controller, $name), $param); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | |
@@ -71,9 +71,9 @@ discard block |
||
71 | 71 | * @return \Aimeos\Controller\Frontend\Cms\Iface Cms controller for fluent interface |
72 | 72 | * @since 2019.04 |
73 | 73 | */ |
74 | - public function compare( string $operator, string $key, $value ) : \Aimeos\Controller\Frontend\Cms\Iface |
|
74 | + public function compare(string $operator, string $key, $value) : \Aimeos\Controller\Frontend\Cms\Iface |
|
75 | 75 | { |
76 | - $this->controller->compare( $operator, $key, $value ); |
|
76 | + $this->controller->compare($operator, $key, $value); |
|
77 | 77 | return $this; |
78 | 78 | } |
79 | 79 | |
@@ -85,9 +85,9 @@ discard block |
||
85 | 85 | * @return \Aimeos\MShop\Cms\Item\Iface Cms item including the referenced domains items |
86 | 86 | * @since 2019.04 |
87 | 87 | */ |
88 | - public function find( string $code ) : \Aimeos\MShop\Cms\Item\Iface |
|
88 | + public function find(string $code) : \Aimeos\MShop\Cms\Item\Iface |
|
89 | 89 | { |
90 | - return $this->controller->find( $code ); |
|
90 | + return $this->controller->find($code); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | |
@@ -98,9 +98,9 @@ discard block |
||
98 | 98 | * @param array $params List of parameters for the search function with numeric keys starting at 0 |
99 | 99 | * @return string Search function string that can be used in compare() |
100 | 100 | */ |
101 | - public function function( string $name, array $params ) : string |
|
101 | + public function function(string $name, array $params) : string |
|
102 | 102 | { |
103 | - return $this->controller->function( $name, $params ); |
|
103 | + return $this->controller->function($name, $params); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | |
@@ -111,9 +111,9 @@ discard block |
||
111 | 111 | * @return \Aimeos\MShop\Cms\Item\Iface Cms item including the referenced domains items |
112 | 112 | * @since 2019.04 |
113 | 113 | */ |
114 | - public function get( string $id ) : \Aimeos\MShop\Cms\Item\Iface |
|
114 | + public function get(string $id) : \Aimeos\MShop\Cms\Item\Iface |
|
115 | 115 | { |
116 | - return $this->controller->get( $id ); |
|
116 | + return $this->controller->get($id); |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | |
@@ -126,9 +126,9 @@ discard block |
||
126 | 126 | * @return \Aimeos\Controller\Frontend\Cms\Iface Cms controller for fluent interface |
127 | 127 | * @since 2019.10 |
128 | 128 | */ |
129 | - public function has( string $domain, string $type = null, string $refId = null ) : \Aimeos\Controller\Frontend\Cms\Iface |
|
129 | + public function has(string $domain, string $type = null, string $refId = null) : \Aimeos\Controller\Frontend\Cms\Iface |
|
130 | 130 | { |
131 | - $this->controller->has( $domain, $type, $refId ); |
|
131 | + $this->controller->has($domain, $type, $refId); |
|
132 | 132 | return $this; |
133 | 133 | } |
134 | 134 | |
@@ -140,9 +140,9 @@ discard block |
||
140 | 140 | * @return \Aimeos\Controller\Frontend\Cms\Iface Cms controller for fluent interface |
141 | 141 | * @since 2019.04 |
142 | 142 | */ |
143 | - public function parse( array $conditions ) : \Aimeos\Controller\Frontend\Cms\Iface |
|
143 | + public function parse(array $conditions) : \Aimeos\Controller\Frontend\Cms\Iface |
|
144 | 144 | { |
145 | - $this->controller->parse( $conditions ); |
|
145 | + $this->controller->parse($conditions); |
|
146 | 146 | return $this; |
147 | 147 | } |
148 | 148 | |
@@ -154,9 +154,9 @@ discard block |
||
154 | 154 | * @return \Aimeos\Map Ordered list of items implementing \Aimeos\MShop\Cms\Item\Iface |
155 | 155 | * @since 2019.04 |
156 | 156 | */ |
157 | - public function search( int &$total = null ) : \Aimeos\Map |
|
157 | + public function search(int &$total = null) : \Aimeos\Map |
|
158 | 158 | { |
159 | - return $this->controller->search( $total ); |
|
159 | + return $this->controller->search($total); |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | |
@@ -168,9 +168,9 @@ discard block |
||
168 | 168 | * @return \Aimeos\Controller\Frontend\Cms\Iface Cms controller for fluent interface |
169 | 169 | * @since 2019.04 |
170 | 170 | */ |
171 | - public function slice( int $start, int $limit ) : \Aimeos\Controller\Frontend\Cms\Iface |
|
171 | + public function slice(int $start, int $limit) : \Aimeos\Controller\Frontend\Cms\Iface |
|
172 | 172 | { |
173 | - $this->controller->slice( $start, $limit ); |
|
173 | + $this->controller->slice($start, $limit); |
|
174 | 174 | return $this; |
175 | 175 | } |
176 | 176 | |
@@ -182,9 +182,9 @@ discard block |
||
182 | 182 | * @return \Aimeos\Controller\Frontend\Cms\Iface Cms controller for fluent interface |
183 | 183 | * @since 2019.04 |
184 | 184 | */ |
185 | - public function sort( string $key = null ) : \Aimeos\Controller\Frontend\Cms\Iface |
|
185 | + public function sort(string $key = null) : \Aimeos\Controller\Frontend\Cms\Iface |
|
186 | 186 | { |
187 | - $this->controller->sort( $key ); |
|
187 | + $this->controller->sort($key); |
|
188 | 188 | return $this; |
189 | 189 | } |
190 | 190 | |
@@ -196,9 +196,9 @@ discard block |
||
196 | 196 | * @return \Aimeos\Controller\Frontend\Cms\Iface Cms controller for fluent interface |
197 | 197 | * @since 2019.04 |
198 | 198 | */ |
199 | - public function uses( array $domains ) : \Aimeos\Controller\Frontend\Cms\Iface |
|
199 | + public function uses(array $domains) : \Aimeos\Controller\Frontend\Cms\Iface |
|
200 | 200 | { |
201 | - $this->controller->uses( $domains ); |
|
201 | + $this->controller->uses($domains); |
|
202 | 202 | return $this; |
203 | 203 | } |
204 | 204 | |
@@ -209,11 +209,11 @@ discard block |
||
209 | 209 | * @param \Aimeos\Controller\Frontend\Iface $object Reference to the outmost controller or decorator |
210 | 210 | * @return \Aimeos\Controller\Frontend\Iface Controller object for chaining method calls |
211 | 211 | */ |
212 | - public function setObject( \Aimeos\Controller\Frontend\Iface $object ) : \Aimeos\Controller\Frontend\Iface |
|
212 | + public function setObject(\Aimeos\Controller\Frontend\Iface $object) : \Aimeos\Controller\Frontend\Iface |
|
213 | 213 | { |
214 | - parent::setObject( $object ); |
|
214 | + parent::setObject($object); |
|
215 | 215 | |
216 | - $this->controller->setObject( $object ); |
|
216 | + $this->controller->setObject($object); |
|
217 | 217 | |
218 | 218 | return $this; |
219 | 219 | } |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | * @return \Aimeos\Controller\Frontend\Cms\Iface Cms controller for fluent interface |
29 | 29 | * @since 2021.04 |
30 | 30 | */ |
31 | - public function compare( string $operator, string $key, $value ) : Iface; |
|
31 | + public function compare(string $operator, string $key, $value) : Iface; |
|
32 | 32 | |
33 | 33 | /** |
34 | 34 | * Returns the cms for the given cms code |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | * @return \Aimeos\MShop\Cms\Item\Iface Cms item including the referenced domains items |
39 | 39 | * @since 2021.04 |
40 | 40 | */ |
41 | - public function find( string $code ) : \Aimeos\MShop\Cms\Item\Iface; |
|
41 | + public function find(string $code) : \Aimeos\MShop\Cms\Item\Iface; |
|
42 | 42 | |
43 | 43 | /** |
44 | 44 | * Creates a search function string for the given name and parameters |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | * @param array $params List of parameters for the search function with numeric keys starting at 0 |
48 | 48 | * @return string Search function string that can be used in compare() |
49 | 49 | */ |
50 | - public function function( string $name, array $params ) : string; |
|
50 | + public function function(string $name, array $params) : string; |
|
51 | 51 | |
52 | 52 | /** |
53 | 53 | * Returns the cms for the given cms ID |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | * @return \Aimeos\MShop\Cms\Item\Iface Cms item including the referenced domains items |
58 | 58 | * @since 2021.04 |
59 | 59 | */ |
60 | - public function get( string $id ) : \Aimeos\MShop\Cms\Item\Iface; |
|
60 | + public function get(string $id) : \Aimeos\MShop\Cms\Item\Iface; |
|
61 | 61 | |
62 | 62 | /** |
63 | 63 | * Adds a filter to return only items containing a reference to the given ID |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * @return \Aimeos\Controller\Frontend\Product\Iface Product controller for fluent interface |
69 | 69 | * @since 2019.10 |
70 | 70 | */ |
71 | - public function has( string $domain, string $type = null, string $refId = null ) : Iface; |
|
71 | + public function has(string $domain, string $type = null, string $refId = null) : Iface; |
|
72 | 72 | |
73 | 73 | /** |
74 | 74 | * Parses the given array and adds the conditions to the list of conditions |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | * @return \Aimeos\Controller\Frontend\Cms\Iface Cms controller for fluent interface |
78 | 78 | * @since 2021.04 |
79 | 79 | */ |
80 | - public function parse( array $conditions ) : Iface; |
|
80 | + public function parse(array $conditions) : Iface; |
|
81 | 81 | |
82 | 82 | /** |
83 | 83 | * Returns the cmss filtered by the previously assigned conditions |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | * @return \Aimeos\Map Ordered list of items implementing \Aimeos\MShop\Cms\Item\Iface |
87 | 87 | * @since 2021.04 |
88 | 88 | */ |
89 | - public function search( int &$total = null ) : \Aimeos\Map; |
|
89 | + public function search(int &$total = null) : \Aimeos\Map; |
|
90 | 90 | |
91 | 91 | /** |
92 | 92 | * Sets the start value and the number of returned cms items for slicing the list of found cms items |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | * @return \Aimeos\Controller\Frontend\Cms\Iface Cms controller for fluent interface |
97 | 97 | * @since 2021.04 |
98 | 98 | */ |
99 | - public function slice( int $start, int $limit ) : Iface; |
|
99 | + public function slice(int $start, int $limit) : Iface; |
|
100 | 100 | |
101 | 101 | /** |
102 | 102 | * Sets the sorting of the result list |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | * @return \Aimeos\Controller\Frontend\Cms\Iface Cms controller for fluent interface |
106 | 106 | * @since 2021.04 |
107 | 107 | */ |
108 | - public function sort( string $key = null ) : Iface; |
|
108 | + public function sort(string $key = null) : Iface; |
|
109 | 109 | |
110 | 110 | /** |
111 | 111 | * Sets the referenced domains that will be fetched too when retrieving items |
@@ -114,5 +114,5 @@ discard block |
||
114 | 114 | * @return \Aimeos\Controller\Frontend\Cms\Iface Cms controller for fluent interface |
115 | 115 | * @since 2021.04 |
116 | 116 | */ |
117 | - public function uses( array $domains ) : Iface; |
|
117 | + public function uses(array $domains) : Iface; |
|
118 | 118 | } |
@@ -32,12 +32,12 @@ discard block |
||
32 | 32 | * |
33 | 33 | * @param \Aimeos\MShop\Context\Item\Iface $context Common MShop context object |
34 | 34 | */ |
35 | - public function __construct( \Aimeos\MShop\Context\Item\Iface $context ) |
|
35 | + public function __construct(\Aimeos\MShop\Context\Item\Iface $context) |
|
36 | 36 | { |
37 | - parent::__construct( $context ); |
|
37 | + parent::__construct($context); |
|
38 | 38 | |
39 | - $this->manager = \Aimeos\MShop::create( $context, 'cms' ); |
|
40 | - $this->filter = $this->manager->filter( true ); |
|
39 | + $this->manager = \Aimeos\MShop::create($context, 'cms'); |
|
40 | + $this->filter = $this->manager->filter(true); |
|
41 | 41 | $this->conditions[] = $this->filter->getConditions(); |
42 | 42 | } |
43 | 43 | |
@@ -60,9 +60,9 @@ discard block |
||
60 | 60 | * @return \Aimeos\Controller\Frontend\Cms\Iface Cms controller for fluent interface |
61 | 61 | * @since 2021.04 |
62 | 62 | */ |
63 | - public function compare( string $operator, string $key, $value ) : Iface |
|
63 | + public function compare(string $operator, string $key, $value) : Iface |
|
64 | 64 | { |
65 | - $this->conditions[] = $this->filter->compare( $operator, $key, $value ); |
|
65 | + $this->conditions[] = $this->filter->compare($operator, $key, $value); |
|
66 | 66 | return $this; |
67 | 67 | } |
68 | 68 | |
@@ -74,9 +74,9 @@ discard block |
||
74 | 74 | * @return \Aimeos\MShop\Cms\Item\Iface Cms item including the referenced domains items |
75 | 75 | * @since 2021.04 |
76 | 76 | */ |
77 | - public function find( string $code ) : \Aimeos\MShop\Cms\Item\Iface |
|
77 | + public function find(string $code) : \Aimeos\MShop\Cms\Item\Iface |
|
78 | 78 | { |
79 | - return $this->manager->find( $code, $this->domains, null, null, true ); |
|
79 | + return $this->manager->find($code, $this->domains, null, null, true); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | |
@@ -87,9 +87,9 @@ discard block |
||
87 | 87 | * @param array $params List of parameters for the search function with numeric keys starting at 0 |
88 | 88 | * @return string Search function string that can be used in compare() |
89 | 89 | */ |
90 | - public function function( string $name, array $params ) : string |
|
90 | + public function function(string $name, array $params) : string |
|
91 | 91 | { |
92 | - return $this->filter->make( $name, $params ); |
|
92 | + return $this->filter->make($name, $params); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | |
@@ -100,9 +100,9 @@ discard block |
||
100 | 100 | * @return \Aimeos\MShop\Cms\Item\Iface Cms item including the referenced domains items |
101 | 101 | * @since 2021.04 |
102 | 102 | */ |
103 | - public function get( string $id ) : \Aimeos\MShop\Cms\Item\Iface |
|
103 | + public function get(string $id) : \Aimeos\MShop\Cms\Item\Iface |
|
104 | 104 | { |
105 | - return $this->manager->get( $id, $this->domains, true ); |
|
105 | + return $this->manager->get($id, $this->domains, true); |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | |
@@ -115,14 +115,14 @@ discard block |
||
115 | 115 | * @return \Aimeos\Controller\Frontend\Cms\Iface Cms controller for fluent interface |
116 | 116 | * @since 2019.10 |
117 | 117 | */ |
118 | - public function has( string $domain, string $type = null, string $refId = null ) : Iface |
|
118 | + public function has(string $domain, string $type = null, string $refId = null) : Iface |
|
119 | 119 | { |
120 | 120 | $params = [$domain]; |
121 | 121 | !$type ?: $params[] = $type; |
122 | 122 | !$refId ?: $params[] = $refId; |
123 | 123 | |
124 | - $func = $this->filter->make( 'cms:has', $params ); |
|
125 | - $this->conditions[] = $this->filter->compare( '!=', $func, null ); |
|
124 | + $func = $this->filter->make('cms:has', $params); |
|
125 | + $this->conditions[] = $this->filter->compare('!=', $func, null); |
|
126 | 126 | return $this; |
127 | 127 | } |
128 | 128 | |
@@ -134,9 +134,9 @@ discard block |
||
134 | 134 | * @return \Aimeos\Controller\Frontend\Cms\Iface Cms controller for fluent interface |
135 | 135 | * @since 2021.04 |
136 | 136 | */ |
137 | - public function parse( array $conditions ) : Iface |
|
137 | + public function parse(array $conditions) : Iface |
|
138 | 138 | { |
139 | - if( ( $cond = $this->filter->parse( $conditions ) ) !== null ) { |
|
139 | + if (($cond = $this->filter->parse($conditions)) !== null) { |
|
140 | 140 | $this->conditions[] = $cond; |
141 | 141 | } |
142 | 142 | |
@@ -151,10 +151,10 @@ discard block |
||
151 | 151 | * @return \Aimeos\Map Ordered list of cms items implementing \Aimeos\MShop\Cms\Item\Iface |
152 | 152 | * @since 2021.04 |
153 | 153 | */ |
154 | - public function search( int &$total = null ) : \Aimeos\Map |
|
154 | + public function search(int &$total = null) : \Aimeos\Map |
|
155 | 155 | { |
156 | - $this->filter->setConditions( $this->filter->and( $this->conditions ) ); |
|
157 | - return $this->manager->search( $this->filter, $this->domains, $total ); |
|
156 | + $this->filter->setConditions($this->filter->and($this->conditions)); |
|
157 | + return $this->manager->search($this->filter, $this->domains, $total); |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | |
@@ -166,9 +166,9 @@ discard block |
||
166 | 166 | * @return \Aimeos\Controller\Frontend\Cms\Iface Cms controller for fluent interface |
167 | 167 | * @since 2021.04 |
168 | 168 | */ |
169 | - public function slice( int $start, int $limit ) : Iface |
|
169 | + public function slice(int $start, int $limit) : Iface |
|
170 | 170 | { |
171 | - $this->filter->slice( $start, $limit ); |
|
171 | + $this->filter->slice($start, $limit); |
|
172 | 172 | return $this; |
173 | 173 | } |
174 | 174 | |
@@ -180,18 +180,18 @@ discard block |
||
180 | 180 | * @return \Aimeos\Controller\Frontend\Cms\Iface Cms controller for fluent interface |
181 | 181 | * @since 2021.04 |
182 | 182 | */ |
183 | - public function sort( string $key = null ) : Iface |
|
183 | + public function sort(string $key = null) : Iface |
|
184 | 184 | { |
185 | 185 | $sort = []; |
186 | - $list = ( $key ? explode( ',', $key ) : [] ); |
|
186 | + $list = ($key ? explode(',', $key) : []); |
|
187 | 187 | |
188 | - foreach( $list as $sortkey ) |
|
188 | + foreach ($list as $sortkey) |
|
189 | 189 | { |
190 | - $direction = ( $sortkey[0] === '-' ? '-' : '+' ); |
|
191 | - $sort[] = $this->filter->sort( $direction, ltrim( $sortkey, '+-' ) ); |
|
190 | + $direction = ($sortkey[0] === '-' ? '-' : '+'); |
|
191 | + $sort[] = $this->filter->sort($direction, ltrim($sortkey, '+-')); |
|
192 | 192 | } |
193 | 193 | |
194 | - $this->filter->setSortations( $sort ); |
|
194 | + $this->filter->setSortations($sort); |
|
195 | 195 | return $this; |
196 | 196 | } |
197 | 197 | |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | * @return \Aimeos\Controller\Frontend\Cms\Iface Cms controller for fluent interface |
204 | 204 | * @since 2021.04 |
205 | 205 | */ |
206 | - public function uses( array $domains ) : Iface |
|
206 | + public function uses(array $domains) : Iface |
|
207 | 207 | { |
208 | 208 | $this->domains = $domains; |
209 | 209 | return $this; |
@@ -15,31 +15,31 @@ |
||
15 | 15 | { |
16 | 16 | $target = '\\Aimeos\\Controller\\Frontend\\Cms\\Iface'; |
17 | 17 | |
18 | - $controller = \Aimeos\Controller\Frontend\Cms\Factory::create( \TestHelperFrontend::getContext() ); |
|
19 | - $this->assertInstanceOf( $target, $controller ); |
|
18 | + $controller = \Aimeos\Controller\Frontend\Cms\Factory::create(\TestHelperFrontend::getContext()); |
|
19 | + $this->assertInstanceOf($target, $controller); |
|
20 | 20 | |
21 | - $controller = \Aimeos\Controller\Frontend\Cms\Factory::create( \TestHelperFrontend::getContext(), 'Standard' ); |
|
22 | - $this->assertInstanceOf( $target, $controller ); |
|
21 | + $controller = \Aimeos\Controller\Frontend\Cms\Factory::create(\TestHelperFrontend::getContext(), 'Standard'); |
|
22 | + $this->assertInstanceOf($target, $controller); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | |
26 | 26 | public function testCreateControllerInvalidImplementation() |
27 | 27 | { |
28 | - $this->expectException( '\\Aimeos\\MW\\Common\\Exception' ); |
|
29 | - \Aimeos\Controller\Frontend\Cms\Factory::create( \TestHelperFrontend::getContext(), 'Invalid' ); |
|
28 | + $this->expectException('\\Aimeos\\MW\\Common\\Exception'); |
|
29 | + \Aimeos\Controller\Frontend\Cms\Factory::create(\TestHelperFrontend::getContext(), 'Invalid'); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | |
33 | 33 | public function testCreateControllerInvalidName() |
34 | 34 | { |
35 | - $this->expectException( '\\Aimeos\\Controller\\Frontend\\Exception' ); |
|
36 | - \Aimeos\Controller\Frontend\Cms\Factory::create( \TestHelperFrontend::getContext(), '%^' ); |
|
35 | + $this->expectException('\\Aimeos\\Controller\\Frontend\\Exception'); |
|
36 | + \Aimeos\Controller\Frontend\Cms\Factory::create(\TestHelperFrontend::getContext(), '%^'); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | |
40 | 40 | public function testCreateControllerNotExisting() |
41 | 41 | { |
42 | - $this->expectException( '\\Aimeos\\Controller\\Frontend\\Exception' ); |
|
43 | - \Aimeos\Controller\Frontend\Cms\Factory::create( \TestHelperFrontend::getContext(), 'notexist' ); |
|
42 | + $this->expectException('\\Aimeos\\Controller\\Frontend\\Exception'); |
|
43 | + \Aimeos\Controller\Frontend\Cms\Factory::create(\TestHelperFrontend::getContext(), 'notexist'); |
|
44 | 44 | } |
45 | 45 | } |
@@ -20,145 +20,145 @@ |
||
20 | 20 | { |
21 | 21 | $this->context = \TestHelperFrontend::getContext(); |
22 | 22 | |
23 | - $this->stub = $this->getMockBuilder( \Aimeos\Controller\Frontend\Cms\Standard::class ) |
|
23 | + $this->stub = $this->getMockBuilder(\Aimeos\Controller\Frontend\Cms\Standard::class) |
|
24 | 24 | ->disableOriginalConstructor() |
25 | 25 | ->getMock(); |
26 | 26 | |
27 | - $this->object = $this->getMockBuilder( \Aimeos\Controller\Frontend\Cms\Decorator\Base::class ) |
|
28 | - ->setConstructorArgs( [$this->stub, $this->context] ) |
|
27 | + $this->object = $this->getMockBuilder(\Aimeos\Controller\Frontend\Cms\Decorator\Base::class) |
|
28 | + ->setConstructorArgs([$this->stub, $this->context]) |
|
29 | 29 | ->getMockForAbstractClass(); |
30 | 30 | } |
31 | 31 | |
32 | 32 | |
33 | 33 | protected function tearDown() : void |
34 | 34 | { |
35 | - unset( $this->context, $this->object, $this->stub ); |
|
35 | + unset($this->context, $this->object, $this->stub); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | |
39 | 39 | public function testConstructException() |
40 | 40 | { |
41 | - $stub = $this->getMockBuilder( \Aimeos\Controller\Frontend\Iface::class )->getMock(); |
|
41 | + $stub = $this->getMockBuilder(\Aimeos\Controller\Frontend\Iface::class)->getMock(); |
|
42 | 42 | |
43 | - $this->expectException( \Aimeos\MW\Common\Exception::class ); |
|
43 | + $this->expectException(\Aimeos\MW\Common\Exception::class); |
|
44 | 44 | |
45 | - $this->getMockBuilder( \Aimeos\Controller\Frontend\Cms\Decorator\Base::class ) |
|
46 | - ->setConstructorArgs( [$stub, $this->context] ) |
|
45 | + $this->getMockBuilder(\Aimeos\Controller\Frontend\Cms\Decorator\Base::class) |
|
46 | + ->setConstructorArgs([$stub, $this->context]) |
|
47 | 47 | ->getMockForAbstractClass(); |
48 | 48 | } |
49 | 49 | |
50 | 50 | |
51 | 51 | public function testCall() |
52 | 52 | { |
53 | - $stub = $this->getMockBuilder( \Aimeos\Controller\Frontend\Cms\Standard::class ) |
|
53 | + $stub = $this->getMockBuilder(\Aimeos\Controller\Frontend\Cms\Standard::class) |
|
54 | 54 | ->disableOriginalConstructor() |
55 | - ->setMethods( ['invalid'] ) |
|
55 | + ->setMethods(['invalid']) |
|
56 | 56 | ->getMock(); |
57 | 57 | |
58 | - $object = $this->getMockBuilder( \Aimeos\Controller\Frontend\Cms\Decorator\Base::class ) |
|
59 | - ->setConstructorArgs( [$stub, $this->context] ) |
|
58 | + $object = $this->getMockBuilder(\Aimeos\Controller\Frontend\Cms\Decorator\Base::class) |
|
59 | + ->setConstructorArgs([$stub, $this->context]) |
|
60 | 60 | ->getMockForAbstractClass(); |
61 | 61 | |
62 | - $stub->expects( $this->once() )->method( 'invalid' )->will( $this->returnValue( true ) ); |
|
62 | + $stub->expects($this->once())->method('invalid')->will($this->returnValue(true)); |
|
63 | 63 | |
64 | - $this->assertTrue( $object->invalid() ); |
|
64 | + $this->assertTrue($object->invalid()); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | |
68 | 68 | public function testCompare() |
69 | 69 | { |
70 | - $this->assertSame( $this->object, $this->object->compare( '==', 'cms.status', 1 ) ); |
|
70 | + $this->assertSame($this->object, $this->object->compare('==', 'cms.status', 1)); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | |
74 | 74 | public function testFind() |
75 | 75 | { |
76 | - $item = \Aimeos\MShop::create( $this->context, 'cms' )->create(); |
|
76 | + $item = \Aimeos\MShop::create($this->context, 'cms')->create(); |
|
77 | 77 | $expected = \Aimeos\MShop\Cms\Item\Iface::class; |
78 | 78 | |
79 | - $this->stub->expects( $this->once() )->method( 'find' ) |
|
80 | - ->will( $this->returnValue( $item ) ); |
|
79 | + $this->stub->expects($this->once())->method('find') |
|
80 | + ->will($this->returnValue($item)); |
|
81 | 81 | |
82 | - $this->assertInstanceOf( $expected, $this->object->find( 'test' ) ); |
|
82 | + $this->assertInstanceOf($expected, $this->object->find('test')); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | |
86 | 86 | public function testFunction() |
87 | 87 | { |
88 | - $this->stub->expects( $this->once() )->method( 'function' ) |
|
89 | - ->will( $this->returnValue( 'cms:has("domain","type","refid")' ) ); |
|
88 | + $this->stub->expects($this->once())->method('function') |
|
89 | + ->will($this->returnValue('cms:has("domain","type","refid")')); |
|
90 | 90 | |
91 | - $str = $this->object->function( 'cms:has', ['domain', 'type', 'refid'] ); |
|
92 | - $this->assertEquals( 'cms:has("domain","type","refid")', $str ); |
|
91 | + $str = $this->object->function('cms:has', ['domain', 'type', 'refid']); |
|
92 | + $this->assertEquals('cms:has("domain","type","refid")', $str); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | |
96 | 96 | public function testGet() |
97 | 97 | { |
98 | - $item = \Aimeos\MShop::create( $this->context, 'cms' )->create(); |
|
98 | + $item = \Aimeos\MShop::create($this->context, 'cms')->create(); |
|
99 | 99 | $expected = \Aimeos\MShop\Cms\Item\Iface::class; |
100 | 100 | |
101 | - $this->stub->expects( $this->once() )->method( 'get' ) |
|
102 | - ->will( $this->returnValue( $item ) ); |
|
101 | + $this->stub->expects($this->once())->method('get') |
|
102 | + ->will($this->returnValue($item)); |
|
103 | 103 | |
104 | - $this->assertInstanceOf( $expected, $this->object->get( 1 ) ); |
|
104 | + $this->assertInstanceOf($expected, $this->object->get(1)); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | |
108 | 108 | public function testHas() |
109 | 109 | { |
110 | - $this->assertSame( $this->object, $this->object->has( 'product', 'default', -1 ) ); |
|
110 | + $this->assertSame($this->object, $this->object->has('product', 'default', -1)); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | |
114 | 114 | public function testParse() |
115 | 115 | { |
116 | - $this->assertSame( $this->object, $this->object->parse( [] ) ); |
|
116 | + $this->assertSame($this->object, $this->object->parse([])); |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | |
120 | 120 | public function testSearch() |
121 | 121 | { |
122 | - $item = \Aimeos\MShop::create( $this->context, 'cms' )->create(); |
|
122 | + $item = \Aimeos\MShop::create($this->context, 'cms')->create(); |
|
123 | 123 | |
124 | - $this->stub->expects( $this->once() )->method( 'search' ) |
|
125 | - ->will( $this->returnValue( map( [$item] ) ) ); |
|
124 | + $this->stub->expects($this->once())->method('search') |
|
125 | + ->will($this->returnValue(map([$item]))); |
|
126 | 126 | |
127 | - $this->assertEquals( [$item], $this->object->search()->toArray() ); |
|
127 | + $this->assertEquals([$item], $this->object->search()->toArray()); |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | |
131 | 131 | public function testSlice() |
132 | 132 | { |
133 | - $this->assertSame( $this->object, $this->object->slice( 0, 100 ) ); |
|
133 | + $this->assertSame($this->object, $this->object->slice(0, 100)); |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | |
137 | 137 | public function testSort() |
138 | 138 | { |
139 | - $this->assertSame( $this->object, $this->object->sort( 'cms.label' ) ); |
|
139 | + $this->assertSame($this->object, $this->object->sort('cms.label')); |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | |
143 | 143 | public function testUses() |
144 | 144 | { |
145 | - $this->assertSame( $this->object, $this->object->uses( ['text'] ) ); |
|
145 | + $this->assertSame($this->object, $this->object->uses(['text'])); |
|
146 | 146 | } |
147 | 147 | |
148 | 148 | |
149 | 149 | public function testGetController() |
150 | 150 | { |
151 | - $result = $this->access( 'getController' )->invokeArgs( $this->object, [] ); |
|
151 | + $result = $this->access('getController')->invokeArgs($this->object, []); |
|
152 | 152 | |
153 | - $this->assertSame( $this->stub, $result ); |
|
153 | + $this->assertSame($this->stub, $result); |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | |
157 | - protected function access( $name ) |
|
157 | + protected function access($name) |
|
158 | 158 | { |
159 | - $class = new \ReflectionClass( \Aimeos\Controller\Frontend\Cms\Decorator\Base::class ); |
|
160 | - $method = $class->getMethod( $name ); |
|
161 | - $method->setAccessible( true ); |
|
159 | + $class = new \ReflectionClass(\Aimeos\Controller\Frontend\Cms\Decorator\Base::class); |
|
160 | + $method = $class->getMethod($name); |
|
161 | + $method->setAccessible(true); |
|
162 | 162 | |
163 | 163 | return $method; |
164 | 164 | } |
@@ -18,104 +18,104 @@ |
||
18 | 18 | protected function setUp() : void |
19 | 19 | { |
20 | 20 | $this->context = \TestHelperFrontend::getContext(); |
21 | - $this->context->getLocale()->setLanguageId( 'en' ); |
|
21 | + $this->context->getLocale()->setLanguageId('en'); |
|
22 | 22 | |
23 | - $this->object = new \Aimeos\Controller\Frontend\Cms\Standard( $this->context ); |
|
23 | + $this->object = new \Aimeos\Controller\Frontend\Cms\Standard($this->context); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | |
27 | 27 | protected function tearDown() : void |
28 | 28 | { |
29 | - unset( $this->object, $this->context ); |
|
29 | + unset($this->object, $this->context); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | |
33 | 33 | public function testCompare() |
34 | 34 | { |
35 | - $this->assertEquals( 1, count( $this->object->compare( '=~', 'cms.label', 'Con' )->search() ) ); |
|
35 | + $this->assertEquals(1, count($this->object->compare('=~', 'cms.label', 'Con')->search())); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | |
39 | 39 | public function testFind() |
40 | 40 | { |
41 | - $item = $this->object->uses( ['text'] )->find( '/contact' ); |
|
41 | + $item = $this->object->uses(['text'])->find('/contact'); |
|
42 | 42 | |
43 | - $this->assertInstanceOf( \Aimeos\MShop\Cms\Item\Iface::class, $item ); |
|
44 | - $this->assertEquals( 3, count( $item->getRefItems( 'text' ) ) ); |
|
43 | + $this->assertInstanceOf(\Aimeos\MShop\Cms\Item\Iface::class, $item); |
|
44 | + $this->assertEquals(3, count($item->getRefItems('text'))); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | |
48 | 48 | public function testFunction() |
49 | 49 | { |
50 | - $str = $this->object->function( 'cms:has', ['domain', 'type', 'refid'] ); |
|
51 | - $this->assertEquals( 'cms:has("domain","type","refid")', $str ); |
|
50 | + $str = $this->object->function('cms:has', ['domain', 'type', 'refid']); |
|
51 | + $this->assertEquals('cms:has("domain","type","refid")', $str); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | |
55 | 55 | public function testGet() |
56 | 56 | { |
57 | - $item = \Aimeos\MShop::create( $this->context, 'cms' )->find( '/contact' ); |
|
58 | - $item = $this->object->uses( ['text'] )->get( $item->getId() ); |
|
57 | + $item = \Aimeos\MShop::create($this->context, 'cms')->find('/contact'); |
|
58 | + $item = $this->object->uses(['text'])->get($item->getId()); |
|
59 | 59 | |
60 | - $this->assertInstanceOf( \Aimeos\MShop\Cms\Item\Iface::class, $item ); |
|
61 | - $this->assertEquals( 3, count( $item->getRefItems( 'text' ) ) ); |
|
60 | + $this->assertInstanceOf(\Aimeos\MShop\Cms\Item\Iface::class, $item); |
|
61 | + $this->assertEquals(3, count($item->getRefItems('text'))); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | |
65 | 65 | public function testHas() |
66 | 66 | { |
67 | - $manager = \Aimeos\MShop::create( $this->context, 'text' ); |
|
68 | - $textId = $manager->search( $manager->filter()->add( ['text.domain' => 'cms'] ) )->firstKey(); |
|
67 | + $manager = \Aimeos\MShop::create($this->context, 'text'); |
|
68 | + $textId = $manager->search($manager->filter()->add(['text.domain' => 'cms']))->firstKey(); |
|
69 | 69 | |
70 | - $this->assertEquals( 1, count( $this->object->has( 'text', 'default', $textId )->search() ) ); |
|
70 | + $this->assertEquals(1, count($this->object->has('text', 'default', $textId)->search())); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | |
74 | 74 | public function testParse() |
75 | 75 | { |
76 | 76 | $cond = ['&&' => [['==' => ['cms.status' => 1]], ['=~' => ['cms.label' => 'Con']]]]; |
77 | - $this->assertEquals( 1, count( $this->object->parse( $cond )->search() ) ); |
|
77 | + $this->assertEquals(1, count($this->object->parse($cond)->search())); |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | |
81 | 81 | public function testSearch() |
82 | 82 | { |
83 | 83 | $total = 0; |
84 | - $items = $this->object->uses( ['text'] )->compare( '=~', 'cms.url', '/con' ) |
|
85 | - ->sort( 'cms.url' )->search( $total ); |
|
84 | + $items = $this->object->uses(['text'])->compare('=~', 'cms.url', '/con') |
|
85 | + ->sort('cms.url')->search($total); |
|
86 | 86 | |
87 | - $this->assertEquals( 1, count( $items ) ); |
|
88 | - $this->assertEquals( 1, $total ); |
|
89 | - $this->assertEquals( 3, count( $items->first()->getRefItems( 'text' ) ) ); |
|
87 | + $this->assertEquals(1, count($items)); |
|
88 | + $this->assertEquals(1, $total); |
|
89 | + $this->assertEquals(3, count($items->first()->getRefItems('text'))); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | |
93 | 93 | public function testSlice() |
94 | 94 | { |
95 | - $this->assertEquals( 1, count( $this->object->slice( 0, 1 )->search() ) ); |
|
95 | + $this->assertEquals(1, count($this->object->slice(0, 1)->search())); |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | |
99 | 99 | public function testSort() |
100 | 100 | { |
101 | - $this->assertGreaterThanOrEqual( 1, count( $this->object->sort()->search() ) ); |
|
101 | + $this->assertGreaterThanOrEqual(1, count($this->object->sort()->search())); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | |
105 | 105 | public function testSortGeneric() |
106 | 106 | { |
107 | - $this->assertGreaterThanOrEqual( 1, count( $this->object->sort( 'cms.label' )->search() ) ); |
|
107 | + $this->assertGreaterThanOrEqual(1, count($this->object->sort('cms.label')->search())); |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | |
111 | 111 | public function testSortMultiple() |
112 | 112 | { |
113 | - $this->assertGreaterThanOrEqual( 1, count( $this->object->sort( 'cms.label,-cms.id' )->search() ) ); |
|
113 | + $this->assertGreaterThanOrEqual(1, count($this->object->sort('cms.label,-cms.id')->search())); |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | |
117 | 117 | public function testUses() |
118 | 118 | { |
119 | - $this->assertSame( $this->object, $this->object->uses( ['text'] ) ); |
|
119 | + $this->assertSame($this->object, $this->object->uses(['text'])); |
|
120 | 120 | } |
121 | 121 | } |
@@ -30,10 +30,10 @@ discard block |
||
30 | 30 | * @return \Aimeos\Client\JsonApi\Iface JSON API client |
31 | 31 | * @throws \Aimeos\Client\JsonApi\Exception If requested client implementation couldn't be found or initialisation fails |
32 | 32 | */ |
33 | - public static function create( \Aimeos\MShop\Context\Item\Iface $context, string $path, string $name = null ) : \Aimeos\Client\JsonApi\Iface |
|
33 | + public static function create(\Aimeos\MShop\Context\Item\Iface $context, string $path, string $name = null) : \Aimeos\Client\JsonApi\Iface |
|
34 | 34 | { |
35 | - if( ctype_alnum( $path ) === false ) { |
|
36 | - throw new \Aimeos\Client\JsonApi\Exception( sprintf( 'Invalid client "%1$s"', $path ), 400 ); |
|
35 | + if (ctype_alnum($path) === false) { |
|
36 | + throw new \Aimeos\Client\JsonApi\Exception(sprintf('Invalid client "%1$s"', $path), 400); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | /** client/jsonapi/cms/name |
@@ -69,18 +69,18 @@ discard block |
||
69 | 69 | * @since 2017.03 |
70 | 70 | * @category Developer |
71 | 71 | */ |
72 | - if( $name === null ) { |
|
73 | - $name = $context->getConfig()->get( 'client/jsonapi/cms/name', 'Standard' ); |
|
72 | + if ($name === null) { |
|
73 | + $name = $context->getConfig()->get('client/jsonapi/cms/name', 'Standard'); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | $iface = '\\Aimeos\\Client\\JsonApi\\Iface'; |
77 | 77 | $classname = '\\Aimeos\\Client\\JsonApi\\Cms\\' . $name; |
78 | 78 | |
79 | - if( ctype_alnum( $name ) === false ) { |
|
80 | - throw new \Aimeos\Client\JsonApi\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
|
79 | + if (ctype_alnum($name) === false) { |
|
80 | + throw new \Aimeos\Client\JsonApi\Exception(sprintf('Invalid characters in class name "%1$s"', $classname)); |
|
81 | 81 | } |
82 | 82 | |
83 | - $client = self::createClient( $classname, $iface, $context, $path ); |
|
83 | + $client = self::createClient($classname, $iface, $context, $path); |
|
84 | 84 | |
85 | 85 | |
86 | 86 | /** client/jsonapi/cms/decorators/excludes |
@@ -161,8 +161,8 @@ discard block |
||
161 | 161 | * @see client/jsonapi/cms/decorators/global |
162 | 162 | */ |
163 | 163 | |
164 | - $client = self::addClientDecorators( $client, $context, $path ); |
|
164 | + $client = self::addClientDecorators($client, $context, $path); |
|
165 | 165 | |
166 | - return $client->setView( $context->getView() ); |
|
166 | + return $client->setView($context->getView()); |
|
167 | 167 | } |
168 | 168 | } |