Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

explat: Fix Phan issues #39443

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions projects/packages/explat/.phan/baseline.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,9 @@
* (can be combined with --load-baseline)
*/
return [
// # Issue statistics:
// PhanTypeArraySuspicious : 3 occurrences
// PhanTypeMismatchReturn : 3 occurrences
// PhanUndeclaredTypeParameter : 1 occurrence
// PhanUndeclaredTypeReturnType : 1 occurrence

// This baseline has no suppressions
// Currently, file_suppressions and directory_suppressions are the only supported suppressions
'file_suppressions' => [
'src/class-rest-controller.php' => ['PhanTypeArraySuspicious', 'PhanTypeMismatchReturn', 'PhanUndeclaredTypeParameter', 'PhanUndeclaredTypeReturnType'],
],
// 'directory_suppressions' => ['src/directory_name' => ['PhanIssueName1', 'PhanIssueName2']] can be manually added if needed.
// (directory_suppressions will currently be ignored by subsequent calls to --save-baseline, but may be preserved in future Phan releases)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: fixed
Comment: Add missing `use` and one return type to fix Phan issues. No change to functionality.


4 changes: 3 additions & 1 deletion projects/packages/explat/src/class-rest-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
use Automattic\Jetpack\Connection\Client;
use Automattic\Jetpack\Connection\Manager as Jetpack_Connection;
use WP_Error;
use WP_REST_Request;
use WP_REST_Response;
use WP_REST_Server;

/**
Expand Down Expand Up @@ -71,7 +73,7 @@ public function register_rest_routes() {
* Get the assignments for a given experiment and anon_id
*
* @param WP_REST_Request $request The REST request object.
* @return WP_REST_Response
* @return WP_REST_Response|WP_Error
*/
public function get_assignments( $request ) {
$response = null;
Expand Down
Loading