Skip to content

Commit

Permalink
Merge pull request #36 from stellarwp/bugfix/proper-throws-tags
Browse files Browse the repository at this point in the history
Add throws tags and better generics
  • Loading branch information
defunctl authored Feb 26, 2025
2 parents 979344c + dd9d003 commit 03a57b4
Show file tree
Hide file tree
Showing 13 changed files with 3,202 additions and 769 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Configure PHP environment
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
extensions: mbstring, intl
coverage: none
- uses: ramsey/composer-install@v2
- uses: ramsey/composer-install@v3
with:
composer-options: "--ignore-platform-reqs --optimize-autoloader"
- name: Run PHPStan static analysis
Expand Down
24 changes: 8 additions & 16 deletions .github/workflows/tests-php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 1000
submodules: recursive
# ------------------------------------------------------------------------------
# Checkout slic
# ------------------------------------------------------------------------------
- name: Checkout slic
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
repository: stellarwp/slic
ref: main
path: slic
fetch-depth: 1
# ------------------------------------------------------------------------------
# Prepare our composer cache directory
# ------------------------------------------------------------------------------
- name: Get Composer Cache Directory
id: get-composer-cache-dir
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v2
id: composer-cache
with:
path: ${{ steps.get-composer-cache-dir.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-

# ------------------------------------------------------------------------------
# Initialize slic
# ------------------------------------------------------------------------------
Expand All @@ -46,14 +33,17 @@ jobs:
echo "SLIC_BIN=${GITHUB_WORKSPACE}/slic/slic" >> $GITHUB_ENV
echo "SLIC_WP_DIR=${GITHUB_WORKSPACE}/slic/_wordpress" >> $GITHUB_ENV
echo "SLIC_WORDPRESS_DOCKERFILE=Dockerfile.base" >> $GITHUB_ENV
- name: Set run context for slic
run: echo "SLIC=1" >> $GITHUB_ENV && echo "CI=1" >> $GITHUB_ENV
- name: Start ssh-agent
run: |
mkdir -p "${HOME}/.ssh";
ssh-agent -a /tmp/ssh_agent.sock;
- name: Export SSH_AUTH_SOCK env var
run: echo "SSH_AUTH_SOCK=/tmp/ssh_agent.sock" >> $GITHUB_ENV

- name: Set up slic for CI
run: |
cd ${GITHUB_WORKSPACE}/..
Expand All @@ -65,9 +55,11 @@ jobs:
${SLIC_BIN} debug on
${SLIC_BIN} info
${SLIC_BIN} config
- name: Set up StellarWP Schema
run: |
${SLIC_BIN} use schema
${SLIC_BIN} composer install --ignore-platform-reqs
- name: Run suite tests
run: ${SLIC_BIN} run ${{ matrix.suite }} --ext DotReporter
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@
"codeception/module-webdriver": "^1.0",
"codeception/util-universalframework": "^1.0",
"lucatume/di52": "^3.0",
"lucatume/wp-browser": "^3.0.14",
"lucatume/wp-browser": "^3.0 < 3.5",
"phpunit/phpunit": "~6.0",
"stellarwp/db": "^1.0",
"stellarwp/db": "^1.1",
"symfony/event-dispatcher-contracts": "^2.5.1",
"symfony/string": "^5.4",
"szepeviktor/phpstan-wordpress": "^1.1"
"szepeviktor/phpstan-wordpress": "^1.1",
"php-stubs/wp-cli-stubs": "^2.11"
},
"minimum-stability": "stable",
"autoload": {
Expand Down
Loading

0 comments on commit 03a57b4

Please sign in to comment.