Skip to content

Commit

Permalink
build: Updating composer dependencies
Browse files Browse the repository at this point in the history
composer:
* mediawiki/minus-x: 0.3.1 → 0.3.2
* jakub-onderka/php-console-highlighter: 0.3.2 -> 0.4.0
* mediawiki/mediawiki-phan-config: 0.8.0 -> 0.9.0

Change-Id: I35f396997d238a81371fb6b3be08de17904cf601
  • Loading branch information
umherirrender committed Jan 5, 2020
1 parent 9d07c62 commit 56a09e4
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .phan/config.php
Expand Up @@ -67,6 +67,11 @@ function wfCollectPhpFiles( string $dir, ?array &$result = [] ) {

// FIXME: Temporary?
$cfg['suppress_issue_types'][] = 'PhanTypeArraySuspiciousNullable';
$cfg['suppress_issue_types'][] = 'PhanTypePossiblyInvalidDimOffset';

// These are too spammy for now. TODO enable
$cfg['null_casts_as_any_type'] = true;
$cfg['scalar_implicit_cast'] = true;

// Bundled plugins, generated from,
// `ls -p1 vendor/phan/phan/.phan/plugins/ |grep -Ev "(/|README)" |sed -e s/\.php// |xargs printf "\t\'%s\',\n"`
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Expand Up @@ -34,12 +34,12 @@
},
"require-dev": {
"jakub-onderka/php-parallel-lint": "1.0.0",
"jakub-onderka/php-console-highlighter": "0.3.2",
"jakub-onderka/php-console-highlighter": "0.4.0",
"jakub-onderka/php-console-color": "0.2",
"monolog/monolog": "~1.24.0",
"mediawiki/mediawiki-codesniffer": "28.0.0",
"mediawiki/mediawiki-phan-config": "0.8.0",
"mediawiki/minus-x": "0.3.1",
"mediawiki/mediawiki-phan-config": "0.9.0",
"mediawiki/minus-x": "0.3.2",
"phpunit/phpunit": "^7.5.13",
"sebastian/diff": "3.0.1",
"wikimedia/alea": "^0.9.0",
Expand Down
2 changes: 2 additions & 0 deletions src/Html2Wt/LinkHandlerUtils.php
Expand Up @@ -571,6 +571,7 @@ private static function serializeAsWikiLink(
$escapedTgt = null;
if ( !empty( $linkData->isRedirect ) ) {
$linkTarget = $target['value'];
// @phan-suppress-next-line PhanRedundantCondition
if ( !empty( $target['modified'] ) || empty( $target['fromsrc'] ) ) {
$linkTarget = strtr( preg_replace( '#^(\.\.?/)*#', '', $linkTarget, 1 ), '_', ' ' );
$escapedTgt = self::escapeLinkTarget( $linkTarget, $state );
Expand Down Expand Up @@ -657,6 +658,7 @@ private static function serializeAsWikiLink(
}

$linkTarget = $target['value'];
// @phan-suppress-next-line PhanRedundantCondition
if ( !empty( $target['modified'] ) || empty( $target['fromsrc'] ) ) {
// Links starting with ./ shouldn't get _ replaced with ' '
$linkContentIsRelative = preg_match( '#^\./#', $linkData->content->string ?? '' );
Expand Down
2 changes: 2 additions & 0 deletions src/Utils/ContentUtils.php
Expand Up @@ -56,13 +56,15 @@ public static function ppToDOM( Env $env, string $html, array $options = [] ): D
'reinsertFosterableContent' => null,
];
$node = $options['node'];
// @phan-suppress-next-line PhanSuspiciousValueComparison
if ( $node === null ) {
$node = DOMCompat::getBody( $env->createDocument( $html ) );
} else {
DOMUtils::assertElt( $node );
DOMCompat::setInnerHTML( $node, $html );
}

// @phan-suppress-next-line PhanImpossibleCondition
if ( $options['reinsertFosterableContent'] ) {
DOMUtils::visitDOM( $node, function ( $n, ...$args ) use ( $env ) {
// untunnel fostered content
Expand Down
1 change: 1 addition & 0 deletions src/Wt2Html/PP/Processors/Linter.php
Expand Up @@ -1027,6 +1027,7 @@ private function detectMultipleUnclosedFormattingTags( array $lints, Env $env ):
if ( $item['type'] === 'missing-end-tag' && !$item['params']['inTable'] ) {
if ( $item['params']['name'] === 'small' || $item['params']['name'] === 'big' ) {
$tagName = $item['params']['name'];
// @phan-suppress-next-line PhanRedundantConditionInLoop
if ( !$firstUnclosedTag[$tagName] ) {
$firstUnclosedTag[$tagName] = $item;
} else {
Expand Down
3 changes: 3 additions & 0 deletions src/Wt2Html/PP/Processors/PWrap.php
Expand Up @@ -90,8 +90,11 @@ private function mergeRuns( DOMElement $n, array $a ): array {
$ret[] = [ 'pwrap' => $v['pwrap'], 'node' => $n ];
$i++;
} elseif ( $ret[$i]['pwrap'] === null ) {
// @phan-suppress-previous-line PhanTypeInvalidDimOffset
$ret[$i]['pwrap'] = $v['pwrap'];
} elseif ( $ret[$i]['pwrap'] !== $v['pwrap'] && $v['pwrap'] !== null ) {
// @phan-suppress-previous-line PhanTypeInvalidDimOffset
// @phan-suppress-next-line PhanTypeInvalidDimOffset
DOMDataUtils::getDataParsoid( $ret[$i]['node'] )->autoInsertedEnd = true;
$cnode = $n->cloneNode();
$cnode->removeAttribute( DOMDataUtils::DATA_OBJECT_ATTR_NAME );
Expand Down
2 changes: 2 additions & 0 deletions src/Wt2Html/TT/WikiLinkHandler.php
Expand Up @@ -1380,6 +1380,7 @@ private function renderFile( Token $token, stdClass $target ) {

// Handle image default sizes and upright option after extracting all
// options
// @phan-suppress-next-line PhanRedundantCondition
if ( !empty( $opts['format'] ) && $opts['format']['v'] === 'framed' ) {
// width and height is ignored for framed images
// https://phabricator.wikimedia.org/T64258
Expand Down Expand Up @@ -1431,6 +1432,7 @@ private function renderFile( Token $token, stdClass $target ) {
$containerName = $isInline ? 'figure-inline' : 'figure';

$classes = $wrapperInfo['classes'];
// @phan-suppress-next-line PhanRedundantCondition
if ( !empty( $opts['class'] ) ) {
$classes = array_merge( $classes, explode( ' ', $opts['class']['v'] ) );
}
Expand Down

0 comments on commit 56a09e4

Please sign in to comment.