Skip to content

Commit

Permalink
[wpmlbridge-296] Enable automatic PHPStan analysis.
Browse files Browse the repository at this point in the history
  • Loading branch information
decodekult committed Apr 1, 2024
1 parent 6c63547 commit 50389c4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: OTGS PHP UNIT
run-name: PHP Unit at ${{ github.ref_name }}
name: OTGS PHP TEST
run-name: PHP TEST at ${{ github.ref_name }}

on: [push, pull_request]

Expand All @@ -20,5 +20,8 @@ jobs:
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest

- name: Run test suite
- name: Run unit test suite
run: ./vendor/bin/phpunit

- name: Run static test suite
run: ./vendor/bin/phpstan
9 changes: 5 additions & 4 deletions tests/phpstan/stubs/elasticpress.stub
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace ElasticPress {
* @param array<string,mixed> $assocArgs
*/
function index( $args, $assoc_args ) {}

}

class Feature {
Expand Down Expand Up @@ -150,7 +151,7 @@ namespace ElasticPress {

class Indexable {

/** @var SyncManager */
/** @var SyncManager */
public $sync_manager;

/**
Expand Down Expand Up @@ -196,14 +197,14 @@ namespace ElasticPress {
* @param array $args Arguments.
*/
public function full_index( $args ) {}

}

}

namespace ElasticPress\StatusReport {

class Report {

}
class Report {}

class Indices {

Expand Down
2 changes: 2 additions & 0 deletions tests/phpstan/stubs/wp-cli.stub
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

namespace {

class WP_CLI {

/**
Expand All @@ -25,6 +26,7 @@ namespace {
public static function add_command( string $name, mixed $callable, array $args = [] ): bool {}

}

}

namespace WP_CLI\Utils {
Expand Down

0 comments on commit 50389c4

Please sign in to comment.