diff --git a/.github/workflows/test-application.yaml b/.github/workflows/test-application.yaml index aa8584c59..afc9796dc 100644 --- a/.github/workflows/test-application.yaml +++ b/.github/workflows/test-application.yaml @@ -9,7 +9,7 @@ on: jobs: test: - name: "Run tests with php ${{ matrix.php-version }} and elasticsearch ${{ matrix.elasticsearch-version }} (${{ matrix.phpcr-transport }})" + name: "PHP ${{ matrix.php-version }} (elasticsearch ${{ matrix.elasticsearch-version }}, ${{ matrix.phpcr-transport }}, ${{ matrix.dependency-versions }})" runs-on: ubuntu-latest env: @@ -29,7 +29,7 @@ jobs: elasticsearch-version: '5.6' elasticsearch-package-constraint: '~5.5' phpcr-transport: doctrinedbal - composer-flags: '--prefer-lowest --prefer-dist --no-interaction' + dependency-versions: 'lowest' php-extensions: 'ctype, iconv, mysql, gd' tools: 'composer:v1' php-cs-fixer: false @@ -43,7 +43,7 @@ jobs: elasticsearch-version: '7.9' elasticsearch-package-constraint: '~7.9.0' phpcr-transport: jackrabbit - composer-flags: '--prefer-dist --no-interaction' + dependency-versions: 'highest' php-extensions: 'ctype, iconv, mysql, imagick' tools: 'composer:v2' php-cs-fixer: true @@ -104,33 +104,20 @@ jobs: tools: ${{ matrix.tools }} coverage: none - - name: Get composer cache directory - id: composer-cache-dir - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: Cache dependencies - uses: actions/cache@v2 - id: composer-cache - with: - path: ${{ steps.composer-cache-dir.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('composer.json', 'composer.lock') }} - restore-keys: | - ${{ runner.os }}-composer- - - - name: Run php-cs-fixer - if: ${{ matrix.php-cs-fixer }} - run: | - composer global require friendsofphp/php-cs-fixer --prefer-dist --no-interaction - GLOBAL_BIN_DIR=$(composer global config bin-dir --absolute --quiet) - $GLOBAL_BIN_DIR/php-cs-fixer fix --dry-run --diff - - name: Require elasticsearch dependency run: composer require --dev elasticsearch/elasticsearch:"${{ matrix.elasticsearch-package-constraint }}" --no-interaction --no-update - - name: Install dependencies + - name: Install composer dependencies + uses: ramsey/composer-install@v1 + with: + dependency-versions: ${{matrix.dependency-versions}} + + - name: Run php-cs-fixer + if: ${{ matrix.php-cs-fixer }} run: | - composer validate - composer update ${{ matrix.composer-flags }} + composer global require friendsofphp/php-cs-fixer --prefer-dist --no-interaction + GLOBAL_BIN_DIR=$(composer global config bin-dir --absolute --quiet) + $GLOBAL_BIN_DIR/php-cs-fixer fix --dry-run --diff - name: Clear parameters.yml file to use environment variables run: echo "parameters:" > Tests/app/config/parameters.yml diff --git a/Controller/ArticleController.php b/Controller/ArticleController.php index fbbbbae34..d52cc7236 100644 --- a/Controller/ArticleController.php +++ b/Controller/ArticleController.php @@ -49,11 +49,11 @@ */ class ArticleController extends RestController implements ClassResourceInterface, SecuredControllerInterface { - const DOCUMENT_TYPE = 'article'; - use RequestParametersTrait; use ArticleViewDocumentIdTrait; + const DOCUMENT_TYPE = 'article'; + /** * Create field-descriptor array. * diff --git a/Controller/ArticlePageController.php b/Controller/ArticlePageController.php index ab6732e42..baedbc83c 100644 --- a/Controller/ArticlePageController.php +++ b/Controller/ArticlePageController.php @@ -32,10 +32,10 @@ */ class ArticlePageController extends RestController implements ClassResourceInterface, SecuredControllerInterface { - const DOCUMENT_TYPE = 'article_page'; - use RequestParametersTrait; + const DOCUMENT_TYPE = 'article_page'; + /** * Returns single article-page. * diff --git a/Document/Serializer/ArticleSubscriber.php b/Document/Serializer/ArticleSubscriber.php index 8326898d1..268d32513 100644 --- a/Document/Serializer/ArticleSubscriber.php +++ b/Document/Serializer/ArticleSubscriber.php @@ -27,12 +27,11 @@ */ class ArticleSubscriber implements EventSubscriberInterface { - const PAGE_TITLE_TAG_NAME = 'sulu_article.page_title'; + use StructureTagTrait; + const PAGE_TITLE_TAG_NAME = 'sulu_article.page_title'; const PAGE_TITLE_PROPERTY_NAME = 'pageTitle'; - use StructureTagTrait; - /** * @var StructureManagerInterface */