Skip to content

Commit

Permalink
Apply CS fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rvogel committed Jan 20, 2022
1 parent 3836804 commit 0dd03ea
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 13 deletions.
8 changes: 4 additions & 4 deletions src/Analyzer/ConfluenceAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ private function makeSpacesMap() {
$spaceKey = $this->helper->getPropertyValue( 'key', $space );

if ( substr( $spaceKey, 0, 1 ) === '~' ) {
//User namespaces
// User namespaces
$userName = substr( $spaceKey, 1, strlen( $spaceKey ) - 1 );
$spaceKey = 'User' . ucfirst( $userName );
$this->output->writeln( "\033[31m- $spaceKey (ID:$spaceId) - protected user namespace\033[39m" );
Expand Down Expand Up @@ -195,7 +195,7 @@ private function makePagenamesMap() {
// We need to preserve the spaceID, so we can properly resolve cross-space links
// in the `convert` stage
$this->pageConfluenceTitle = "$spaceId---{$this->pageConfluenceTitle}";
$this->pageConfluenceTitle = str_replace( ' ', '_', $this->pageConfluenceTitle ); //Some normalization
$this->pageConfluenceTitle = str_replace( ' ', '_', $this->pageConfluenceTitle ); // Some normalization
$this->customBuckets->addData( 'pages-titles-map', $this->pageConfluenceTitle, $targetTitle, false, true );

// Also add pages IDs in Confluence to full page title mapping.
Expand Down Expand Up @@ -285,7 +285,7 @@ private function makeAttachmentTargetFilename( $attachment, $containerTitle ) {
}

$fileKey = "{$this->pageConfluenceTitle}---$fileName";
$fileKey = str_replace( ' ', '_', $fileKey ); //Some normalization
$fileKey = str_replace( ' ', '_', $fileKey ); // Some normalization
$this->customBuckets->addData( 'filenames-to-filetitles-map', $fileKey, $targetName, false, true );

return $targetName;
Expand Down Expand Up @@ -317,7 +317,7 @@ private function makeAttachmentReference( $attachment ) {
}

$path = $basePath . "/" . $containerId . '/' . $attachmentId . '/' . $attachmentVersion;
if( !file_exists( $path ) ) {
if ( !file_exists( $path ) ) {
return '';
}

Expand Down
4 changes: 2 additions & 2 deletions src/Composer/ConfluenceComposer.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function buildXML( Builder $builder ) {
private function appendDefaultPages( Builder $builder ) {
$path = pathinfo( __DIR__ . '/_defaultpages/' );
$dir = parse_url( $path['dirname'] );
$basepath = $dir['host'].':/' . $dir['path'];
$basepath = $dir['host'] . ':/' . $dir['path'];
$files = glob( "$basepath/*/*" );
foreach ( $files as $file ) {
$namespacePrefix = basename( dirname( $file ) );
Expand All @@ -121,7 +121,7 @@ private function appendDefaultPages( Builder $builder ) {
private function addDefaultFiles() {
$path = pathinfo( __DIR__ . '/_defaultfiles/' );
$dir = parse_url( $path['dirname'] );
$basepath = $dir['host'].':/' . $dir['path'];
$basepath = $dir['host'] . ':/' . $dir['path'];
$files = glob( "$basepath/*" );
foreach ( $files as $file ) {
$fileName = basename( $file );
Expand Down
2 changes: 1 addition & 1 deletion src/Converter/ConfluenceConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
use HalloWelt\MigrateConfluence\Converter\Processor\ConvertStatusMacro;
use HalloWelt\MigrateConfluence\Converter\Processor\ConvertTipMacro;
use HalloWelt\MigrateConfluence\Converter\Processor\ConvertWarningMacro;
use HalloWelt\MigrateConfluence\Converter\Processor\PreserveTableAttributes;
use HalloWelt\MigrateConfluence\Converter\Processor\StructuredMacroColumn;
use HalloWelt\MigrateConfluence\Converter\Processor\StructuredMacroPanel;
use HalloWelt\MigrateConfluence\Converter\Processor\PreserveTableAttributes;
use HalloWelt\MigrateConfluence\Converter\Processor\StructuredMacroSection;
use HalloWelt\MigrateConfluence\Utility\ConversionDataLookup;
use SplFileInfo;
Expand Down
4 changes: 2 additions & 2 deletions src/Converter/Processor/StructuredMacroProcessorBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function process( DOMDocument $dom ): void {
*/
private function macroParams( $macro, $macroReplacement ): void {
$params = [];
foreach( $macro->childNodes as $childNode ) {
foreach ( $macro->childNodes as $childNode ) {
if ( $childNode->nodeName === 'ac:parameter' ) {
$paramName = $childNode->getAttribute( 'ac:name' );
$params[$paramName] = $childNode->nodeValue;
Expand All @@ -65,7 +65,7 @@ private function macroParams( $macro, $macroReplacement ): void {
* @return void
*/
private function macroBody( $macro, $macroReplacement ): void {
foreach( $macro->childNodes as $childNode ) {
foreach ( $macro->childNodes as $childNode ) {
if ( $childNode->nodeName === 'ac:rich-text-body' ) {
foreach ( $childNode->childNodes as $node ) {
$newNode = $node->cloneNode( true );
Expand Down
1 change: 0 additions & 1 deletion src/Utility/TitleBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ public function buildTitle( $pageNode ) {
$this->builder->appendTitleSegment( $title );
}


return $this->builder->invertTitleSegments()->build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ protected function getExpectedOutput(): string {
return file_get_contents( dirname( dirname( __DIR__ ) ) . '/data/structuredmacrocolumntest-output.xml' );
}

protected function getProcessorToTest(): IProcessor {
protected function getProcessorToTest(): IProcessor {
return new StructuredMacroColumn();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ protected function getExpectedOutput(): string {
return file_get_contents( dirname( dirname( __DIR__ ) ) . '/data/structuredmacropaneltest-output.xml' );
}

protected function getProcessorToTest(): IProcessor {
protected function getProcessorToTest(): IProcessor {
return new StructuredMacroPanel();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ protected function getExpectedOutput(): string {
return file_get_contents( dirname( dirname( __DIR__ ) ) . '/data/structuredmacrosectiontest-output.xml' );
}

protected function getProcessorToTest(): IProcessor {
protected function getProcessorToTest(): IProcessor {
return new StructuredMacroSection();
}
}

0 comments on commit 0dd03ea

Please sign in to comment.