Skip to content
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

fix fixer check in CI #488

Merged
merged 3 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
check:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -15,15 +15,17 @@ jobs:
- name: Validate composer.json
run: composer validate --strict --no-check-lock
cs-fixer:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
name: PHP-CS-Fixer
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Fix CS
uses: docker://oskarstark/php-cs-fixer-ga
with:
args: --diff --dry-run
tests:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
Expand Down
1 change: 0 additions & 1 deletion src/DependencyInjection/Compiler/AddExtensionsPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
* @author Christophe Coevoet <[email protected]>
*
* @internal
* @final
*/
final class AddExtensionsPass implements CompilerPassInterface
{
Expand Down
1 change: 0 additions & 1 deletion src/DependencyInjection/Compiler/AddProvidersPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
* @author Christophe Coevoet <[email protected]>
*
* @internal
* @final
*/
final class AddProvidersPass implements CompilerPassInterface
{
Expand Down
1 change: 0 additions & 1 deletion src/DependencyInjection/Compiler/AddRenderersPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* @author Christophe Coevoet <[email protected]>
*
* @internal
* @final
*/
final class AddRenderersPass implements CompilerPassInterface
{
Expand Down
1 change: 0 additions & 1 deletion src/DependencyInjection/Compiler/AddVotersPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
* @author Christophe Coevoet <[email protected]>
*
* @internal
* @final
*/
final class AddVotersPass implements CompilerPassInterface
{
Expand Down
1 change: 0 additions & 1 deletion src/DependencyInjection/Compiler/MenuBuilderPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
* @author Christophe Coevoet <[email protected]>
*
* @internal
* @final
*/
final class MenuBuilderPass implements CompilerPassInterface
{
Expand Down
1 change: 0 additions & 1 deletion src/DependencyInjection/Compiler/RegisterMenusPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
* @author Christophe Coevoet <[email protected]>
*
* @internal
* @final
*/
final class RegisterMenusPass implements CompilerPassInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/DependencyInjection/KnpMenuExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function load(array $configs, ContainerBuilder $container): void
$container->setParameter('knp_menu.renderer.twig.template', $config['twig']['template']);
}
if ($config['templating']) {
trigger_deprecation('knplabs/knp-menu-bundle', '3.3', 'Using the templating component is deprecated since version 3.3, this option will be removed in version 4.');
\trigger_deprecation('knplabs/knp-menu-bundle', '3.3', 'Using the templating component is deprecated since version 3.3, this option will be removed in version 4.');
$loader->load('templating.xml');
}

Expand Down
4 changes: 2 additions & 2 deletions src/Provider/BuilderAliasProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ final class BuilderAliasProvider implements MenuProviderInterface
private array $builders = [];

public function __construct(private KernelInterface $kernel, private ContainerInterface $container, private FactoryInterface $menuFactory)
{}
{
}

/**
* Looks for a menu with the bundle:class:method format.
Expand Down Expand Up @@ -79,7 +80,6 @@ private function getBuilder(string $bundleName, string $className): object
$name = \sprintf('%s:%s', $bundleName, $className);

if (!isset($this->builders[$name])) {

$bundle = $this->kernel->getBundle($bundleName);
$try = $bundle->getNamespace().'\\Menu\\'.$className;

Expand Down
11 changes: 6 additions & 5 deletions src/Templating/Helper/MenuHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@
class MenuHelper extends TemplatingHelper
{
public function __construct(private Helper $helper, private MatcherInterface $matcher, private MenuManipulator $menuManipulator)
{}
{
}

/**
* Retrieves an item following a path in the tree.
*
* @param \Knp\Menu\ItemInterface|string $menu
* @param ItemInterface|string $menu
*
* @return \Knp\Menu\ItemInterface
* @return ItemInterface
*/
public function get($menu, array $path = [], array $options = [])
{
Expand All @@ -28,8 +29,8 @@ public function get($menu, array $path = [], array $options = [])
/**
* Renders a menu with the specified renderer.
*
* @param \Knp\Menu\ItemInterface|string|array $menu
* @param string $renderer
* @param ItemInterface|string|array $menu
* @param string $renderer
*
* @return string
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/Provider/BuilderAliasProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function testGetExistentMenu(): void

public function testGetContainerAwareMenu(): void
{
if (!interface_exists(ContainerAwareInterface::class)) {
if (!\interface_exists(ContainerAwareInterface::class)) {
self::markTestSkipped('missing interface');
}
$item = $this->getMockBuilder('Knp\Menu\ItemInterface')->getMock();
Expand Down
2 changes: 1 addition & 1 deletion tests/Stubs/Menu/ContainerAwareBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ContainerAwareBuilder implements ContainerAwareInterface
{
private ContainerInterface $container;

public function setContainer(ContainerInterface $container = null): void
public function setContainer(?ContainerInterface $container = null): void
{
$this->container = $container;
}
Expand Down