Scrutinizer fixes

This commit is contained in:
troosan 2017-11-26 17:54:47 +01:00
parent 6a460c292d
commit 23bc837666
7 changed files with 15 additions and 10 deletions

View File

@ -1,14 +1,20 @@
#!/bin/bash #!/bin/bash
echo "Running composer update"
composer update
## PHP_CodeSniffer ## PHP_CodeSniffer
echo "Running CodeSniffer"
./vendor/bin/phpcs src/ tests/ --standard=PSR2 -n --ignore=src/PhpWord/Shared/PCLZip ./vendor/bin/phpcs src/ tests/ --standard=PSR2 -n --ignore=src/PhpWord/Shared/PCLZip
## PHP-CS-Fixer ## PHP-CS-Fixer
echo "Running CS Fixer"
./vendor/bin/php-cs-fixer fix --diff --verbose --dry-run ./vendor/bin/php-cs-fixer fix --diff --verbose --dry-run
## PHP Mess Detector ## PHP Mess Detector
echo "Running Mess Detector"
./vendor/bin/phpmd src/,tests/ text ./phpmd.xml.dist --exclude pclzip.lib.php ./vendor/bin/phpmd src/,tests/ text ./phpmd.xml.dist --exclude pclzip.lib.php
## PHPUnit ## PHPUnit
./vendor/bin/phpunit -c ./ --no-coverage echo "Running PHPUnit"
./vendor/bin/phpunit -c ./

View File

@ -74,7 +74,7 @@ class Field extends AbstractElement
/** /**
* Field text * Field text
* *
* @var TextRun | string * @var TextRun|string
*/ */
protected $text; protected $text;
@ -98,7 +98,7 @@ class Field extends AbstractElement
* @param string $type * @param string $type
* @param array $properties * @param array $properties
* @param array $options * @param array $options
* @param TextRun | string $text * @param TextRun|string $text
*/ */
public function __construct($type = null, $properties = array(), $options = array(), $text = null) public function __construct($type = null, $properties = array(), $options = array(), $text = null)
{ {

View File

@ -37,7 +37,7 @@ class TrackChange extends AbstractContainer
/** /**
* Date * Date
* *
* @var DateTime * @var \DateTime
*/ */
private $date; private $date;

View File

@ -150,11 +150,11 @@ class Settings extends AbstractPart
protected function setRevisionView(XMLReader $xmlReader, PhpWord $phpWord, \DOMElement $node) protected function setRevisionView(XMLReader $xmlReader, PhpWord $phpWord, \DOMElement $node)
{ {
$revisionView = new TrackChangesView(); $revisionView = new TrackChangesView();
$revisionView->setMarkup($xmlReader->getAttribute('w:markup', $node)); $revisionView->setMarkup(filter_var($xmlReader->getAttribute('w:markup', $node), FILTER_VALIDATE_BOOLEAN));
$revisionView->setComments($xmlReader->getAttribute('w:comments', $node)); $revisionView->setComments($xmlReader->getAttribute('w:comments', $node));
$revisionView->setInsDel($xmlReader->getAttribute('w:insDel', $node)); $revisionView->setInsDel($xmlReader->getAttribute('w:insDel', $node));
$revisionView->setFormatting($xmlReader->getAttribute('w:formatting', $node)); $revisionView->setFormatting(filter_var($xmlReader->getAttribute('w:formatting', $node), FILTER_VALIDATE_BOOLEAN));
$revisionView->setInkAnnotations($xmlReader->getAttribute('w:inkAnnotations', $node)); $revisionView->setInkAnnotations(filter_var($xmlReader->getAttribute('w:inkAnnotations', $node), FILTER_VALIDATE_BOOLEAN));
$phpWord->getSettings()->setRevisionView($revisionView); $phpWord->getSettings()->setRevisionView($revisionView);
} }
} }

View File

@ -48,7 +48,7 @@ abstract class AbstractEnum
/** /**
* Returns true the value is valid for this enum * Returns true the value is valid for this enum
* *
* @param strign $value * @param string $value
* @return bool true if value is valid * @return bool true if value is valid
*/ */
public static function isValid($value) public static function isValid($value)

View File

@ -351,7 +351,7 @@ class ZipArchive
* Returns the name of an entry using its index (emulate \ZipArchive) * Returns the name of an entry using its index (emulate \ZipArchive)
* *
* @param int $index * @param int $index
* @return string * @return string|bool
* @since 0.10.0 * @since 0.10.0
*/ */
public function pclzipGetNameIndex($index) public function pclzipGetNameIndex($index)

View File

@ -18,7 +18,6 @@
namespace PhpOffice\PhpWord\Writer\ODText\Element; namespace PhpOffice\PhpWord\Writer\ODText\Element;
use PhpOffice\PhpWord\Exception\Exception; use PhpOffice\PhpWord\Exception\Exception;
use PhpOffice\PhpWord\Settings;
/** /**
* Text element writer * Text element writer