Skip to content

Commit ace85c6

Browse files
authored
Merge branch 'master' into ancestor_class_underscore
2 parents a4bc394 + f6b86e6 commit ace85c6

Some content is hidden

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

63 files changed

+893
-575
lines changed

.github/workflows/build.yaml

Lines changed: 60 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,66 +6,101 @@ on:
66

77
jobs:
88
check:
9-
runs-on: ubuntu-20.04
9+
runs-on: ubuntu-24.04
1010
steps:
1111
- name: Checkout
12-
uses: actions/checkout@v2
12+
uses: actions/checkout@v6
1313
- name: Setup PHP
1414
uses: shivammathur/setup-php@v2
1515
- name: Validate composer.json
1616
run: composer validate --strict --no-check-lock
1717
cs-fixer:
18-
runs-on: ubuntu-20.04
18+
runs-on: ubuntu-24.04
1919
name: PHP-CS-Fixer
2020
steps:
2121
- name: Checkout
22-
uses: actions/checkout@v2
22+
uses: actions/checkout@v6
2323
- name: Fix CS
2424
uses: docker://oskarstark/php-cs-fixer-ga
25+
twig-cs-fixer:
26+
runs-on: ubuntu-24.04
27+
name: Twig-CS-Fixer
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v6
31+
- name: Require the vendor
32+
run: composer require --dev --no-update vincentlanglet/twig-cs-fixer ^3.5
33+
- name: Update
34+
run: composer update --no-interaction --no-progress
35+
- name: Run
36+
run: vendor/bin/twig-cs-fixer lint src/Knp/Menu/Resources/views
2537
tests:
26-
runs-on: ubuntu-20.04
38+
runs-on: ubuntu-24.04
2739
strategy:
2840
fail-fast: false
2941
matrix:
3042
include:
3143
- description: 'No Symfony specified'
32-
php: '7.3'
44+
php: '8.1'
45+
max_deprecations: 0
46+
- description: 'No Symfony specified'
47+
php: '8.2'
48+
max_deprecations: 0
3349
- description: 'No Symfony specified'
34-
php: '7.4'
50+
php: '8.3'
51+
max_deprecations: 0
3552
- description: 'No Symfony specified'
36-
php: '8.0'
53+
php: '8.4'
54+
max_deprecations: 0
55+
- description: 'No Symfony specified'
56+
php: '8.5'
57+
max_deprecations: 0
3758
- description: 'Lowest deps'
38-
php: '7.3'
59+
php: '8.1'
3960
composer_option: '--prefer-lowest'
40-
env:
41-
SYMFONY_DEPRECATIONS_HELPER: max[self]=0
42-
- description: 'Symfony 4.4'
43-
php: '7.4'
44-
symfony: 4.4.*
45-
- description: 'Symfony 5.3'
46-
php: '7.4'
47-
symfony: 5.3.*
61+
max_deprecations: 0
62+
- description: 'Symfony 6'
63+
php: '8.1'
64+
symfony: 6.4.*
65+
max_deprecations: 0
4866
- description: 'Dev deps'
49-
php: '8.0'
67+
php: '8.4'
5068
dev: true
69+
max_deprecations: 0
5170
name: PHP ${{ matrix.php }} tests (${{ matrix.description }})
5271
steps:
5372
- name: Checkout
54-
uses: actions/checkout@v2
73+
uses: actions/checkout@v6
5574
- name: Cache
56-
uses: actions/cache@v2
57-
with:
75+
uses: actions/cache@v4
76+
with:
5877
path: ~/.composer/cache/files
59-
key: composer-${{ matrix.php }}-${{ matrix.symfony }}-${{ matrix.composer_option }}
78+
key: composer-${{ matrix.php }}-${{ matrix.symfony }}-${{ matrix.composer_option }}
6079
- name: Setup PHP
6180
uses: shivammathur/setup-php@v2
6281
with:
6382
php-version: ${{ matrix.php }}
6483
- run: |
6584
sed -ri '/symfony\/deprecation-contracts/! s/"symfony\/(.+)": "(.+)"/"symfony\/\1": "'${{ matrix.symfony }}'"/' composer.json;
85+
- run: composer config --global --no-plugins allow-plugins.symfony/flex true && composer global require symfony/flex
86+
if: matrix.symfony
87+
- run: echo 'SYMFONY_REQUIRE=${{ matrix.symfony }}' >> "$GITHUB_ENV"
6688
if: matrix.symfony
67-
- run: composer config minimum-stability dev && composer config prefer-stable true
89+
- run: composer config minimum-stability dev
6890
if: matrix.dev
6991
- run: composer update --no-interaction --no-progress --ansi ${{ matrix.composer_option }}
70-
- run: vendor/bin/simple-phpunit
71-
92+
- run: vendor/bin/phpunit
93+
env:
94+
SYMFONY_DEPRECATIONS_HELPER: max[self]=${{matrix.max_deprecations}}
95+
phpstan:
96+
runs-on: ubuntu-24.04
97+
name: PHPStan
98+
steps:
99+
- name: Checkout
100+
uses: actions/checkout@v6
101+
- name: Setup PHP
102+
uses: shivammathur/setup-php@v2
103+
with:
104+
php-version: '8.1'
105+
- run: composer update --no-interaction --no-progress --ansi
106+
- run: vendor/bin/phpstan analyze

.php-cs-fixer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
->setRules([
1111
'@Symfony' => true,
1212
'@Symfony:risky' => true,
13-
'@PHP71Migration:risky' => true,
14-
'@PHPUnit75Migration:risky' => true,
13+
'@PHP80Migration:risky' => true,
14+
'@PHPUnit84Migration:risky' => true,
1515
'ordered_imports' => true,
1616
'declare_strict_types' => false,
1717
'native_function_invocation' => ['include' => ['@internal']],

CHANGELOG.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
## 3.5 (2024-03-23)
2+
3+
* Added CallbackVoter
4+
* Removed support for unsupported PHP version 8.0
5+
6+
## 3.4 (2023-05-17)
7+
8+
* Removed support for unsupported PHP version 7.4
9+
10+
## 3.3 (2021-10-28)
11+
12+
* Added support for Symfony 6
13+
114
## 3.2 (2021-05-28)
215

316
* Remove Symfony 6 deprecations
@@ -42,7 +55,7 @@
4255
* Added 2 new tests to twig: `knp_menu_current`, `knp_menu_ancestor`
4356
* Made the templates compatible with Twig 2
4457
* Add menu and renderer providers supporting any ArrayAccess implementations. The
45-
Pimple-based providers (supporting only Pimple 1) are dperecated in favor of these
58+
Pimple-based providers (supporting only Pimple 1) are deprecated in favor of these
4659
new providers.
4760

4861
## 2.0.1 (2014-08-01)
@@ -61,7 +74,7 @@
6174
## 2.0.0 alpha 2 (2014-05-01)
6275

6376
* [BC break] Changed the TwigRenderer to accept a menu template only as a string
64-
* [BC break] Refactored the way of rendering twig templates. Every template should extends
77+
* [BC break] Refactored the way of rendering twig templates. Every template should extend
6578
the `knp_menu.html.twig` template.
6679
* Introduced extension points in the MenuFactory through `Knp\Menu\Factory\ExtensionInterface`
6780
* [BC break compared to 2.0 alpha 1] The inheritance extension points introduced in alpha1 are
@@ -99,7 +112,7 @@
99112
)
100113
```
101114

102-
The old syntax is kept until the final release, but using it will trigger a E_USER_DEPRECATED error.
115+
The old syntax is kept until the final release, but using it will trigger an E_USER_DEPRECATED error.
103116

104117
## 2.0.0 alpha 1 (2013-06-23)
105118

@@ -151,7 +164,7 @@
151164
* Added a ChainProvider for the menus.
152165
* Added the Silex extension
153166
* Added a RouterAwareFactory
154-
* Added an helper to be able to reuse the logic more easily for other templating engines
167+
* Added a helper to be able to reuse the logic more easily for other templating engines
155168
* Added a way to retrieve an item using a path in a menu tree
156169
* Changed the toArray method to use a depth instead of simply using a boolean flag
157170
* Refactored the export to array and the creation from an array

README.markdown

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
1-
KnpMenu
2-
=======
1+
# KnpMenu
32

4-
The KnpMenu library provides object oriented menus for PHP.
3+
The KnpMenu library provides object-oriented menus for PHP.
54
It is used by the [KnpMenuBundle](https://github.com/KnpLabs/KnpMenuBundle) for Symfony
65
but can now be used stand-alone.
76

8-
[![Build Status](https://github.com/KnpLabs/KnpMenu/workflows/build/badge.svg)](https://github.com/KnpLabs/KnpMenu/actions)
7+
[![Build Status](https://github.com/KnpLabs/KnpMenu/actions/workflows/build.yaml/badge.svg)](https://github.com/KnpLabs/KnpMenu/actions/workflows/build.yaml)
98
[![Latest Stable Version](https://poser.pugx.org/knplabs/knp-menu/v/stable.svg)](https://packagist.org/packages/knplabs/knp-menu)
109
[![Latest Unstable Version](https://poser.pugx.org/knplabs/knp-menu/v/unstable.svg)](https://packagist.org/packages/knplabs/knp-menu)
1110
[![Gitter chat](https://badges.gitter.im/KnpLabs/KnpMenu.svg)](https://gitter.im/KnpLabs/KnpMenu)
1211

1312
## Installation
1413

15-
KnpMenu uses Composer, please checkout the [composer website](http://getcomposer.org) for more information.
14+
KnpMenu uses Composer, please check out the [composer website](https://getcomposer.org/) for more information.
1615

17-
The simple following command will install `knp-menu` into your project. It also add a new
16+
The simple following command will install `knp-menu` into your project. It also adds a new
1817
entry in your `composer.json` and update the `composer.lock` as well.
1918

2019
```bash
21-
$ composer require knplabs/knp-menu
20+
composer require knplabs/knp-menu
2221
```
2322

2423
> KnpMenu follows the PSR-4 convention names for its classes, which means you can easily integrate `knp-menu` classes loading in your own autoloader.
@@ -96,3 +95,4 @@ the [Symfony community](https://github.com/KnpLabs/KnpMenu/graphs/contributors).
9695
[3]: https://github.com/derrabus
9796
[4]: https://github.com/garak
9897
[5]: https://github.com/stof
98+

composer.json

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,21 @@
2020
}
2121
],
2222
"require": {
23-
"php": "^7.3 || ^8.0",
23+
"php": "^8.1",
2424
"symfony/deprecation-contracts": "^2.4"
2525
},
2626
"conflict": {
27-
"twig/twig": "<1.40 || >=2,<2.9"
27+
"symfony/http-foundation": "<5.4",
28+
"twig/twig": "<2.16"
2829
},
2930
"require-dev": {
30-
"phpspec/prophecy": "^1.13",
31-
"psr/container": "^1.0",
32-
"symfony/http-foundation": "^4.4 || ^5.0",
33-
"symfony/phpunit-bridge": "^5.3",
34-
"symfony/routing": "^4.4 || ^5.0",
35-
"twig/twig": "^1.40 || ^2.9 || ^3.0"
31+
"phpstan/phpstan": "^2.1",
32+
"phpunit/phpunit": "^9.6",
33+
"psr/container": "^1.0 || ^2.0",
34+
"symfony/http-foundation": "^5.4 || ^6.0 || ^7.0 || ^8.0",
35+
"symfony/phpunit-bridge": "^7.0 || ^8.0",
36+
"symfony/routing": "^5.4 || ^6.0 || ^7.0 || ^8.0",
37+
"twig/twig": "^2.16 || ^3.0"
3638
},
3739
"suggest": {
3840
"twig/twig": "for the TwigRenderer and the integration with your templates"
@@ -45,9 +47,12 @@
4547
"Knp\\Menu\\Tests\\": "tests/Knp/Menu/Tests"
4648
}
4749
},
50+
"config": {
51+
"sort-packages": true
52+
},
4853
"extra": {
4954
"branch-alias": {
50-
"dev-master": "3.3-dev"
55+
"dev-master": "3.x-dev"
5156
}
5257
}
5358
}

0 commit comments

Comments
 (0)