Skip to content

Commit b614497

Browse files
authored
fix dependencies to have 7.1 compatible build (#1228)
* add assertions in test methods without assertions * loosen dependencies so 7.0 & 7.1 builds can succeed * fix some scrutinizer errors * update release date
1 parent fce1bf2 commit b614497

File tree

23 files changed

+110
-113
lines changed

23 files changed

+110
-113
lines changed

.scrutinizer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ tools:
1515
ruleset: phpmd.xml.dist
1616
external_code_coverage:
1717
enabled: true
18-
timeout: 900
18+
timeout: 1200
1919
php_cpd: true
2020
# php_sim: # Temporarily disabled to allow focus on things other than duplicates
2121
# min_mass: 40

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ php:
99
- 5.6
1010
- 7.0
1111
- 7.1
12+
- 7.2
1213

1314
matrix:
1415
include:
1516
- php: 5.6
1617
env: COVERAGE=1
1718
allow_failures:
18-
- php: 7.0
19-
- php: 7.1
19+
- php: 7.2
2020

2121
cache:
2222
directories:

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ Change Log
33
All notable changes to this project will be documented in this file.
44
This project adheres to [Semantic Versioning](http://semver.org/).
55

6-
v0.14.0 (28 Dec 2017)
6+
v0.14.0 (29 Dec 2017)
77
----------------------
88
This release fixes several bugs and adds some new features.
9-
This is the last version to support PHP 5.3
9+
This version brings compatibility with PHP 7.0 & 7.1
1010

1111
### Added
1212
- Possibility to control the footnote numbering - @troosan #1068

composer.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,23 +46,22 @@
4646
]
4747
},
4848
"require": {
49-
"php": ">=5.3.3",
49+
"php": "^5.3.3 || ^7.0",
5050
"ext-xml": "*",
5151
"zendframework/zend-escaper": "^2.2",
5252
"zendframework/zend-stdlib": "^2.2 || ^3.0",
5353
"phpoffice/common": "^0.2"
5454
},
5555
"require-dev": {
56-
"phpunit/phpunit": "^4.8.36",
56+
"phpunit/phpunit": "^4.8.36 || ^5.0",
5757
"phpdocumentor/phpdocumentor":"2.*",
58-
"twig/twig":"1.27",
5958
"squizlabs/php_codesniffer": "^2.7",
6059
"friendsofphp/php-cs-fixer": "^2.0",
6160
"phpmd/phpmd": "2.*",
62-
"phploc/phploc": "2.*",
61+
"phploc/phploc": "2.* || 3.* || 4.*",
6362
"dompdf/dompdf":"0.8.*",
6463
"tecnickcom/tcpdf": "6.*",
65-
"mpdf/mpdf": "5.*"
64+
"mpdf/mpdf": "5.* || 6.* || 7.*"
6665
},
6766
"suggest": {
6867
"ext-zip": "Allows writing OOXML and ODF",

docs/ISSUE_TEMPLATE.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,35 @@
1-
Issue tracker is **ONLY** used for reporting bugs. NO NEW FEATURE ACCEPTED! Use [stackoverflow](https://stackoverflow.com/questions/tagged/phpword) for supporting issues.
1+
This is:
2+
3+
- [ ] a bug report
4+
- [ ] a feature request
5+
- [ ] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpword)
26

37
# Expected Behavior
48

59
Please describe the behavior you are expecting.
610

7-
# Current Behavior
11+
### Current Behavior
812

913
What is the current behavior?
1014

11-
# Failure Information
15+
### Failure Information
1216

1317
Please help provide information about the failure.
1418

15-
## How to Reproduce
19+
### How to Reproduce
1620

1721
Please provide a code sample that reproduces the issue.
1822

1923
```php
24+
<?php
25+
require __DIR__ . '/vendor/autoload.php';
26+
2027
$phpWord = new \PhpOffice\PhpWord\PhpWord();
2128
$section = $phpWord->addSection();
2229
$section->...
2330
```
2431

25-
## Context
32+
### Context
2633

2734
* PHP version:
2835
* PHPWord version: 0.14

docs/PULL_REQUEST_TEMPLATE.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
# Description
1+
### Description
22

33
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.
44

55
Fixes # (issue)
66

7-
# Checklist:
7+
### Checklist:
88

9-
- [ ] I have commented my code, particularly in hard-to-understand areas
10-
- [ ] I have run phpunit, phpcs, php-cs-fixer, phpmd
9+
- [ ] I have run `composer check` and no errors were reported
1110
- [ ] The new code is covered by unit tests
1211
- [ ] I have update the documentation to describe the changes

run_tests.sh

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/PhpWord/Element/AbstractElement.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ public function setElementIndex($value)
228228
/**
229229
* Get element unique ID
230230
*
231-
* @return int
231+
* @return string
232232
*/
233233
public function getElementId()
234234
{
@@ -425,18 +425,18 @@ protected function setNewStyle($styleObject, $styleValue = null, $returnObject =
425425
/**
426426
* Set enum value
427427
*
428-
* @param mixed $value
429-
* @param array $enum
430-
* @param mixed $default
428+
* @param string|null $value
429+
* @param string[] $enum
430+
* @param string|null $default
431431
*
432432
* @throws \InvalidArgumentException
433-
* @return mixed
433+
* @return string|null
434434
*
435435
* @todo Merge with the same method in AbstractStyle
436436
*/
437437
protected function setEnumVal($value = null, $enum = array(), $default = null)
438438
{
439-
if ($value != null && trim($value) != '' && !empty($enum) && !in_array($value, $enum)) {
439+
if ($value !== null && trim($value) != '' && !empty($enum) && !in_array($value, $enum)) {
440440
throw new \InvalidArgumentException("Invalid style value: {$value}");
441441
} elseif ($value === null || trim($value) == '') {
442442
$value = $default;

src/PhpWord/Element/Field.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ public function getOptions()
211211
* @throws \InvalidArgumentException
212212
* @return null|string|TextRun
213213
*/
214-
public function setText($text)
214+
public function setText($text = null)
215215
{
216216
if (isset($text)) {
217217
if (is_string($text) || $text instanceof TextRun) {

src/PhpWord/Element/TrackChange.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ public function __construct($author, \DateTime $date = null)
5252
{
5353
$this->author = $author;
5454
$this->date = $date;
55-
56-
return $this;
5755
}
5856

5957
/**

0 commit comments

Comments
 (0)