diff --git a/.phpcs.xml b/.phpcs.xml
new file mode 100644
index 0000000..210d7c4
--- /dev/null
+++ b/.phpcs.xml
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ .
+ vendor/
+
diff --git a/.travis.yml b/.travis.yml
index b2f0324..3ea0161 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -34,6 +34,7 @@ install:
- composer install --prefer-dist
script:
+ - vendor/bin/phpcs -s
- vendor/bin/phpunit --verbose --coverage-clover=coverage.clover
# test against standard markdown spec
# - git clone https://github.com/jgm/stmd && cd stmd && perl runtests.pl spec.txt ../bin/markdown
diff --git a/block/CodeTrait.php b/block/CodeTrait.php
index 2457ece..b970065 100644
--- a/block/CodeTrait.php
+++ b/block/CodeTrait.php
@@ -38,7 +38,7 @@ protected function consumeCode($lines, $current)
$content[] = $line;
// but also if it is empty and the next line is intended by 4 spaces or a tab
} elseif (($line === '' || rtrim($line) === '') && isset($lines[$i + 1][0]) &&
- ($lines[$i + 1][0] === "\t" || strncmp($lines[$i + 1], ' ', 4) === 0)) {
+ ($lines[$i + 1][0] === "\t" || strncmp($lines[$i + 1], ' ', 4) === 0)) {
if ($line !== '') {
$line = $line[0] === "\t" ? substr($line, 1) : substr($line, 4);
}
diff --git a/block/ListTrait.php b/block/ListTrait.php
index 7e53a76..52e438e 100644
--- a/block/ListTrait.php
+++ b/block/ListTrait.php
@@ -34,7 +34,7 @@ protected function identifyUl($line)
{
$l = $line[0];
return ($l === '-' || $l === '+' || $l === '*') && (isset($line[1]) && (($l1 = $line[1]) === ' ' || $l1 === "\t")) ||
- ($l === ' ' && preg_match('/^ {0,3}[\-\+\*][ \t]/', $line));
+ ($l === ' ' && preg_match('/^ {0,3}[\-\+\*][ \t]/', $line));
}
/**
diff --git a/composer.json b/composer.json
index 6a3160e..cd37742 100644
--- a/composer.json
+++ b/composer.json
@@ -24,7 +24,8 @@
"require-dev": {
"phpunit/phpunit": "4.1.*",
"facebook/xhprof": "*@dev",
- "cebe/indent": "*"
+ "cebe/indent": "*",
+ "squizlabs/php_codesniffer": "^3.6"
},
"autoload": {
"psr-4": {
diff --git a/inline/EmphStrongTrait.php b/inline/EmphStrongTrait.php
index ca91929..a8cc374 100644
--- a/inline/EmphStrongTrait.php
+++ b/inline/EmphStrongTrait.php
@@ -82,6 +82,6 @@ protected function renderEmph($block)
return '' . $this->renderAbsy($block[1]) . '';
}
- abstract protected function parseInline($text);
- abstract protected function renderAbsy($blocks);
+ abstract protected function parseInline($text);
+ abstract protected function renderAbsy($blocks);
}
diff --git a/inline/StrikeoutTrait.php b/inline/StrikeoutTrait.php
index 0e1d21a..c350c7b 100644
--- a/inline/StrikeoutTrait.php
+++ b/inline/StrikeoutTrait.php
@@ -35,6 +35,6 @@ protected function renderStrike($block)
return '' . $this->renderAbsy($block[1]) . '';
}
- abstract protected function parseInline($text);
- abstract protected function renderAbsy($blocks);
+ abstract protected function parseInline($text);
+ abstract protected function renderAbsy($blocks);
}