Skip to content

Commit

Permalink
🚨 Apply fixes from StyleCI (#221)
Browse files Browse the repository at this point in the history
  • Loading branch information
carbontwelve authored Jul 6, 2017
1 parent 6b0ed6a commit c1cbfa5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Entities/Permalink.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ public function getCompiled(File $file, $pretty = true)
$output = str_replace('{ext}', $file->getExt(), $output);
$output = str_replace('{filename}', $this->sluggify($file->getFilename()), $output);

$filePath = str_replace('\\','/', $file->getPath());
if (substr($filePath, 0, 1) === '/'){
$filePath = str_replace('\\', '/', $file->getPath());
if (substr($filePath, 0, 1) === '/') {
$filePath = substr($filePath, 1);
}
if (substr($filePath, -1, 1) === '/'){
if (substr($filePath, -1, 1) === '/') {
$filePath = substr($filePath, 0, -1);
}
$filePath = preg_replace('!/+!', '/', $filePath);
Expand Down Expand Up @@ -103,7 +103,7 @@ public function getCompiled(File $file, $pretty = true)
}

// Ensure valid slashes for url
$output = str_replace('\\','/', $output);
$output = str_replace('\\', '/', $output);

if ($pretty === true && $file->getData('pretty_permalink', true)) {
return $this->prettify($output);
Expand Down

0 comments on commit c1cbfa5

Please sign in to comment.