8
0

Applied fixes from StyleCI

Dieser Commit ist enthalten in:
onigoetz
2016-07-27 15:32:51 -04:00
committet von Stéphane Goetz
Ursprung cfc8d30ba2
Commit 2314516ce9
52 geänderte Dateien mit 477 neuen und 424 gelöschten Zeilen

Datei anzeigen

@ -5,7 +5,7 @@ use Todaymade\Daux\Tree\Content;
class ContentTypeHandler
{
/**
* @var ContentType[] $types
* @var ContentType[]
*/
protected $types;

Datei anzeigen

@ -4,9 +4,6 @@ use League\CommonMark\DocParser;
use League\CommonMark\Environment;
use League\CommonMark\HtmlRenderer;
use Todaymade\Daux\Config;
use Todaymade\Daux\ContentTypes\Markdown\TOC\Parser;
use Todaymade\Daux\ContentTypes\Markdown\TOC\Renderer;
use Todaymade\Daux\ContentTypes\Markdown\TOC\TOCProcessor;
use Webuni\CommonMark\TableExtension\TableExtension;
class CommonMarkConverter extends \League\CommonMark\CommonMarkConverter
@ -16,7 +13,7 @@ class CommonMarkConverter extends \League\CommonMark\CommonMarkConverter
*
* @param array $config
*/
public function __construct(array $config = array())
public function __construct(array $config = [])
{
$environment = Environment::createCommonMarkEnvironment();
$environment->mergeConfig($config);

Datei anzeigen

@ -28,6 +28,7 @@ class ContentType implements \Todaymade\Daux\ContentTypes\ContentType
public function convert($raw, Content $node)
{
$this->config->setCurrentPage($node);
return $this->converter->convertToHtml($raw);
}
}

Datei anzeigen

@ -34,7 +34,7 @@ class LinkRenderer extends \League\CommonMark\Inline\Renderer\LinkRenderer
// "!" In this case we will try to find
// the file starting at the root
if ($url[0] == '!' || $url[0] == '/') {
$url = ltrim($url, "!/");
$url = ltrim($url, '!/');
if ($file = DauxHelper::getFile($this->daux['tree'], $url)) {
return $file;
@ -71,7 +71,7 @@ class LinkRenderer extends \League\CommonMark\Inline\Renderer\LinkRenderer
// have the same interface
if (!$inline instanceof Link) {
throw new \RuntimeException(
"Wrong type passed to " . __CLASS__ . "::" . __METHOD__ .
'Wrong type passed to ' . __CLASS__ . '::' . __METHOD__ .
" the expected type was 'League\\CommonMark\\Inline\\Element\\Link' but '" .
get_class($inline) . "' was provided"
);
@ -83,7 +83,7 @@ class LinkRenderer extends \League\CommonMark\Inline\Renderer\LinkRenderer
// Absolute urls, empty urls and anchors
// should not go through the url resolver
if (empty($url) || $url[0] == "#" || preg_match("|^(?:[a-z]+:)?//|", $url)) {
if (empty($url) || $url[0] == '#' || preg_match('|^(?:[a-z]+:)?//|', $url)) {
return $element;
}

Datei anzeigen

@ -5,7 +5,6 @@ use League\CommonMark\Cursor;
class TableOfContents extends AbstractBlock
{
/**
* Returns true if this block can contain the given block as a child node
*

Datei anzeigen

@ -6,7 +6,6 @@ use League\CommonMark\Cursor;
class TableOfContentsParser extends AbstractBlockParser
{
/**
* @param ContextInterface $context
* @param Cursor $cursor