Skip to content

Commit 38e51f4

Browse files
committed
Quality of life.
1 parent 35cd698 commit 38e51f4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1272
-722
lines changed

.circleci/config.yml

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

.gitattributes

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
.github/ export-ignore
12
docs/ export-ignore
23
tests/ export-ignore
3-
phpunit.xml.dist export-ignore
4-
composer.lock export-ignore
5-
.travis.yml export-ignore
64
.gitignore export-ignore
75
.gitattributes export-ignore
6+
.scrutinizer.yml export-ignore
7+
composer.lock export-ignore
88
CHANGELOG.md export-ignore
9+
phpunit.xml.dist export-ignore
910
psalm.xml export-ignore
11+
phpcs.xml export-ignore

.github/workflows/static.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Static Code Analysis
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
psalm:
7+
name: Psalm
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v2
12+
13+
- name: Psalm
14+
uses: docker://vimeo/psalm-github-actions
15+
with:
16+
security_analysis: true
17+
report_file: results.sarif
18+
composer_ignore_platform_reqs: true
19+
20+
- name: Upload Security Analysis results to GitHub
21+
uses: github/codeql-action/upload-sarif@v1
22+
with:
23+
sarif_file: results.sarif
24+
25+
# we may use whatever way to install phpcs, just specify the path on the next step
26+
# however, curl seems to be the fastest
27+
- name: Install PHP_CodeSniffer
28+
run: |
29+
curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar
30+
php phpcs.phar --version
31+
- uses: tinovyatkin/action-php-codesniffer@v1
32+
with:
33+
files: "**.php" # you may customize glob as needed
34+
phpcs_path: php phpcs.phar
35+
standard: phpcs.xml
36+

.github/workflows/unit.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Unit Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- '*'
7+
pull_request:
8+
- '*'
9+
10+
jobs:
11+
unittest:
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
php:
17+
- version: 7.4
18+
coverage: false
19+
- version: 8.0
20+
coverage: true
21+
- version: 8.1
22+
coverage: false
23+
prefer-lowest: ['', '--prefer-lowest']
24+
25+
name: Unit Tests - PHP ${{ matrix.php.version }} ${{ matrix.prefer-lowest }}
26+
27+
steps:
28+
- uses: actions/checkout@v2
29+
30+
- name: Install PHP
31+
uses: shivammathur/setup-php@v2
32+
with:
33+
php-version: ${{ matrix.php.version }}
34+
extensions: mbstring
35+
36+
- name: Validate composer.json and composer.lock
37+
run: composer validate --strict
38+
39+
- name: Cache Composer packages
40+
id: composer-cache
41+
uses: actions/cache@v2
42+
with:
43+
path: vendor
44+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
45+
restore-keys: |
46+
${{ runner.os }}-php-
47+
48+
- name: Remove static analyse tools
49+
run: |
50+
composer remove --dev --with-all-dependencies --ignore-platform-reqs \
51+
squizlabs/php_codesniffer \
52+
vimeo/psalm \
53+
slevomat/coding-standard \
54+
laminas/laminas-coding-standard
55+
56+
- name: Update dependencies
57+
run: composer update --prefer-dist --no-progress --with-all-dependencies ${{ matrix.prefer-lowest }}
58+
59+
- name: Run test suite
60+
if: ${{ ! matrix.php.coverage }}
61+
run: ./vendor/bin/phpunit --verbose
62+
63+
- name: Run test suite with code coverage
64+
if: ${{ matrix.php.coverage }}
65+
run: ./vendor/bin/phpunit --verbose --coverage-clover=build/logs/clover.xml
66+
env:
67+
XDEBUG_MODE: coverage
68+
69+
- name: Update code coverage to Scrutinizer
70+
if: ${{ matrix.php.coverage }}
71+
run: |
72+
wget -q https://scrutinizer-ci.com/ocular.phar
73+
php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml || true

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
configs/.DS_Store
33
!.gitignore
44
vendor/
5+
tests/log/
56
.idea
67
.vagrant
78
phpunit.xml
89
.phpunit.result.cache
9-
tests/log/
10+
.phpcs-cache

.scrutinizer.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
imports:
2+
- php
3+
4+
build:
5+
environment:
6+
php: 8.0.0
7+
nodes:
8+
analysis:
9+
project_setup:
10+
override:
11+
- 'true'
12+
tests:
13+
override:
14+
- php-scrutinizer-run
15+
-
16+
command: phpcs-run
17+
18+
filter:
19+
excluded_paths:
20+
- 'tests/*'
21+
- 'bin/*'
22+
23+
checks:
24+
php: true
25+
26+
coding_style:
27+
php:
28+
spaces:
29+
around_operators:
30+
concatenation: true
31+
32+
tools:
33+
php_cs_fixer: false
34+
external_code_coverage:
35+
timeout: 300

CHANGELOG.md

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,27 @@
1-
2020-xx-xx
1+
2022-05-09
22
----------
33

4-
* Renamed namespace from `AsseticBundle` to `Fabiang\AsseticBundle`
5-
* Drop support for Zend Framework, all classes now use the Laminas namespace
6-
* Drop support for PHP <7.4
7-
* Added support for Mezzio as a middleware
8-
* All classes are using proper type-hints, return-types and are type strict
4+
* [Changelog is now on Github](https://github.com/fabiang/assetic-module/releases)
5+
6+
2022-03-03
7+
----------
8+
9+
* ADDED: Support for assetic/framework 3.0
10+
11+
12+
2021-01-25
13+
----------
14+
15+
* FIXED: Accidentally overwritten PhpRenderer
16+
17+
2021-01-25
18+
----------
19+
20+
* REMOVED: Renamed namespace from `AsseticBundle` to `Fabiang\AsseticBundle`
21+
* REMOVED: Drop support for Zend Framework, all classes now use the Laminas namespace
22+
* REMOVED: Drop support for PHP <7.4
23+
* ADDED: support for Mezzio as a middleware
24+
* ADDED: All classes are using proper type-hints, return-types and are type strict
925

1026
2020-11-30
1127
----------

LICENCE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License
22

3-
Copyright (c) 2011-2020 Gabriel Habryn, 2020 Fabian Grutschus
3+
Copyright (c) 2011-2020 Gabriel Habryn, 2020-2022 Fabian Grutschus
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
# AsseticBundle v3.0
1+
# AsseticBundle v3.2
22

33
[![Latest Stable Version](https://poser.pugx.org/fabiang/assetic-module/version)](https://packagist.org/packages/fabiang/assetic-module)
44
[![License](https://poser.pugx.org/fabiang/assetic-module/license)](https://packagist.org/packages/fabiang/assetic-module)
5-
[![Build Status](https://circleci.com/gh/fabiang/assetic-module.svg?style=svg)](https://app.circleci.com/pipelines/github/fabiang/assetic-module)
6-
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/fabiang/assetic-module/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/fabiang/assetic-module/?branch=master)
7-
[![Code Coverage](https://scrutinizer-ci.com/g/fabiang/assetic-module/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/fabiang/assetic-module/?branch=master)
5+
[![Static Code Analysis](https://github.com/fabiang/assetic-module/actions/workflows/static.yml/badge.svg)](https://github.com/fabiang/assetic-module/actions/workflows/static.yml)
6+
[![Unit Tests](https://github.com/fabiang/assetic-module/actions/workflows/unit.yml/badge.svg)](https://github.com/fabiang/assetic-module/actions/workflows/unit.yml)
7+
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/fabiang/assetic-module/badges/quality-score.png?b=main)](https://scrutinizer-ci.com/g/fabiang/assetic-module/?branch=main)
8+
[![Code Coverage](https://scrutinizer-ci.com/g/fabiang/assetic-module/badges/coverage.png?b=main)](https://scrutinizer-ci.com/g/fabiang/assetic-module/?branch=main)
89

910
Currently maintained fork of [widmogrod/zf2-assetic-module](https://github.com/widmogrod/zf2-assetic-module).
1011

@@ -31,26 +32,26 @@ installed with npm, yarn etc.
3132
* **Well tested**. Besides unit test this solution is also ready for the production use.
3233
* **Great fundations**. Based on [Assetic](https://github.com/assetic/framework) and [Laminas](https://getlaminas.org)
3334
* **Excellent community**. Everything is thanks to great support from GitHub & PHP community!
34-
* **Every change is tracked**. Want to know whats new? Take a look at [CHANGELOG.md](https://github.com/fabiang/assetic-module/blob/master/CHANGELOG.md)
35+
* **Every change is tracked**. Want to know whats new? Take a look at [CHANGELOG.md](https://github.com/fabiang/assetic-module/blob/main/CHANGELOG.md)
3536
* **Listen to your ideas**. Have a great idea? Bring your tested pull request or open a new issue.
3637

3738

3839
## Installation
3940

40-
Read [the quick start guide for Laminas\Mvc](https://github.com/fabiang/assetic-module/blob/master/docs/howto-mvc.md)
41-
or [the quick start guide for Mezzio?](https://github.com/fabiang/assetic-module/blob/master/docs/howto-mezzio.md)
41+
Read [the quick start guide for Laminas\Mvc](https://github.com/fabiang/assetic-module/blob/main/docs/howto-mvc.md)
42+
or [the quick start guide for Mezzio?](https://github.com/fabiang/assetic-module/blob/main/docs/howto-mezzio.md)
4243

4344
## Documentation
4445

45-
* [How to start with Laminas MVC?](https://github.com/fabiang/assetic-module/blob/master/docs/howto-mvc.md)
46-
* [How to start with Mezzio?](https://github.com/fabiang/assetic-module/blob/master/docs/howto-mezzio.md)
47-
* [Configuration](https://github.com/fabiang/assetic-module/blob/master/docs/config.md)
48-
* [Tips & Tricks](https://github.com/fabiang/assetic-module/blob/master/docs/tips.md)
49-
* [Migration guide](https://github.com/fabiang/assetic-module/blob/master/docs/migration.md)
46+
* [How to start with Laminas MVC?](https://github.com/fabiang/assetic-module/blob/main/docs/howto-mvc.md)
47+
* [How to start with Mezzio?](https://github.com/fabiang/assetic-module/blob/main/docs/howto-mezzio.md)
48+
* [Configuration](https://github.com/fabiang/assetic-module/blob/main/docs/config.md)
49+
* [Tips & Tricks](https://github.com/fabiang/assetic-module/blob/main/docs/tips.md)
50+
* [Migration guide](https://github.com/fabiang/assetic-module/blob/main/docs/migration.md)
5051

5152
## Developing
5253

5354
We've two main branches here:
5455

55-
- master: current version with dropped Zend Framework and added Mezzio support
56+
- main: current version with dropped Zend Framework and added Mezzio support
5657
- 2.x: version compatible with Zend Framework 2/3 and Laminas

composer.json

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
"bin/assetic"
3030
],
3131
"require": {
32-
"php": "^7.4 || 8.0.* || 8.1.*",
33-
"assetic/framework": "^2.0 || ^3.0",
32+
"php": "^7.4 || ~8.0.0 || ~8.1.0",
33+
"assetic/framework": "^3.0",
3434
"laminas/laminas-view": "^2.12",
3535
"symfony/console": "^4.0 || ^5.0 || ^6.0"
3636
},
@@ -41,10 +41,13 @@
4141
"mezzio/mezzio-helpers": "^5.4",
4242
"mezzio/mezzio-router": "^3.2",
4343
"phpspec/prophecy-phpunit": "^2.0",
44-
"phpunit/phpunit": "^9.4",
44+
"phpunit/phpunit": "^9.5",
4545
"psr/http-server-middleware": "^1.0",
46-
"vimeo/psalm": "^4.2",
47-
"scrutinizer/ocular": "dev-master"
46+
"vimeo/psalm": "^4.23",
47+
"scrutinizer/ocular": "dev-master",
48+
"squizlabs/php_codesniffer": "^3.6",
49+
"slevomat/coding-standard": "^7.2",
50+
"laminas/laminas-coding-standard": "^2.3"
4851
},
4952
"suggest": {
5053
"laminas/laminas-mvc": "When using this module together with Laminas MVC",
@@ -62,5 +65,20 @@
6265
},
6366
"replace": {
6467
"widmogrod/zf2-assetic-module": "self.version"
68+
},
69+
"config": {
70+
"allow-plugins": {
71+
"dealerdirect/phpcodesniffer-composer-installer": true
72+
}
73+
},
74+
"scripts": {
75+
"phpcs": "phpcs",
76+
"psalm": "psalm",
77+
"phpunit": "phpunit",
78+
"test": [
79+
"@psalm",
80+
"@phpcs",
81+
"@phpunit"
82+
]
6583
}
6684
}

0 commit comments

Comments
 (0)