Applied fixes from StyleCI

This commit is contained in:
onigoetz 2016-09-26 18:54:06 +00:00 committed by Stéphane Goetz
parent 6a83c1fe18
commit 5b75fd0d10
6 changed files with 9 additions and 9 deletions

View File

@ -100,12 +100,13 @@ class LinkRenderer extends \League\CommonMark\Inline\Renderer\LinkRenderer
// Absolute urls, shouldn't either // Absolute urls, shouldn't either
if ($this->isExternalUrl($url)) { if ($this->isExternalUrl($url)) {
$element->setAttribute('class', 'external'); $element->setAttribute('class', 'external');
return $element; return $element;
} }
// if there's a hash component in the url, ensure we // if there's a hash component in the url, ensure we
// don't put that part through the resolver. // don't put that part through the resolver.
$urlAndHash = explode("#", $url); $urlAndHash = explode('#', $url);
$url = $urlAndHash[0]; $url = $urlAndHash[0];
try { try {
@ -120,7 +121,7 @@ class LinkRenderer extends \League\CommonMark\Inline\Renderer\LinkRenderer
} }
if (isset($urlAndHash[1])) { if (isset($urlAndHash[1])) {
$url .= "#" . $urlAndHash[1]; $url .= '#' . $urlAndHash[1];
} }
$element->setAttribute('href', $url); $element->setAttribute('href', $url);

View File

@ -34,7 +34,7 @@ class Generator implements \Todaymade\Daux\Format\Base\Generator
$confluence = $config->getConfluenceConfiguration(); $confluence = $config->getConfluenceConfiguration();
if ($confluence == null) { 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']; $mandatory = ['space_id', 'base_url', 'user', 'pass', 'prefix'];
@ -46,7 +46,7 @@ class Generator implements \Todaymade\Daux\Format\Base\Generator
} }
if (count($errors)) { 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)) { if (!array_key_exists('ancestor_id', $confluence) && !array_key_exists('root_id', $confluence)) {

View File

@ -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)) { if (is_dir($destination)) {
GeneratorHelper::rmdir($destination); GeneratorHelper::rmdir($destination);
} else { } else {

View File

@ -2,7 +2,6 @@
use RuntimeException; use RuntimeException;
use SplFileInfo; use SplFileInfo;
use Todaymade\Daux\Daux;
use Todaymade\Daux\DauxHelper; use Todaymade\Daux\DauxHelper;
class Builder class Builder

View File

@ -2,7 +2,6 @@
use ArrayIterator; use ArrayIterator;
use RuntimeException; use RuntimeException;
use Todaymade\Daux\Daux;
class Directory extends Entry implements \ArrayAccess, \IteratorAggregate class Directory extends Entry implements \ArrayAccess, \IteratorAggregate
{ {

View File

@ -147,11 +147,11 @@ abstract class Entry
public function getRelativePath() public function getRelativePath()
{ {
$root = $this; $root = $this;
while($root->getParent() != null) { while ($root->getParent() != null) {
$root = $root->getParent(); $root = $root->getParent();
} }
return substr($this->path, strlen($root->getPath()) +1); return substr($this->path, strlen($root->getPath()) + 1);
} }
/** /**