Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
magento2-base
dev
tests
static
framework
Magento
Sniffs
Less
PropertiesLineBreakSniff.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Sniffs\Less
;
7
8
use PHP_CodeSniffer\Sniffs\Sniff;
9
use PHP_CodeSniffer\Files\File;
10
19
class
PropertiesLineBreakSniff
implements
Sniff
20
{
26
public
$supportedTokenizers
= [
TokenizerSymbolsInterface::TOKENIZER_CSS
];
27
31
public
function
register
()
32
{
33
return
[T_SEMICOLON];
34
}
35
39
public
function
process
(File $phpcsFile, $stackPtr)
40
{
41
$tokens
= $phpcsFile->getTokens();
42
43
$prevPtr = $phpcsFile->findPrevious(T_SEMICOLON, ($stackPtr - 1));
44
if
(
false
=== $prevPtr) {
45
return
;
46
}
47
48
if
(
$tokens
[$prevPtr][
'line'
] ===
$tokens
[$stackPtr][
'line'
]) {
49
$error =
'Each property must be on a line by itself'
;
50
$phpcsFile->addError($error, $stackPtr,
'SameLine'
);
51
}
52
}
53
}
Magento\Sniffs\Less\PropertiesLineBreakSniff\$supportedTokenizers
$supportedTokenizers
Definition:
PropertiesLineBreakSniff.php:26
Magento\Sniffs\Less\TokenizerSymbolsInterface\TOKENIZER_CSS
const TOKENIZER_CSS
Definition:
TokenizerSymbolsInterface.php:14
Magento\Sniffs\Less\PropertiesLineBreakSniff\process
process(File $phpcsFile, $stackPtr)
Definition:
PropertiesLineBreakSniff.php:39
Magento\Sniffs\Less
Definition:
AvoidIdSniff.php:6
Magento\Sniffs\Less\PropertiesLineBreakSniff
Definition:
PropertiesLineBreakSniff.php:19
$tokens
$tokens
Definition:
cards_list.phtml:9