Skip to content

Commit 7db4b89

Browse files
committed
Improvements
- Bump minimum PHP version - Upgrade dependencies - Improve code style - Github actions
1 parent 70ece9b commit 7db4b89

26 files changed

Lines changed: 276 additions & 410 deletions
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: "Coding Standards"
2+
3+
on: ["pull_request", "push"]
4+
5+
jobs:
6+
coding-standards:
7+
name: "Coding Standards"
8+
runs-on: "ubuntu-20.04"
9+
10+
strategy:
11+
matrix:
12+
php-version:
13+
- "7.4"
14+
15+
steps:
16+
- name: "Checkout"
17+
uses: "actions/checkout@v2"
18+
19+
- name: "Install PHP"
20+
uses: "shivammathur/setup-php@v2"
21+
with:
22+
coverage: "none"
23+
php-version: "${{ matrix.php-version }}"
24+
tools: "cs2pr"
25+
26+
- name: "Install dependencies with Composer"
27+
uses: "ramsey/composer-install@v1"
28+
29+
# https://github.com/doctrine/.github/issues/3
30+
- name: "Run PHP_CodeSniffer"
31+
run: "vendor/bin/phpcs -q --no-colors --report=checkstyle | cs2pr"
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: "Continuous Integration"
2+
3+
on: ["pull_request", "push"]
4+
5+
jobs:
6+
phpunit:
7+
name: "PHPUnit"
8+
runs-on: "ubuntu-20.04"
9+
10+
strategy:
11+
matrix:
12+
php-version:
13+
- "7.4"
14+
deps:
15+
- "highest"
16+
17+
steps:
18+
- name: "Checkout"
19+
uses: "actions/checkout@v2"
20+
with:
21+
fetch-depth: 2
22+
23+
- name: "Install PHP"
24+
uses: "shivammathur/setup-php@v2"
25+
with:
26+
php-version: "${{ matrix.php-version }}"
27+
coverage: "pcov"
28+
ini-values: "zend.assertions=1"
29+
30+
- name: "Install dependencies with Composer"
31+
uses: "ramsey/composer-install@v1"
32+
with:
33+
dependency-versions: "${{ matrix.deps }}"
34+
35+
- name: "Run PHPUnit"
36+
run: "vendor/bin/phpunit"

.travis.yml

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

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
DOMPDFModule
22
============
33

4-
Master: [![Build Status](https://secure.travis-ci.org/netiul/DOMPDFModule.png?branch=master)](http://travis-ci.org/netiul/DOMPDFModule)
4+
Master: ![master](https://github.com/netiul/DOMPDFModule/workflows/Continuous%20Integration/badge.svg?branch=master)
55

66
The DOMPDF module integrates the DOMPDF library with Zend Framework 2 with minimal effort on the consumer's end.
77

88
## Requirements
9-
- [Zend Framework 2](http://www.github.com/zendframework/zf2)
9+
- [Laminas](https://getlaminas.org/)
1010

1111
## Installation
1212
Installation of DOMPDFModule uses PHP Composer. For more information about

build.sh

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

composer.json

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "netiul/dompdf-module",
33
"type": "library",
4-
"description": "A Zend Framework 2 module for incorporating DOMPDF support - Originally by Raymond Kolbe",
4+
"description": "A Laminas module for incorporating DOMPDF support - Originally by Raymond Kolbe",
55
"keywords": ["pdf","dompdf", "zf2"],
66
"license": "MIT",
77
"authors": [
@@ -14,28 +14,27 @@
1414
"dino/dompdf-module": "0.*"
1515
},
1616
"require": {
17-
"php": ">=5.6",
18-
"zendframework/zend-loader": "^2.4",
19-
"zendframework/zend-servicemanager": "^2.4 | ^3.0",
20-
"zendframework/zend-modulemanager": "^2.4",
21-
"zendframework/zend-eventmanager": "^2.4 | ^3.0",
22-
"zendframework/zend-view": "^2.4",
23-
"zendframework/zend-serializer": "^2.4",
24-
"zendframework/zend-log": "^2.4",
25-
"zendframework/zend-i18n": "^2.4",
26-
"zendframework/zend-http": "^2.4",
27-
"zendframework/zend-console": "^2.4",
17+
"php": ">=7.4",
18+
"laminas/laminas-loader": "^2.4.13",
19+
"laminas/laminas-servicemanager": "^3.5.1",
20+
"laminas/laminas-modulemanager": "^2.8.4",
21+
"laminas/laminas-eventmanager": "^3.2.1",
22+
"laminas/laminas-view": "^2.11.5",
23+
"laminas/laminas-serializer": "^2.9.1",
24+
"laminas/laminas-log": "^2.13.0",
25+
"laminas/laminas-i18n": "^2.11.0",
26+
"laminas/laminas-http": "^2.14.2",
27+
"laminas/laminas-console": "^2.8.0",
2828
"dompdf/dompdf": "^0.8.0"
2929
},
3030
"require-dev": {
31-
"phpunit/phpunit": "^4.8.27",
32-
"zendframework/zend-mvc": "^2.4 | ^3.0",
31+
"phpunit/phpunit": "^9.5.0",
32+
"laminas/laminas-mvc": "^3.2.0",
3333
"codeclimate/php-test-reporter": "^0.3.2",
34-
"fabpot/php-cs-fixer": "^1.12",
35-
"squizlabs/php_codesniffer": "^2.7",
36-
"phpmd/phpmd": "^2.4",
37-
"symfony/dependency-injection": "^3.0",
38-
"symfony/config": "^3.0"
34+
"symfony/dependency-injection": "^v3.4.47",
35+
"symfony/config": "^v3.4.47",
36+
"squizlabs/php_codesniffer": "^3.5",
37+
"slevomat/coding-standard": "^6.4"
3938
},
4039
"autoload": {
4140
"psr-4": {

config/module.config.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* @license http://www.opensource.org/licenses/mit-license.php MIT License
1818
*/
1919

20-
namespace DOMPDFModule;
20+
declare(strict_types=1);
2121

2222
return [
2323
'dompdf_module' => [
@@ -277,9 +277,14 @@
277277
'DOMPDF' => false
278278
],
279279
'factories' => [
280-
'DOMPDF' => __NAMESPACE__ . '\Service\DOMPDFFactory',
281-
'ViewPdfRenderer' => __NAMESPACE__ . '\Mvc\Service\ViewPdfRendererFactory',
282-
'ViewPdfStrategy' => __NAMESPACE__ . '\Mvc\Service\ViewPdfStrategyFactory',
280+
\Dompdf\Dompdf::class => \DOMPDFModule\Service\DOMPDFFactory::class,
281+
\DOMPDFModule\View\Renderer\PdfRenderer::class => \DOMPDFModule\Mvc\Service\ViewPdfRendererFactory::class,
282+
\DOMPDFModule\View\Strategy\PdfStrategy::class => \DOMPDFModule\Mvc\Service\ViewPdfStrategyFactory::class,
283+
],
284+
'aliases' => [
285+
'DOMPDF' => \Dompdf\Dompdf::class,
286+
'ViewPdfRenderer' => \DOMPDFModule\View\Renderer\PdfRenderer::class,
287+
'ViewPdfStrategy' => \DOMPDFModule\View\Strategy\PdfStrategy::class,
283288
]
284289
]
285290
];

phpcs.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="PHP_CodeSniffer">
3+
<config name="installed_paths" value="../../slevomat/coding-standard"/>
4+
<rule ref="PSR2" />
5+
6+
<file>config/</file>
7+
<file>src/</file>
8+
<file>tests/</file>
9+
</ruleset>
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
<phpunit
2-
bootstrap="./Bootstrap.php"
2+
bootstrap="./tests/bootstrap.php"
33
colors="true"
44
backupGlobals="false"
55
>
66
<testsuites>
77
<testsuite name="DOMPDFModule Test Suite">
8-
<directory>./</directory>
8+
<directory>./tests/</directory>
99
</testsuite>
1010
</testsuites>
1111
<filter>
1212
<whitelist>
13-
<directory suffix=".php">../src</directory>
13+
<directory suffix=".php">.src</directory>
1414
</whitelist>
1515
</filter>
1616
<logging>
17-
<log type="coverage-clover" target="../build/logs/clover.xml"/>
17+
<log type="coverage-clover" target="build/logs/clover.xml"/>
1818
</logging>
1919
</phpunit>

src/DOMPDFModule/Module.php

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,17 @@
1717
* @license http://www.opensource.org/licenses/mit-license.php MIT License
1818
*/
1919

20+
declare(strict_types=1);
21+
2022
namespace DOMPDFModule;
2123

2224
class Module
2325
{
2426
/**
2527
* @return array
2628
*/
27-
public function getConfig()
29+
public function getConfig(): array
2830
{
2931
return include __DIR__ . '/../../config/module.config.php';
3032
}
31-
32-
public function getAutoloaderConfig()
33-
{
34-
return [
35-
'Zend\Loader\StandardAutoloader' => [
36-
'namespaces' => [
37-
__NAMESPACE__ => __DIR__ ,
38-
]
39-
]
40-
];
41-
}
4233
}

0 commit comments

Comments
 (0)