Skip to content

Commit 25ddeb1

Browse files
authored
Added rules (#4181)
1 parent b9e1be5 commit 25ddeb1

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

.php-cs-fixer.dist.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
*/
77
$config = new PhpCsFixer\Config();
88
return $config
9+
->setRiskyAllowed(true)
910
->setRules([
11+
// PHP arrays should be declared using the configured syntax.
12+
'array_syntax' => ['syntax' => 'short'],
1013
// There MUST be one blank line after the namespace declaration.
1114
'blank_line_after_namespace' => true,
1215
// Ensure there is no code on the same line as the PHP open tag and it is followed by a blank line.
@@ -33,6 +36,8 @@
3336
'indentation_type' => true,
3437
// All PHP files must use same line ending.
3538
'line_ending' => true,
39+
// Use && and || logical operators instead of and and or.
40+
'logical_operators' => true,
3641
// Cast should be written in lower case.
3742
'lowercase_cast' => true,
3843
// PHP keywords MUST be in lower case.
@@ -41,6 +46,8 @@
4146
'lowercase_static_reference' => true,
4247
// In method arguments and method call, there MUST NOT be a space before each comma and there MUST be one space after each comma. Argument lists MAY be split across multiple lines, where each subsequent line is indented once. When doing so, the first item in the list MUST be on the next line, and there MUST be only one argument per line.
4348
'method_argument_space' => true,
49+
// Replaces intval, floatval, doubleval, strval and boolval function calls with according type casting operator.
50+
'modernize_types_casting' => true,
4451
// All instances created with new keyword must be followed by braces.
4552
'new_with_braces' => true,
4653
// There should be no empty lines after class opening brace.

app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Customer.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,18 @@ public function getButtonsHtml()
4242
{
4343
$html = '';
4444

45-
$addButtonData = array(
45+
$addButtonData = [
4646
'label' => Mage::helper('sales')->__('Create New Customer'),
4747
'onclick' => 'order.setCustomerId(false)',
4848
'class' => 'add',
49-
);
49+
];
5050
$html .= $this->getLayout()->createBlock('adminhtml/widget_button')->setData($addButtonData)->toHtml();
5151

52-
$addButtonData = array(
52+
$addButtonData = [
5353
'label' => Mage::helper('sales')->__('Create Guest Order'),
5454
'onclick' => 'order.setCustomerIsGuest()',
5555
'class' => 'add',
56-
);
56+
];
5757
$html .= $this->getLayout()->createBlock('adminhtml/widget_button')->setData($addButtonData)->toHtml();
5858

5959
return $html;

app/code/core/Mage/Core/Helper/EnvironmentConfigLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ protected function getConfigKey(string $configKey): array
110110
'trim'
111111
);
112112
list($_, $scope) = $configKeyParts;
113-
return array($configKeyParts, $scope);
113+
return [$configKeyParts, $scope];
114114
}
115115

116116
protected function isConfigKeyValid(string $configKey): bool

app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ protected function insertOrder(&$page, $obj, $putOrderId = true)
366366

367367
if (!$order->getIsVirtual()) {
368368
$this->y = $addressesStartY;
369-
if (isset($shippingAddress) and is_iterable($shippingAddress)) {
369+
if (isset($shippingAddress) && is_iterable($shippingAddress)) {
370370
foreach ($shippingAddress as $value) {
371371
if ($value !== '') {
372372
$text = [];

0 commit comments

Comments
 (0)