Skip to content

Commit

Permalink
Removed some PHP 8 type parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
condor2 committed Aug 13, 2024
1 parent c1c5071 commit 1d0f24a
Show file tree
Hide file tree
Showing 232 changed files with 1,848 additions and 1,837 deletions.
64 changes: 32 additions & 32 deletions upload/admin/controller/catalog/attribute.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
class ControllerCatalogAttribute extends Controller {
private $error = [];
private $error = array();

public function index(): void {
public function index() {
$this->load->language('catalog/attribute');

$this->document->setTitle($this->language->get('heading_title'));
Expand All @@ -12,7 +12,7 @@ public function index(): void {
$this->getList();
}

public function add(): void {
public function add() {
$this->load->language('catalog/attribute');

$this->document->setTitle($this->language->get('heading_title'));
Expand Down Expand Up @@ -44,7 +44,7 @@ public function add(): void {
$this->getForm();
}

public function edit(): void {
public function edit() {
$this->load->language('catalog/attribute');

$this->document->setTitle($this->language->get('heading_title'));
Expand Down Expand Up @@ -76,7 +76,7 @@ public function edit(): void {
$this->getForm();
}

public function delete(): void {
public function delete() {
$this->load->language('catalog/attribute');

$this->document->setTitle($this->language->get('heading_title'));
Expand Down Expand Up @@ -110,7 +110,7 @@ public function delete(): void {
$this->getList();
}

protected function getList(): void {
protected function getList() {
if (isset($this->request->get['sort'])) {
$sort = $this->request->get['sort'];
} else {
Expand Down Expand Up @@ -143,42 +143,42 @@ protected function getList(): void {
$url .= '&page=' . $this->request->get['page'];
}

$data['breadcrumbs'] = [];
$data['breadcrumbs'] = array();

$data['breadcrumbs'][] = [
$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_home'),
'href' => $this->url->link('common/dashboard', 'token=' . $this->session->data['token'], true)
];
);

$data['breadcrumbs'][] = [
$data['breadcrumbs'][] = array(
'text' => $this->language->get('heading_title'),
'href' => $this->url->link('catalog/attribute', 'token=' . $this->session->data['token'] . $url, true)
];
);

$data['add'] = $this->url->link('catalog/attribute/add', 'token=' . $this->session->data['token'] . $url, true);
$data['delete'] = $this->url->link('catalog/attribute/delete', 'token=' . $this->session->data['token'] . $url, true);

$data['attributes'] = [];
$data['attributes'] = array();

$filter_data = [
$filter_data = array(
'sort' => $sort,
'order' => $order,
'start' => ($page - 1) * $this->config->get('config_limit_admin'),
'limit' => $this->config->get('config_limit_admin')
];
);

$attribute_total = $this->model_catalog_attribute->getTotalAttributes();

$results = $this->model_catalog_attribute->getAttributes($filter_data);

foreach ($results as $result) {
$data['attributes'][] = [
$data['attributes'][] = array(
'attribute_id' => $result['attribute_id'],
'name' => $result['name'],
'attribute_group' => $result['attribute_group'],
'sort_order' => $result['sort_order'],
'edit' => $this->url->link('catalog/attribute/edit', 'token=' . $this->session->data['token'] . '&attribute_id=' . $result['attribute_id'] . $url, true)
];
);
}

$data['heading_title'] = $this->language->get('heading_title');
Expand Down Expand Up @@ -213,7 +213,7 @@ protected function getList(): void {
if (isset($this->request->post['selected'])) {
$data['selected'] = (array)$this->request->post['selected'];
} else {
$data['selected'] = [];
$data['selected'] = array();
}

$url = '';
Expand Down Expand Up @@ -262,7 +262,7 @@ protected function getList(): void {
$this->response->setOutput($this->load->view('catalog/attribute_list', $data));
}

protected function getForm(): void {
protected function getForm() {
$data['heading_title'] = $this->language->get('heading_title');

$data['text_form'] = !isset($this->request->get['attribute_id']) ? $this->language->get('text_add') : $this->language->get('text_edit');
Expand All @@ -283,7 +283,7 @@ protected function getForm(): void {
if (isset($this->error['name'])) {
$data['error_name'] = $this->error['name'];
} else {
$data['error_name'] = [];
$data['error_name'] = array();
}

if (isset($this->error['attribute_group'])) {
Expand All @@ -306,17 +306,17 @@ protected function getForm(): void {
$url .= '&page=' . $this->request->get['page'];
}

$data['breadcrumbs'] = [];
$data['breadcrumbs'] = array();

$data['breadcrumbs'][] = [
$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_home'),
'href' => $this->url->link('common/dashboard', 'token=' . $this->session->data['token'], true)
];
);

$data['breadcrumbs'][] = [
$data['breadcrumbs'][] = array(
'text' => $this->language->get('heading_title'),
'href' => $this->url->link('catalog/attribute', 'token=' . $this->session->data['token'] . $url, true)
];
);

if (!isset($this->request->get['attribute_id'])) {
$data['action'] = $this->url->link('catalog/attribute/add', 'token=' . $this->session->data['token'] . $url, true);
Expand All @@ -339,7 +339,7 @@ protected function getForm(): void {
} elseif (isset($this->request->get['attribute_id'])) {
$data['attribute_description'] = $this->model_catalog_attribute->getAttributeDescriptions($this->request->get['attribute_id']);
} else {
$data['attribute_description'] = [];
$data['attribute_description'] = array();
}

if (isset($this->request->post['attribute_group_id'])) {
Expand Down Expand Up @@ -409,30 +409,30 @@ protected function validateDelete() {
return !$this->error;
}

public function autocomplete(): void {
$json = [];
public function autocomplete() {
$json = array();

if (isset($this->request->get['filter_name'])) {
$this->load->model('catalog/attribute');

$filter_data = [
$filter_data = array(
'filter_name' => $this->request->get['filter_name'],
'start' => 0,
'limit' => 5
];
);

$results = $this->model_catalog_attribute->getAttributes($filter_data);

foreach ($results as $result) {
$json[] = [
$json[] = array(
'attribute_id' => $result['attribute_id'],
'name' => strip_tags(html_entity_decode($result['name'], ENT_QUOTES, 'UTF-8')),
'attribute_group' => $result['attribute_group']
];
);
}
}

$sort_order = [];
$sort_order = array();

foreach ($json as $key => $value) {
$sort_order[$key] = $value['name'];
Expand Down
50 changes: 25 additions & 25 deletions upload/admin/controller/catalog/attribute_group.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
class ControllerCatalogAttributeGroup extends Controller {
private $error = [];
private $error = array();

public function index(): void {
public function index() {
$this->load->language('catalog/attribute_group');

$this->document->setTitle($this->language->get('heading_title'));
Expand All @@ -12,7 +12,7 @@ public function index(): void {
$this->getList();
}

public function add(): void {
public function add() {
$this->load->language('catalog/attribute_group');

$this->document->setTitle($this->language->get('heading_title'));
Expand Down Expand Up @@ -44,7 +44,7 @@ public function add(): void {
$this->getForm();
}

public function edit(): void {
public function edit() {
$this->load->language('catalog/attribute_group');

$this->document->setTitle($this->language->get('heading_title'));
Expand Down Expand Up @@ -76,7 +76,7 @@ public function edit(): void {
$this->getForm();
}

public function delete(): void {
public function delete() {
$this->load->language('catalog/attribute_group');

$this->document->setTitle($this->language->get('heading_title'));
Expand Down Expand Up @@ -110,7 +110,7 @@ public function delete(): void {
$this->getList();
}

protected function getList(): void {
protected function getList() {
if (isset($this->request->get['sort'])) {
$sort = $this->request->get['sort'];
} else {
Expand Down Expand Up @@ -143,41 +143,41 @@ protected function getList(): void {
$url .= '&page=' . $this->request->get['page'];
}

$data['breadcrumbs'] = [];
$data['breadcrumbs'] = array();

$data['breadcrumbs'][] = [
$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_home'),
'href' => $this->url->link('common/dashboard', 'token=' . $this->session->data['token'], true)
];
);

$data['breadcrumbs'][] = [
$data['breadcrumbs'][] = array(
'text' => $this->language->get('heading_title'),
'href' => $this->url->link('catalog/attribute_group', 'token=' . $this->session->data['token'] . $url, true)
];
);

$data['add'] = $this->url->link('catalog/attribute_group/add', 'token=' . $this->session->data['token'] . $url, true);
$data['delete'] = $this->url->link('catalog/attribute_group/delete', 'token=' . $this->session->data['token'] . $url, true);

$data['attribute_groups'] = [];
$data['attribute_groups'] = array();

$filter_data = [
$filter_data = array(
'sort' => $sort,
'order' => $order,
'start' => ($page - 1) * $this->config->get('config_limit_admin'),
'limit' => $this->config->get('config_limit_admin')
];
);

$attribute_group_total = $this->model_catalog_attribute_group->getTotalAttributeGroups();

$results = $this->model_catalog_attribute_group->getAttributeGroups($filter_data);

foreach ($results as $result) {
$data['attribute_groups'][] = [
$data['attribute_groups'][] = array(
'attribute_group_id' => $result['attribute_group_id'],
'name' => $result['name'],
'sort_order' => $result['sort_order'],
'edit' => $this->url->link('catalog/attribute_group/edit', 'token=' . $this->session->data['token'] . '&attribute_group_id=' . $result['attribute_group_id'] . $url, true)
];
);
}

$data['heading_title'] = $this->language->get('heading_title');
Expand Down Expand Up @@ -211,7 +211,7 @@ protected function getList(): void {
if (isset($this->request->post['selected'])) {
$data['selected'] = (array)$this->request->post['selected'];
} else {
$data['selected'] = [];
$data['selected'] = array();
}

$url = '';
Expand Down Expand Up @@ -259,7 +259,7 @@ protected function getList(): void {
$this->response->setOutput($this->load->view('catalog/attribute_group_list', $data));
}

protected function getForm(): void {
protected function getForm() {
$data['heading_title'] = $this->language->get('heading_title');

$data['text_form'] = !isset($this->request->get['attribute_group_id']) ? $this->language->get('text_add') : $this->language->get('text_edit');
Expand All @@ -279,7 +279,7 @@ protected function getForm(): void {
if (isset($this->error['name'])) {
$data['error_name'] = $this->error['name'];
} else {
$data['error_name'] = [];
$data['error_name'] = array();
}

$url = '';
Expand All @@ -296,17 +296,17 @@ protected function getForm(): void {
$url .= '&page=' . $this->request->get['page'];
}

$data['breadcrumbs'] = [];
$data['breadcrumbs'] = array();

$data['breadcrumbs'][] = [
$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_home'),
'href' => $this->url->link('common/dashboard', 'token=' . $this->session->data['token'], true)
];
);

$data['breadcrumbs'][] = [
$data['breadcrumbs'][] = array(
'text' => $this->language->get('heading_title'),
'href' => $this->url->link('catalog/attribute_group', 'token=' . $this->session->data['token'] . $url, true)
];
);

if (!isset($this->request->get['attribute_group_id'])) {
$data['action'] = $this->url->link('catalog/attribute_group/add', 'token=' . $this->session->data['token'] . $url, true);
Expand All @@ -329,7 +329,7 @@ protected function getForm(): void {
} elseif (!empty($attribute_group_info)) {
$data['attribute_group_description'] = $this->model_catalog_attribute_group->getAttributeGroupDescriptions($this->request->get['attribute_group_id']);
} else {
$data['attribute_group_description'] = [];
$data['attribute_group_description'] = array();
}

if (isset($this->request->post['sort_order'])) {
Expand Down
Loading

0 comments on commit 1d0f24a

Please sign in to comment.