-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update requirement to PHP 7.2 #1951
Changes from all commits
f4f3988
d068664
37a5088
5fdf567
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,7 +58,7 @@ | |
"fix": "Fixes issues found by PHP-CS" | ||
}, | ||
"require": { | ||
"php": "^5.3.3 || ^7.0", | ||
"php": "^7.2", | ||
"ext-xml": "*", | ||
"zendframework/zend-escaper": "^2.2", | ||
"phpoffice/common": "^0.2.9" | ||
|
@@ -67,13 +67,14 @@ | |
"ext-zip": "*", | ||
"ext-gd": "*", | ||
"phpunit/phpunit": "^4.8.36 || ^7.0", | ||
"squizlabs/php_codesniffer": "^2.9", | ||
"squizlabs/php_codesniffer": "^3.5", | ||
"friendsofphp/php-cs-fixer": "^2.2", | ||
"phpmd/phpmd": "2.*", | ||
"phploc/phploc": "2.* || 3.* || 4.*", | ||
"phploc/phploc": "2.* || 3.* || 4.* || 5.*", | ||
"dompdf/dompdf":"0.8.*", | ||
"tecnickcom/tcpdf": "6.*", | ||
"mpdf/mpdf": "5.7.4 || 6.* || 7.*", | ||
"mpdf/mpdf": "7.* || 8.*", | ||
"rector/rector": "^0.8", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You only used rector library for conversion. Now, in my opinion, not needed as require-dev, including the following rector.php file. Remove it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In think this could be useful to add other rules as well. See Rector as a phpcsfixer-like tool. Thanks for the feedback, I'll work on it as soon as your PR has been merged. |
||
"php-coveralls/php-coveralls": "1.1.0 || ^2.0" | ||
}, | ||
"suggest": { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove file, explained above. |
||
|
||
declare(strict_types=1); | ||
|
||
use Rector\Core\Configuration\Option; | ||
use Rector\Set\ValueObject\SetList; | ||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; | ||
|
||
return static function (ContainerConfigurator $containerConfigurator) : void { | ||
$parameters = $containerConfigurator->parameters(); | ||
|
||
$parameters->set(Option::SETS, [ | ||
SetList::PHP_52, | ||
SetList::PHP_53, | ||
SetList::PHP_54, | ||
SetList::PHP_55, | ||
SetList::PHP_56, | ||
SetList::PHP_70, | ||
SetList::PHP_71, | ||
SetList::PHP_72, | ||
]); | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -217,7 +217,7 @@ private function addHeaderFooter($type = Header::AUTO, $header = true) | |
$collection = &$this->$collectionArray; | ||
|
||
if (in_array($type, array(Header::AUTO, Header::FIRST, Header::EVEN))) { | ||
$index = count($collection); | ||
$index = is_countable($collection) ? count($collection) : 0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why |
||
/** @var \PhpOffice\PhpWord\Element\AbstractContainer $container Type hint */ | ||
$container = new $containerClass($this->sectionId, ++$index, $type); | ||
$container->setPhpWord($this->phpWord); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,17 +29,17 @@ class Settings | |
* | ||
* @const string | ||
*/ | ||
const ZIPARCHIVE = 'ZipArchive'; | ||
const PCLZIP = 'PclZip'; | ||
const OLD_LIB = 'PhpOffice\\PhpWord\\Shared\\ZipArchive'; // @deprecated 0.11 | ||
const ZIPARCHIVE = \ZipArchive::class; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Class |
||
const PCLZIP = \PclZip::class; | ||
const OLD_LIB = \PhpOffice\PhpWord\Shared\ZipArchive::class; // @deprecated 0.11 | ||
|
||
/** | ||
* PDF rendering libraries | ||
* | ||
* @const string | ||
*/ | ||
const PDF_RENDERER_DOMPDF = 'DomPDF'; | ||
const PDF_RENDERER_TCPDF = 'TCPDF'; | ||
const PDF_RENDERER_TCPDF = \TCPDF::class; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This contant is not a class designation. Class |
||
const PDF_RENDERER_MPDF = 'MPDF'; | ||
|
||
/** | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's ambiguous. I would rather give a specific version number as before -
PHP 7.2+