Skip to content

Commit a47ea38

Browse files
lfluvisottoDharmeshvaja91
authored andcommitted
It is recommended to use the &&, || operators, instead of and, or to prevent confusion.
1 parent 994348f commit a47ea38

File tree

9 files changed

+14
-14
lines changed

9 files changed

+14
-14
lines changed

app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Validate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ private function isUniqueAdminValues(array $optionsValues, array $deletedOptions
158158
{
159159
$adminValues = [];
160160
foreach ($optionsValues as $optionKey => $values) {
161-
if (!(isset($deletedOptions[$optionKey]) and $deletedOptions[$optionKey] === '1')) {
161+
if (!(isset($deletedOptions[$optionKey]) && $deletedOptions[$optionKey] === '1')) {
162162
$adminValues[] = reset($values);
163163
}
164164
}

app/code/Magento/Paypal/Controller/Transparent/RequestSecureToken.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function execute()
8282
/** @var Quote $quote */
8383
$quote = $this->sessionManager->getQuote();
8484

85-
if (!$quote or !$quote instanceof Quote) {
85+
if (!$quote || !$quote instanceof Quote) {
8686
return $this->getErrorResponse();
8787
}
8888

app/code/Magento/Security/Model/SecurityChecker/Quantity.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function check($securityEventType, $accountReference = null, $longIp = nu
5353
{
5454
$isEnabled = $this->securityConfig->getPasswordResetProtectionType() != ResetMethod::OPTION_NONE;
5555
$allowedAttemptsNumber = $this->securityConfig->getMaxNumberPasswordResetRequests();
56-
if ($isEnabled and $allowedAttemptsNumber) {
56+
if ($isEnabled && $allowedAttemptsNumber) {
5757
$collection = $this->prepareCollection($securityEventType, $accountReference, $longIp);
5858
if ($collection->count() >= $allowedAttemptsNumber) {
5959
throw new SecurityViolationException(

app/code/Magento/SendFriend/Model/SendFriend.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ public function validate()
236236
}
237237

238238
$email = $this->getSender()->getEmail();
239-
if (empty($email) or !\Zend_Validate::is($email, \Magento\Framework\Validator\EmailAddress::class)) {
239+
if (empty($email) || !\Zend_Validate::is($email, \Magento\Framework\Validator\EmailAddress::class)) {
240240
$errors[] = __('Invalid Sender Email');
241241
}
242242

@@ -281,13 +281,13 @@ public function setRecipients($recipients)
281281
// validate array
282282
if (!is_array(
283283
$recipients
284-
) or !isset(
284+
) || !isset(
285285
$recipients['email']
286-
) or !isset(
286+
) || !isset(
287287
$recipients['name']
288-
) or !is_array(
288+
) || !is_array(
289289
$recipients['email']
290-
) or !is_array(
290+
) || !is_array(
291291
$recipients['name']
292292
)
293293
) {
@@ -487,7 +487,7 @@ protected function _sentCountByCookies($increment = false)
487487
$oldTimes = explode(',', $oldTimes);
488488
foreach ($oldTimes as $oldTime) {
489489
$periodTime = $time - $this->_sendfriendData->getPeriod();
490-
if (is_numeric($oldTime) and $oldTime >= $periodTime) {
490+
if (is_numeric($oldTime) && $oldTime >= $periodTime) {
491491
$newTimes[] = $oldTime;
492492
}
493493
}

app/code/Magento/Tax/Model/Sales/Total/Quote/Tax.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ protected function processExtraTaxables(Address\Total $total, array $itemsByType
264264
{
265265
$extraTaxableDetails = [];
266266
foreach ($itemsByType as $itemType => $itemTaxDetails) {
267-
if ($itemType != self::ITEM_TYPE_PRODUCT and $itemType != self::ITEM_TYPE_SHIPPING) {
267+
if ($itemType != self::ITEM_TYPE_PRODUCT && $itemType != self::ITEM_TYPE_SHIPPING) {
268268
foreach ($itemTaxDetails as $itemCode => $itemTaxDetail) {
269269
/** @var \Magento\Tax\Api\Data\TaxDetailsInterface $taxDetails */
270270
$taxDetails = $itemTaxDetail[self::KEY_ITEM];

dev/tests/static/testsuite/Magento/Test/Integrity/ClassesTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ private function assertClassesExist($classes, $path)
191191
foreach ($classes as $class) {
192192
$class = trim($class, '\\');
193193
try {
194-
if (strrchr($class, '\\') === false and !Classes::isVirtual($class)) {
194+
if (strrchr($class, '\\') === false && !Classes::isVirtual($class)) {
195195
$badUsages[] = $class;
196196
continue;
197197
} else {

lib/internal/Magento/Framework/Filter/Template.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ public function templateDirective($construction)
227227
{
228228
// Processing of {template config_path=... [...]} statement
229229
$templateParameters = $this->getParameters($construction[2]);
230-
if (!isset($templateParameters['config_path']) or !$this->getTemplateProcessor()) {
230+
if (!isset($templateParameters['config_path']) || !$this->getTemplateProcessor()) {
231231
// Not specified template or not set include processor
232232
$replacedValue = '{Error in template processing}';
233233
} else {

lib/internal/Magento/Framework/Message/Manager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ public function addUniqueMessages(array $messages, $group = null)
226226
$items = $this->getMessages(false, $group)->getItems();
227227

228228
foreach ($messages as $message) {
229-
if ($message instanceof MessageInterface and !in_array($message, $items, false)) {
229+
if ($message instanceof MessageInterface && !in_array($message, $items, false)) {
230230
$this->addMessage($message, $group);
231231
}
232232
}

setup/src/Magento/Setup/Model/ConfigOptionsList/Session.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ public function validate(array $options, DeploymentConfig $deploymentConfig)
301301

302302
if (isset($options[self::INPUT_KEY_SESSION_REDIS_LOG_LEVEL])) {
303303
$level = $options[self::INPUT_KEY_SESSION_REDIS_LOG_LEVEL];
304-
if (($level < 0) or ($level > 7)) {
304+
if (($level < 0) || ($level > 7)) {
305305
$errors[] = "Invalid Redis log level '{$level}'. Valid range is 0-7, inclusive.";
306306
}
307307
}

0 commit comments

Comments
 (0)