Skip to content

Commit bd6a27b

Browse files
committed
copilot suggestions
1 parent a1d8a4a commit bd6a27b

File tree

6 files changed

+35
-40
lines changed

6 files changed

+35
-40
lines changed

app/code/core/Mage/Adminhtml/Block/System/Email/Template/Edit/Form.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,11 @@ class Mage_Adminhtml_Block_System_Email_Template_Edit_Form extends Mage_Adminhtm
2323
protected function _prepareLayout()
2424
{
2525
$head = $this->getLayout()->getBlockAdminhtmlHead();
26-
if ($head) {
27-
$head->addItem('js', 'prototype/window.js');
28-
$head->addItem('js_css', 'prototype/windows/themes/default.css');
29-
$head->addCss('lib/prototype/windows/themes/magento.css');
30-
$head->addItem('js', 'mage/adminhtml/variables.js');
31-
}
26+
$head
27+
?->addItem('js', 'prototype/window.js')
28+
->addItem('js_css', 'prototype/windows/themes/default.css')
29+
->addCss('lib/prototype/windows/themes/magento.css')
30+
->addItem('js', 'mage/adminhtml/variables.js');
3231

3332
return parent::_prepareLayout();
3433
}

app/code/core/Mage/Catalog/controllers/CategoryController.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,8 @@ public function viewAction()
150150
}
151151

152152
$root = $this->getLayout()->getBlockRoot();
153-
if ($root) {
154-
$root->addBodyClass('categorypath-' . $category->getUrlPath());
155-
$root->addBodyClass('category-' . $category->getUrlKey());
156-
}
153+
$root?->addBodyClass('categorypath-' . $category->getUrlPath())
154+
->addBodyClass('category-' . $category->getUrlKey());
157155

158156
$this->_initLayoutMessages('catalog/session');
159157
$this->_initLayoutMessages('checkout/session');

app/code/core/Mage/CatalogSearch/Block/Advanced/Form.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,15 @@ class Mage_CatalogSearch_Block_Advanced_Form extends Mage_Core_Block_Template
2020
public function _prepareLayout()
2121
{
2222
$breadcrumbs = $this->getLayout()->getBlockBreadcrumbs();
23-
if ($breadcrumbs) {
24-
$breadcrumbs->addCrumb('home', [
23+
$breadcrumbs
24+
?->addCrumb('home', [
2525
'label' => Mage::helper('catalogsearch')->__('Home'),
2626
'title' => Mage::helper('catalogsearch')->__('Go to Home Page'),
2727
'link' => Mage::getBaseUrl(),
28-
]);
29-
$breadcrumbs->addCrumb('search', [
28+
])
29+
->addCrumb('search', [
3030
'label' => Mage::helper('catalogsearch')->__('Catalog Advanced Search'),
3131
]);
32-
}
3332

3433
return parent::_prepareLayout();
3534
}

app/code/core/Mage/CatalogSearch/Block/Advanced/Result.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,19 @@ class Mage_CatalogSearch_Block_Advanced_Result extends Mage_Core_Block_Template
2222
protected function _prepareLayout()
2323
{
2424
$breadcrumbs = $this->getLayout()->getBlockBreadcrumbs();
25-
if ($breadcrumbs) {
26-
$breadcrumbs->addCrumb('home', [
25+
$breadcrumbs
26+
?->addCrumb('home', [
2727
'label' => Mage::helper('catalogsearch')->__('Home'),
2828
'title' => Mage::helper('catalogsearch')->__('Go to Home Page'),
2929
'link' => Mage::getBaseUrl(),
30-
]);
31-
$breadcrumbs->addCrumb('search', [
30+
])
31+
->addCrumb('search', [
3232
'label' => Mage::helper('catalogsearch')->__('Catalog Advanced Search'),
3333
'link' => $this->getUrl('*/*/'),
34-
]);
35-
$breadcrumbs->addCrumb('search_result', [
34+
])
35+
->addCrumb('search_result', [
3636
'label' => Mage::helper('catalogsearch')->__('Results'),
3737
]);
38-
}
3938

4039
return parent::_prepareLayout();
4140
}

app/code/core/Mage/CatalogSearch/Block/Result.php

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,16 @@ protected function _prepareLayout()
5050
if ($breadcrumbs) {
5151
$title = $this->__("Search results for: '%s'", $helper->getQueryText());
5252

53-
$breadcrumbs->addCrumb('home', [
54-
'label' => $this->__('Home'),
55-
'title' => $this->__('Go to Home Page'),
56-
'link' => Mage::getBaseUrl(),
57-
]);
58-
$breadcrumbs->addCrumb('search', [
59-
'label' => $title,
60-
'title' => $title,
61-
]);
53+
$breadcrumbs
54+
->addCrumb('home', [
55+
'label' => $this->__('Home'),
56+
'title' => $this->__('Go to Home Page'),
57+
'link' => Mage::getBaseUrl(),
58+
])
59+
->addCrumb('search', [
60+
'label' => $title,
61+
'title' => $title,
62+
]);
6263
}
6364

6465
// modify page title

app/code/core/Mage/Review/controllers/ProductController.php

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -224,16 +224,15 @@ public function listAction()
224224
$this->_initProductLayout($product);
225225

226226
$breadcrumbs = $this->getLayout()->getBlockBreadcrumbs();
227-
if ($breadcrumbs) {
228-
$breadcrumbs->addCrumb('product', [
229-
'label' => $product->getName(),
230-
'link' => $product->getProductUrl(),
231-
'readonly' => true,
227+
$breadcrumbs
228+
?->addCrumb('product', [
229+
'label' => $product->getName(),
230+
'link' => $product->getProductUrl(),
231+
'readonly' => true,
232+
])
233+
->addCrumb('reviews', [
234+
'label' => Mage::helper('review')->__('Product Reviews'),
232235
]);
233-
$breadcrumbs->addCrumb('reviews', [
234-
'label' => Mage::helper('review')->__('Product Reviews'),
235-
]);
236-
}
237236

238237
$this->renderLayout();
239238
} elseif (!$this->getResponse()->isRedirect()) {

0 commit comments

Comments
 (0)