Skip to content

Commit c44bd37

Browse files
author
Roman Syroeshko
committed
Minor refactoring.
1 parent 42b878e commit c44bd37

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

samples/Sample_Header.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
require_once __DIR__ . '/../src/PhpWord/Autoloader.php';
23

34
date_default_timezone_set('UTC');
45

@@ -14,15 +15,14 @@
1415
define('SCRIPT_FILENAME', basename($_SERVER['SCRIPT_FILENAME'], '.php'));
1516
define('IS_INDEX', SCRIPT_FILENAME == 'index');
1617

17-
require_once __DIR__ . '/../src/PhpWord/Autoloader.php';
1818
Autoloader::register();
1919
Settings::loadConfig();
2020

2121
// Set writers
2222
$writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf', 'HTML' => 'html', 'PDF' => 'pdf');
2323

2424
// Set PDF renderer
25-
if (Settings::getPdfRendererPath() === null) {
25+
if (null === Settings::getPdfRendererPath()) {
2626
$writers['PDF'] = null;
2727
}
2828

@@ -65,7 +65,7 @@ function write($phpWord, $filename, $writers)
6565
// Write documents
6666
foreach ($writers as $format => $extension) {
6767
$result .= date('H:i:s') . " Write to {$format} format";
68-
if ($extension !== null) {
68+
if (null !== $extension) {
6969
$targetFile = __DIR__ . "/results/{$filename}.{$extension}";
7070
$phpWord->save($targetFile, $format);
7171
} else {

0 commit comments

Comments
 (0)