Support for PHP7.1 (min.)
This commit is contained in:
parent
c467fe02d3
commit
c3e34a0d24
|
|
@ -8,6 +8,9 @@ jobs:
|
|||
strategy:
|
||||
matrix:
|
||||
php-version:
|
||||
- "7.1"
|
||||
- "7.2"
|
||||
- "7.3"
|
||||
- "7.4"
|
||||
- "8.0"
|
||||
- "8.1"
|
||||
|
|
@ -76,42 +79,14 @@ jobs:
|
|||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||
restore-keys: ${{ runner.os }}-composer-
|
||||
|
||||
- name: Install dependencies
|
||||
run: composer install --no-progress --prefer-dist --optimize-autoloader
|
||||
- name: Composer Install
|
||||
run: composer global require friendsofphp/php-cs-fixer
|
||||
|
||||
- name: Add environment path
|
||||
run: export PATH="$PATH:$HOME/.composer/vendor/bin"
|
||||
|
||||
- name: Code style with PHP-CS-Fixer
|
||||
run: ./vendor/bin/php-cs-fixer fix --dry-run --show-progress=none --using-cache=no -v --format=checkstyle | cs2pr
|
||||
|
||||
phpcs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup PHP, with composer and extensions
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: 7.4
|
||||
extensions: ctype, dom, gd, iconv, fileinfo, libxml, mbstring, simplexml, xml, xmlreader, xmlwriter, zip, zlib
|
||||
coverage: none
|
||||
tools: cs2pr
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
|
||||
- name: Cache composer dependencies
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||
restore-keys: ${{ runner.os }}-composer-
|
||||
|
||||
- name: Install dependencies
|
||||
run: composer install --no-progress --prefer-dist --optimize-autoloader
|
||||
|
||||
- name: Code style with PHP_CodeSniffer
|
||||
run: ./vendor/bin/phpcs src/ tests/ --standard=PSR2 -n --ignore=src/PhpWord/Shared/PCLZip --report=checkstyle | cs2pr
|
||||
run: php-cs-fixer fix --dry-run --diff
|
||||
|
||||
coverage:
|
||||
runs-on: ubuntu-latest
|
||||
|
|
|
|||
|
|
@ -58,26 +58,23 @@
|
|||
"fix": "Fixes issues found by PHP-CS"
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.4 || ^8.0",
|
||||
"php": "^7.1|^8.0",
|
||||
"ext-dom": "*",
|
||||
"ext-json": "*",
|
||||
"ext-xml": "*",
|
||||
"laminas/laminas-escaper": "^2.10"
|
||||
"laminas/laminas-escaper": ">=2.6"
|
||||
},
|
||||
"require-dev": {
|
||||
"ext-zip": "*",
|
||||
"ext-gd": "*",
|
||||
"ext-libxml": "*",
|
||||
"dompdf/dompdf": "^2.0",
|
||||
"friendsofphp/php-cs-fixer": "^3.11",
|
||||
"mpdf/mpdf": "^8.1",
|
||||
"php-coveralls/php-coveralls": "^2.5",
|
||||
"phploc/phploc": "^7.0",
|
||||
"phpmd/phpmd": "^2.13",
|
||||
"phpunit/phpunit": "^9.5",
|
||||
"squizlabs/php_codesniffer": "^3.7",
|
||||
"phpunit/phpunit": ">=7.0",
|
||||
"tecnickcom/tcpdf": "^6.5",
|
||||
"symfony/process": "^5.4"
|
||||
"symfony/process": "^4.4"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-zip": "Allows writing OOXML and ODF",
|
||||
|
|
|
|||
|
|
@ -501,15 +501,15 @@ HTML;
|
|||
public function testParseTableStyleAttributeInlineStyle(): void
|
||||
{
|
||||
$phpWord = new PhpWord();
|
||||
$section = $phpWord->addSection();
|
||||
$section = $phpWord->addSection([
|
||||
'orientation' => \PhpOffice\PhpWord\Style\Section::ORIENTATION_LANDSCAPE,
|
||||
]);
|
||||
|
||||
$html = <<<HTML
|
||||
<table style="background-color:red;width:100%;" bgColor="lightgreen" width="50%">
|
||||
<tr>
|
||||
<td>A</td>
|
||||
</tr>
|
||||
</table>
|
||||
HTML;
|
||||
$html = '<table style="background-color:red;width:100%;" bgColor="lightgreen" width="50%">
|
||||
<tr>
|
||||
<td>A</td>
|
||||
</tr>
|
||||
</table>';
|
||||
|
||||
Html::addHtml($section, $html);
|
||||
$doc = TestHelperDOCX::getDocument($phpWord, 'Word2007');
|
||||
|
|
|
|||
|
|
@ -408,7 +408,7 @@ class DocumentTest extends \PHPUnit\Framework\TestCase
|
|||
// behind
|
||||
$element = $doc->getElement('/w:document/w:body/w:p[2]/w:r/w:pict/v:shape');
|
||||
$style = $element->getAttribute('style');
|
||||
self::assertMatchesRegularExpression('/z\-index:\-[0-9]*/', $style);
|
||||
self::assertRegExp('/z\-index:\-[0-9]*/', $style);
|
||||
|
||||
// square
|
||||
$element = $doc->getElement('/w:document/w:body/w:p[4]/w:r/w:pict/v:shape/w10:wrap');
|
||||
|
|
|
|||
Loading…
Reference in New Issue