Skip to content

Commit b3cb807

Browse files
authored
Merge pull request #82 from mageplaza/2.4-develop
Clean code
2 parents ae6cba8 + 6ffaa20 commit b3cb807

38 files changed

+448
-449
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+34-34
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
1-
---
2-
name: Bug report
3-
about: Technical issue with the extension
4-
labels: 'Issue'
5-
6-
---
7-
8-
<!---
9-
Fields marked with (*) are required. Please don't remove the template.
10-
-->
11-
12-
### Preconditions (*)
13-
<!---
14-
Provide the exact Magento version (example: 2.4.0) and any important information on the environment where bug is reproducible.
15-
-->
16-
1.
17-
2.
18-
19-
### Steps to reproduce (*)
20-
<!---
21-
Important: Provide a set of clear steps to reproduce this bug. We can not provide support without clear instructions on how to reproduce.
22-
-->
23-
1.
24-
2.
25-
26-
### Expected result (*)
27-
<!--- Tell us what do you expect to happen. -->
28-
1. [Screenshots, logs or description]
29-
2.
30-
31-
### Actual result (*)
32-
<!--- Tell us what happened instead. Include error messages and issues. -->
33-
1. [Screenshots, logs or description]
34-
2.
1+
---
2+
name: Bug report
3+
about: Technical issue with the extension
4+
labels: 'Issue'
5+
6+
---
7+
8+
<!---
9+
Fields marked with (*) are required. Please don't remove the template.
10+
-->
11+
12+
### Preconditions (*)
13+
<!---
14+
Provide the exact Magento version (example: 2.4.0) and any important information on the environment where bug is reproducible.
15+
-->
16+
1.
17+
2.
18+
19+
### Steps to reproduce (*)
20+
<!---
21+
Important: Provide a set of clear steps to reproduce this bug. We can not provide support without clear instructions on how to reproduce.
22+
-->
23+
1.
24+
2.
25+
26+
### Expected result (*)
27+
<!--- Tell us what do you expect to happen. -->
28+
1. [Screenshots, logs or description]
29+
2.
30+
31+
### Actual result (*)
32+
<!--- Tell us what happened instead. Include error messages and issues. -->
33+
1. [Screenshots, logs or description]
34+
2.
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
---
2-
name: Developer experience issue
3-
about: Issues related to customization, extensibility, modularity
4-
labels: 'Experience'
5-
6-
---
7-
8-
<!---
9-
Fields marked with (*) are required. Please don't remove the template.
10-
-->
11-
12-
### Summary (*)
13-
<!--- Describe the issue you are experiencing. Include general information, error messages, environments, and so on. -->
14-
15-
### Examples (*)
16-
<!--- Provide code examples or a patch with a test (recommended) to clearly indicate the problem. -->
17-
18-
### Proposed solution
19-
<!--- Suggest your potential solutions for this issue. -->
1+
---
2+
name: Developer experience issue
3+
about: Issues related to customization, extensibility, modularity
4+
labels: 'Experience'
5+
6+
---
7+
8+
<!---
9+
Fields marked with (*) are required. Please don't remove the template.
10+
-->
11+
12+
### Summary (*)
13+
<!--- Describe the issue you are experiencing. Include general information, error messages, environments, and so on. -->
14+
15+
### Examples (*)
16+
<!--- Provide code examples or a patch with a test (recommended) to clearly indicate the problem. -->
17+
18+
### Proposed solution
19+
<!--- Suggest your potential solutions for this issue. -->
+22-22
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
---
2-
name: Feature request
3-
about: Request feature for development
4-
labels: 'Feature Request'
5-
6-
---
7-
8-
<!---
9-
Fields marked with (*) are required. Please don't remove the template.
10-
-->
11-
12-
### Description (*)
13-
<!--- Describe the feature you would like to add. -->
14-
15-
### Expected behavior (*)
16-
<!--- What is the expected behavior of this feature? How is it going to work? -->
17-
18-
### Benefits
19-
<!--- How do you think this feature would improve the extension? -->
20-
21-
### Additional information
22-
<!--- What other information can you provide about the desired feature? -->
1+
---
2+
name: Feature request
3+
about: Request feature for development
4+
labels: 'Feature Request'
5+
6+
---
7+
8+
<!---
9+
Fields marked with (*) are required. Please don't remove the template.
10+
-->
11+
12+
### Description (*)
13+
<!--- Describe the feature you would like to add. -->
14+
15+
### Expected behavior (*)
16+
<!--- What is the expected behavior of this feature? How is it going to work? -->
17+
18+
### Benefits
19+
<!--- How do you think this feature would improve the extension? -->
20+
21+
### Additional information
22+
<!--- What other information can you provide about the desired feature? -->

Block/AbstractSlider.php

+8-8
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,10 @@ public function __construct(
104104
) {
105105
$this->_productCollectionFactory = $productCollectionFactory;
106106
$this->_catalogProductVisibility = $catalogProductVisibility;
107-
$this->_date = $dateTime;
108-
$this->_helperData = $helperData;
109-
$this->httpContext = $httpContext;
110-
$this->urlEncoder = $urlEncoder;
107+
$this->_date = $dateTime;
108+
$this->_helperData = $helperData;
109+
$this->httpContext = $httpContext;
110+
$this->urlEncoder = $urlEncoder;
111111

112112
parent::__construct($context, $data);
113113
}
@@ -121,7 +121,7 @@ protected function _construct()
121121

122122
$this->addData([
123123
'cache_lifetime' => $this->getSlider() ? $this->getSlider()->getTimeCache() : 86400,
124-
'cache_tags' => [Product::CACHE_TAG]
124+
'cache_tags' => [Product::CACHE_TAG]
125125
]);
126126

127127
$this->setTemplate('Mageplaza_Productslider::productslider.phtml');
@@ -200,8 +200,8 @@ public function getAddToCartPostParams(Product $product)
200200

201201
return [
202202
'action' => $url,
203-
'data' => [
204-
'product' => $product->getEntityId(),
203+
'data' => [
204+
'product' => $product->getEntityId(),
205205
ActionInterface::PARAM_NAME_URL_ENCODED => $this->urlEncoder->encode($url),
206206
]
207207
];
@@ -341,7 +341,7 @@ public function getDescription()
341341
public function getAllOptions()
342342
{
343343
$sliderOptions = '';
344-
$allConfig = $this->_helperData->getModuleConfig('slider_design');
344+
$allConfig = $this->_helperData->getModuleConfig('slider_design');
345345

346346
foreach ($allConfig as $key => $value) {
347347
if ($key === 'item_slider') {

Block/Adminhtml/Config/Field/Responsive.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ protected function _prepareToRender()
3737
$this->addColumn('size', ['label' => __('Screen size max'), 'renderer' => false, 'class' => 'validate-digits']);
3838
$this->addColumn('items', ['label' => __('Number of items'), 'renderer' => false, 'class' => 'validate-digits']);
3939

40-
$this->_addAfter = false;
40+
$this->_addAfter = false;
4141
$this->_addButtonLabel = __('Add');
4242
}
4343
}

Block/Adminhtml/Slider.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ class Slider extends Container
3636
*/
3737
protected function _construct()
3838
{
39-
$this->_controller = 'adminhtml_slider';
40-
$this->_blockGroup = 'Mageplaza_Productslider';
41-
$this->_headerText = __('Sliders');
39+
$this->_controller = 'adminhtml_slider';
40+
$this->_blockGroup = 'Mageplaza_Productslider';
41+
$this->_headerText = __('Sliders');
4242
$this->_addButtonLabel = __('Create New Slider');
4343
parent::_construct();
4444
}

Block/Adminhtml/Slider/Edit.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public function getSlider()
8787
*/
8888
protected function _construct()
8989
{
90-
$this->_objectId = 'id';
90+
$this->_objectId = 'id';
9191
$this->_blockGroup = 'Mageplaza_Productslider';
9292
$this->_controller = 'adminhtml_slider';
9393

@@ -96,12 +96,12 @@ protected function _construct()
9696
$this->buttonList->add(
9797
'save-and-continue',
9898
[
99-
'label' => __('Save and Continue Edit'),
100-
'class' => 'save',
99+
'label' => __('Save and Continue Edit'),
100+
'class' => 'save',
101101
'data_attribute' => [
102102
'mage-init' => [
103103
'button' => [
104-
'event' => 'saveAndContinueEdit',
104+
'event' => 'saveAndContinueEdit',
105105
'target' => '#edit_form'
106106
]
107107
]

Block/Adminhtml/Slider/Edit/Form.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ protected function _prepareForm()
4040
$form = $this->_formFactory->create(
4141
[
4242
'data' => [
43-
'id' => 'edit_form',
44-
'action' => $this->getUrl('*/*/save', ['id' => $this->getRequest()->getParam('id')]),
45-
'method' => 'post',
43+
'id' => 'edit_form',
44+
'action' => $this->getUrl('*/*/save', ['id' => $this->getRequest()->getParam('id')]),
45+
'method' => 'post',
4646
'enctype' => 'multipart/form-data'
4747
]
4848
]

Block/Adminhtml/Slider/Edit/Tab/Design.php

+13-13
Original file line numberDiff line numberDiff line change
@@ -93,39 +93,39 @@ protected function _prepareForm()
9393
'base_fieldset',
9494
[
9595
'legend' => __('Design'),
96-
'class' => 'fieldset-wide'
96+
'class' => 'fieldset-wide'
9797
]
9898
);
9999

100100
$fieldset->addField('title', 'text', [
101-
'name' => 'title',
101+
'name' => 'title',
102102
'label' => __('Title'),
103103
'title' => __('Title'),
104104
]);
105105
$fieldset->addField('description', 'textarea', [
106-
'name' => 'description',
106+
'name' => 'description',
107107
'label' => __('Description'),
108108
'title' => __('Description'),
109109
]);
110110
$fieldset->addField('limit_number', 'text', [
111-
'name' => 'limit_number',
111+
'name' => 'limit_number',
112112
'label' => __('Limit the number of products'),
113113
'title' => __('Limit the number of products'),
114114
'class' => 'validate-digits'
115115
]);
116116

117117
$fieldset->addField('display_additional', 'multiselect', [
118-
'name' => 'display_additional',
119-
'label' => __('Display additional information'),
120-
'title' => __('Display additional information'),
118+
'name' => 'display_additional',
119+
'label' => __('Display additional information'),
120+
'title' => __('Display additional information'),
121121
'values' => $this->_additional->toOptionArray(),
122-
'note' => __('Select information or button(s) to display with products.')
122+
'note' => __('Select information or button(s) to display with products.')
123123
]);
124124

125125
$isResponsive = $fieldset->addField('is_responsive', 'select', [
126-
'name' => 'is_responsive',
127-
'label' => __('Is Responsive'),
128-
'title' => __('Is Responsive'),
126+
'name' => 'is_responsive',
127+
'label' => __('Is Responsive'),
128+
'title' => __('Is Responsive'),
129129
'options' => [
130130
'1' => __('Yes'),
131131
'0' => __('No'),
@@ -137,10 +137,10 @@ protected function _prepareForm()
137137
'responsive_items',
138138
'Mageplaza\Productslider\Block\Adminhtml\Slider\Edit\Tab\Renderer\Responsive',
139139
[
140-
'name' => 'responsive_items',
140+
'name' => 'responsive_items',
141141
'label' => __('Max Items slider'),
142142
'title' => __('Max Items slider'),
143-
'note' => __('Default: 3 items.')
143+
'note' => __('Default: 3 items.')
144144
]
145145
);
146146

0 commit comments

Comments
 (0)