Skip to content

Commit 95507c0

Browse files
committed
Cleanup to make checks and tests pass
1 parent b9458b7 commit 95507c0

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

_test/InlineConfigParser.test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function test_simple()
2121
$inline = '"testtable, another, foo bar"."%pageid%, count" ';
2222
$inline .= '?sort: ^count sort: "%pageid%, ^bam" align: "r,l,center,foo"';
2323
// Add InlineConfigParser-specific tests:
24-
$inline .= '& "%pageid% != start" | "count = 1"';
24+
$inline .= ' & "%pageid% != start" | "count = 1"';
2525

2626
$configParser = new meta\InlineConfigParser($inline);
2727
$actual_config = $configParser->getConfig();

syntax/value.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* DokuWiki Plugin struct (Syntax Component)
45
*
@@ -9,16 +10,10 @@
910
// phpcs:disable PSR1.Files.SideEffects
1011

1112
use dokuwiki\plugin\struct\meta\AggregationValue;
12-
use dokuwiki\plugin\struct\meta\ConfigParser;
1313
use dokuwiki\plugin\struct\meta\InlineConfigParser;
1414
use dokuwiki\plugin\struct\meta\SearchConfig;
1515
use dokuwiki\plugin\struct\meta\StructException;
1616

17-
// must be run within Dokuwiki
18-
if (!defined('DOKU_INC')) {
19-
die();
20-
}
21-
2217
// phpcs:ignore PSR1.Classes.ClassDeclaration, Squiz.Classes.ValidClassName
2318
class syntax_plugin_struct_value extends DokuWiki_Syntax_Plugin
2419
{

types/Url.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,19 @@ public function renderValue($value, \Doku_Renderer $R, $mode)
5656
* @param $url
5757
* @return string
5858
*/
59-
protected function generateTitle($url) {
60-
if($this->config['fixedtitle']) return $this->config['fixedtitle'];
61-
if(!$this->config['autoshorten']) return $url;
59+
protected function generateTitle($url)
60+
{
61+
if ($this->config['fixedtitle']) return $this->config['fixedtitle'];
62+
if (!$this->config['autoshorten']) return $url;
6263

6364
$parsed = parse_url($url);
6465

6566
$title = $parsed['host'];
6667
$title = preg_replace('/^www\./i', '', $title);
67-
if(isset($parsed['path']) && $parsed['path'] === '/') {
68+
if (isset($parsed['path']) && $parsed['path'] === '/') {
6869
unset($parsed['path']);
6970
}
70-
if(
71+
if (
7172
isset($parsed['path']) ||
7273
isset($parsed['query']) ||
7374
isset($parsed['fragment'])

0 commit comments

Comments
 (0)