Skip to content

Docker image to create a phpstan environment to check Shopware plugins

License

Notifications You must be signed in to change notification settings

aragon999/phpstan-shopware-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is this?

Use a prebuilt phpstan Docker image to analyse Shopware 6 plugins.

Usage

On local setups

docker run --rm -v /path/to/the/plugin:/app aragon999/phpstan-shopware:v6.4.0 analyze --level 5 .

In Github actions

This will use the latest stable Shopware release and the latest PHPStan release.

name: Run PHPStan

on:
  push:

jobs:
  phpstan:
    runs-on: ubuntu-latest

    steps:
      - name: Clone
        uses: actions/checkout@v2

      - name: Run PHPStan
        uses: aragon999/phpstan-shopware-docker@master

In Gitlab CI

Minimal setup

This will use the Shopware version v6.4.0:

image:
  name: aragon999/phpstan-shopware:v6.4.0
  entrypoint: [""]

lint:phpstan:
  script:
    - phpstan analyze .

With additional plugin dependencies

When the plugin depends on an additional plugin you need to install the plugin as well, here is a template which includes the Shopware migration plugin which has no publicly available composer packages but exists publicly on Github.

lint:phpstan:
  image:
    name: aragon999/phpstan-shopware:v6.4.0
    entrypoint: [""]
  script:
    - phpstan --version
    - composer global config github-oauth.github.com "${GITHUB_OAUTH_TOKEN}"
    - composer global config repositories.swag-migration-assistant vcs https://github.com/shopware/SwagMigrationAssistant.git
    - composer global require swag/migration-assistant:master@dev
    - phpstan analyze .

Note that you need to add the GITHUB_OAUTH_TOKEN as secret.

About

Docker image to create a phpstan environment to check Shopware plugins

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published