Skip to content

Commit

Permalink
Add explicit dependency definitions for automattic/jetpack-mu-wpcom (#…
Browse files Browse the repository at this point in the history
…37035)

* Add explicit dependency definitions for jetpack-mu-wpcom

* changelog

* Update composer.lock

* changelog

* changelog

* Update phan config.php

* Add automattic/jetpack-blocks to jetpack-mu-wpcom dependencies

* Remove unnecessary is_callable check
  • Loading branch information
ice9js authored Apr 24, 2024
1 parent 90dd832 commit eac1086
Show file tree
Hide file tree
Showing 10 changed files with 784 additions and 38 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: fixed
Comment: Updated docblock type definition to match the code.


12 changes: 5 additions & 7 deletions projects/packages/jetpack-mu-wpcom/.phan/baseline.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
// PhanTypeMismatchArgumentProbablyReal : 50+ occurrences
// PhanTypeMismatchArgument : 30+ occurrences
// PhanTypeArraySuspicious : 25+ occurrences
// PhanUndeclaredClassMethod : 15+ occurrences
// PhanUndeclaredTypeParameter : 15+ occurrences
// PhanPluginDuplicateConditionalNullCoalescing : 8 occurrences
// PhanTypeMismatchReturnProbablyReal : 7 occurrences
// PhanUndeclaredTypeReturnType : 6 occurrences
// PhanTypeMismatchReturn : 5 occurrences
// PhanUndeclaredClassMethod : 4 occurrences
// PhanNoopNew : 3 occurrences
// PhanUndeclaredFunction : 3 occurrences
// PhanUndeclaredTypeProperty : 3 occurrences
Expand All @@ -27,7 +27,6 @@
// PhanTypeMismatchArgumentInternal : 2 occurrences
// PhanTypeMismatchDefault : 2 occurrences
// PhanTypeMissingReturn : 2 occurrences
// PhanUndeclaredClassInCallable : 2 occurrences
// PhanUndeclaredFunctionInCallable : 2 occurrences
// PhanDeprecatedFunction : 1 occurrence
// PhanImpossibleTypeComparison : 1 occurrence
Expand All @@ -42,7 +41,7 @@
// PhanTypeMismatchReturnNullable : 1 occurrence
// PhanTypeNonVarPassByRef : 1 occurrence
// PhanTypeVoidArgument : 1 occurrence
// PhanUndeclaredClassReference : 1 occurrence
// PhanUndeclaredClassInCallable : 1 occurrence
// PhanUndeclaredConstant : 1 occurrence
// PhanUnextractableAnnotationSuffix : 1 occurrence

Expand All @@ -58,15 +57,14 @@
'src/features/coming-soon/fallback-coming-soon-page.php' => ['PhanTypeMismatchArgument', 'PhanTypeVoidArgument'],
'src/features/error-reporting/error-reporting.php' => ['PhanPluginDuplicateConditionalNullCoalescing'],
'src/features/launchpad/class-launchpad-task-lists.php' => ['PhanNoopArrayAccess', 'PhanPluginDuplicateConditionalNullCoalescing', 'PhanTypeArraySuspicious', 'PhanTypeMismatchArgument', 'PhanTypeMismatchDefault', 'PhanTypeMismatchProperty', 'PhanTypeMismatchReturn', 'PhanTypeMismatchReturnProbablyReal', 'PhanUndeclaredTypeParameter', 'PhanUndeclaredTypeProperty', 'PhanUndeclaredTypeReturnType'],
'src/features/launchpad/launchpad-task-definitions.php' => ['PhanRedundantCondition', 'PhanTypeArraySuspiciousNullable', 'PhanTypeComparisonToArray', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentInternal', 'PhanTypeMismatchReturn', 'PhanTypeMismatchReturnProbablyReal', 'PhanTypeMissingReturn', 'PhanUndeclaredClassInCallable', 'PhanUndeclaredClassMethod', 'PhanUndeclaredTypeParameter'],
'src/features/launchpad/launchpad-task-definitions.php' => ['PhanRedundantCondition', 'PhanTypeArraySuspiciousNullable', 'PhanTypeComparisonToArray', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentInternal', 'PhanTypeMismatchReturn', 'PhanTypeMismatchReturnProbablyReal', 'PhanTypeMissingReturn'],
'src/features/launchpad/launchpad.php' => ['PhanTypeArraySuspiciousNullable', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchReturn', 'PhanTypeMismatchReturnProbablyReal', 'PhanUndeclaredClassMethod', 'PhanUndeclaredTypeParameter', 'PhanUndeclaredTypeReturnType'],
'src/features/marketplace-products-updater/class-marketplace-products-updater.php' => ['PhanTypeMismatchDimFetch', 'PhanTypeMismatchReturn', 'PhanUndeclaredClassMethod', 'PhanUndeclaredClassReference', 'PhanUnextractableAnnotationSuffix'],
'src/features/marketplace-products-updater/class-marketplace-products-updater.php' => ['PhanTypeMismatchDimFetch', 'PhanTypeMismatchReturn', 'PhanUnextractableAnnotationSuffix'],
'src/features/media/heif-support.php' => ['PhanPluginSimplifyExpressionBool'],
'src/features/verbum-comments/class-verbum-comments.php' => ['PhanImpossibleTypeComparison', 'PhanNoopNew', 'PhanParamTooMany', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchReturn', 'PhanUndeclaredFunction', 'PhanUndeclaredTypeReturnType'],
'src/features/wpcom-command-palette/wpcom-command-palette.php' => ['PhanUndeclaredClassMethod'],
'src/features/wpcom-endpoints/class-wpcom-rest-api-v2-endpoint-launchpad.php' => ['PhanPluginDuplicateConditionalNullCoalescing'],
'src/features/wpcom-endpoints/class-wpcom-rest-api-v2-endpoint-site-migration-migrate-guru-key.php' => ['PhanUndeclaredClassMethod'],
'src/features/wpcom-site-menu/wpcom-site-menu.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredClassInCallable', 'PhanUndeclaredClassMethod', 'PhanUndeclaredFunctionInCallable'],
'src/features/wpcom-site-menu/wpcom-site-menu.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredClassInCallable', 'PhanUndeclaredFunctionInCallable'],
'tests/lib/functions-wordpress.php' => ['PhanRedefineFunction'],
'tests/php/features/block-patterns/class-wpcom-block-patterns-from-api-test.php' => ['PhanDeprecatedFunction', 'PhanTypeMismatchArgumentProbablyReal'],
'tests/php/features/coming-soon/class-coming-soon-test.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal'],
Expand Down
1 change: 0 additions & 1 deletion projects/packages/jetpack-mu-wpcom/.phan/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
array(
'+stubs' => array( 'full-site-editing', 'photon-opencv', 'wpcom' ),
'parse_file_list' => array(
"$root/projects/packages/stats-admin/src/class-dashboard.php",
"$root/projects/plugins/jetpack/class-jetpack-stats-dashboard-widget.php",
),
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Update automattic/jetpack-mu-wpcom's dependencies to explicitly reflect the current state.
4 changes: 4 additions & 0 deletions projects/packages/jetpack-mu-wpcom/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
"require": {
"php": ">=7.0",
"automattic/jetpack-assets": "@dev",
"automattic/jetpack-blocks": "@dev",
"automattic/jetpack-connection": "@dev",
"automattic/jetpack-redirect": "@dev",
"automattic/jetpack-stats-admin": "@dev",
"automattic/jetpack-status": "@dev",
"automattic/scheduled-updates": "@dev"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2388,7 +2388,7 @@ function wpcom_launchpad_edit_page_check( $post_id, $post ) {
* @return bool True if we should show the task, false otherwise.
*/
function wpcom_launchpad_is_add_subscribe_block_visible() {
return is_callable( array( '\Automattic\Jetpack\Blocks', 'is_fse_theme' ) ) && \Automattic\Jetpack\Blocks::is_fse_theme();
return \Automattic\Jetpack\Blocks::is_fse_theme();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion projects/packages/jitm/.phan/baseline.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
// # Issue statistics:
// PhanTypeExpectedObjectPropAccess : 3 occurrences
// PhanTypeMismatchReturn : 2 occurrences
// PhanUndeclaredMethod : 2 occurrences
// PhanPluginSimplifyExpressionBool : 1 occurrence
// PhanTypeInvalidDimOffset : 1 occurrence
// PhanTypeMismatchArgument : 1 occurrence
// PhanTypeMismatchArgumentProbablyReal : 1 occurrence
// PhanUndeclaredMethod : 1 occurrence
// PhanUnreferencedUseNormal : 1 occurrence

// Currently, file_suppressions and directory_suppressions are the only supported suppressions
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: fixed
Comment: Updated phan baseline.


Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: fixed
Comment: Internal dependency updates.


Loading

0 comments on commit eac1086

Please sign in to comment.