From 5b75fd0d104ba7efb117efd13a18922f49221d80 Mon Sep 17 00:00:00 2001 From: onigoetz Date: Mon, 26 Sep 2016 18:54:06 +0000 Subject: [PATCH] Applied fixes from StyleCI --- libs/ContentTypes/Markdown/LinkRenderer.php | 5 +++-- libs/Format/Confluence/Generator.php | 4 ++-- libs/Format/HTML/Generator.php | 3 ++- libs/Tree/Builder.php | 1 - libs/Tree/Directory.php | 1 - libs/Tree/Entry.php | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libs/ContentTypes/Markdown/LinkRenderer.php b/libs/ContentTypes/Markdown/LinkRenderer.php index edc013d..a6cdede 100644 --- a/libs/ContentTypes/Markdown/LinkRenderer.php +++ b/libs/ContentTypes/Markdown/LinkRenderer.php @@ -100,12 +100,13 @@ class LinkRenderer extends \League\CommonMark\Inline\Renderer\LinkRenderer // Absolute urls, shouldn't either if ($this->isExternalUrl($url)) { $element->setAttribute('class', 'external'); + return $element; } // if there's a hash component in the url, ensure we // don't put that part through the resolver. - $urlAndHash = explode("#", $url); + $urlAndHash = explode('#', $url); $url = $urlAndHash[0]; try { @@ -120,7 +121,7 @@ class LinkRenderer extends \League\CommonMark\Inline\Renderer\LinkRenderer } if (isset($urlAndHash[1])) { - $url .= "#" . $urlAndHash[1]; + $url .= '#' . $urlAndHash[1]; } $element->setAttribute('href', $url); diff --git a/libs/Format/Confluence/Generator.php b/libs/Format/Confluence/Generator.php index ee9bf24..24bdbe4 100644 --- a/libs/Format/Confluence/Generator.php +++ b/libs/Format/Confluence/Generator.php @@ -34,7 +34,7 @@ class Generator implements \Todaymade\Daux\Format\Base\Generator $confluence = $config->getConfluenceConfiguration(); if ($confluence == null) { - throw new \RuntimeException("You must specify your Confluence configuration"); + throw new \RuntimeException('You must specify your Confluence configuration'); } $mandatory = ['space_id', 'base_url', 'user', 'pass', 'prefix']; @@ -46,7 +46,7 @@ class Generator implements \Todaymade\Daux\Format\Base\Generator } if (count($errors)) { - throw new \RuntimeException("The following options are mandatory for confluence : '" . join("', '", $errors) . "'"); + throw new \RuntimeException("The following options are mandatory for confluence : '" . implode("', '", $errors) . "'"); } if (!array_key_exists('ancestor_id', $confluence) && !array_key_exists('root_id', $confluence)) { diff --git a/libs/Format/HTML/Generator.php b/libs/Format/HTML/Generator.php index 36f44b4..4cc7065 100755 --- a/libs/Format/HTML/Generator.php +++ b/libs/Format/HTML/Generator.php @@ -41,7 +41,8 @@ class Generator implements \Todaymade\Daux\Format\Base\Generator, LiveGenerator ]; } - protected function ensureEmptyDestination($destination) { + protected function ensureEmptyDestination($destination) + { if (is_dir($destination)) { GeneratorHelper::rmdir($destination); } else { diff --git a/libs/Tree/Builder.php b/libs/Tree/Builder.php index 6b04c27..f3692b9 100644 --- a/libs/Tree/Builder.php +++ b/libs/Tree/Builder.php @@ -2,7 +2,6 @@ use RuntimeException; use SplFileInfo; -use Todaymade\Daux\Daux; use Todaymade\Daux\DauxHelper; class Builder diff --git a/libs/Tree/Directory.php b/libs/Tree/Directory.php index 461befc..a0edc81 100644 --- a/libs/Tree/Directory.php +++ b/libs/Tree/Directory.php @@ -2,7 +2,6 @@ use ArrayIterator; use RuntimeException; -use Todaymade\Daux\Daux; class Directory extends Entry implements \ArrayAccess, \IteratorAggregate { diff --git a/libs/Tree/Entry.php b/libs/Tree/Entry.php index c6e0bc9..5722dc5 100644 --- a/libs/Tree/Entry.php +++ b/libs/Tree/Entry.php @@ -147,11 +147,11 @@ abstract class Entry public function getRelativePath() { $root = $this; - while($root->getParent() != null) { + while ($root->getParent() != null) { $root = $root->getParent(); } - return substr($this->path, strlen($root->getPath()) +1); + return substr($this->path, strlen($root->getPath()) + 1); } /**