From b4e54733797de13c6a094dcc4686c50c0762763b Mon Sep 17 00:00:00 2001 From: Renan Date: Mon, 21 Aug 2023 22:12:03 +0200 Subject: [PATCH] keep pandoc as dev dependency --- .github/workflows/static-analysis.yaml | 3 --- .github/workflows/tests.yaml | 8 +++++--- composer.json | 3 ++- src/Processor/LatexToUnicodeProcessor.php | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/static-analysis.yaml b/.github/workflows/static-analysis.yaml index 23c816e..bc691b6 100644 --- a/.github/workflows/static-analysis.yaml +++ b/.github/workflows/static-analysis.yaml @@ -29,9 +29,6 @@ jobs: - name: Install Composer dependencies uses: ramsey/composer-install@v2 - - name: Install Pandoc wrapper - run: composer require ueberdosis/pandoc - - name: Cache PHPStan uses: actions/cache@v2 with: diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index da76536..3349d6e 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -18,12 +18,11 @@ jobs: fail-fast: false matrix: php-version: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2'] - pandoc-wrapper: ['ryakad/pandoc-php'] include: - php-version: '8.0' coverage: true - php-version: '8.2' - pandoc-wrapper: 'ueberdosis/pandoc' + with-ueberdosis-pandoc: true steps: @@ -43,7 +42,10 @@ jobs: uses: ramsey/composer-install@v2 - name: Install Pandoc wrapper - run: composer require ${{ matrix.pandoc-wrapper }} + if: ${{ matrix.with-ueberdosis-pandoc }} + run: | + composer remove ryakad/pandoc-php + composer require ueberdosis/pandoc - name: Run PHPUnit run: vendor/bin/phpunit --testdox ${{ matrix.coverage && '--coverage-clover ./coverage.xml' || '--no-coverage' }} diff --git a/composer.json b/composer.json index d3136ee..2bbbabc 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,8 @@ "php": ">=5.6.0" }, "require-dev": { - "phpunit/phpunit": ">=5.7" + "phpunit/phpunit": ">=5.7", + "ryakad/pandoc-php": "^1.0" }, "suggest": { "ryakad/pandoc-php": "Needed to support LaTeX decoder in class RenanBr\\BibTexParser\\Processor\\LatexToUnicodeProcessor", diff --git a/src/Processor/LatexToUnicodeProcessor.php b/src/Processor/LatexToUnicodeProcessor.php index 7413e8a..f5eec61 100644 --- a/src/Processor/LatexToUnicodeProcessor.php +++ b/src/Processor/LatexToUnicodeProcessor.php @@ -80,6 +80,7 @@ private function getConverter() $pandoc = new Pandoc(); return $this->converter = static function ($text) use ($pandoc) { + // @phpstan-ignore-next-line return mb_substr($pandoc->input($text)->execute([ '--from', 'latex', '--to', 'plain', @@ -90,7 +91,6 @@ private function getConverter() $pandoc = new Pandoc(); return $this->converter = static function ($text) use ($pandoc) { - // @phpstan-ignore-next-line return $pandoc->runWith($text, [ 'from' => 'latex', 'to' => 'plain',