Skip to content

Commit

Permalink
Upgrade symfony/dependency-injection to v7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
olvlvl committed Jan 20, 2024
1 parent 2ddab56 commit d08d2f8
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 27 deletions.
1 change: 0 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ jobs:
strategy:
matrix:
php-version:
- "8.1"
- "8.2"
- "8.3"
steps:
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
The olvlvl/symfony-dependency-injection-proxy package is free software.
It is released under the terms of the following BSD License.

Copyright (c) 2018-2023 by Olivier Laviale
Copyright (c) 2018-present by Olivier Laviale
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
Expand Down
25 changes: 25 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
# Migration

## v5.x to v6.0

### New requirements

- Requires PHP v8.2+
- Requires `symfony/dependency-injection` v7.0+

### New features

N/A

### Backward Incompatible Changes

N/A

### Deprecated Features

N/A

### Other Changes

N/A



## v4.x to v5.0

### New requirements
Expand Down
7 changes: 1 addition & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,7 @@ test-cleanup:
@rm -rf tests/sandbox/*

.PHONY: test-container
test-container: test-container-81

.PHONY: test-container-81
test-container-81:
@-docker-compose run --rm app81 bash
@docker-compose down -v
test-container: test-container-82

.PHONY: test-container-82
test-container-82:
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
"prefer-stable": true,
"prefer-dist": true,
"require": {
"php": ">=8.1",
"php": ">=8.2",
"ext-json": "*",
"symfony/dependency-injection": "^6.3"
"symfony/dependency-injection": "^7.0"
},
"require-dev": {
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^10.5",
"symfony/config": "^6.3"
"symfony/config": "^7.0"
},
"autoload": {
"psr-4": {
Expand Down
10 changes: 0 additions & 10 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
---
version: "3.2"
services:
app81:
build:
context: .
args:
PHP_VERSION: "8.1"
environment:
PHP_IDE_CONFIG: "serverName=symfony-di-proxy"
volumes:
- .:/app:delegated
- ~/.composer:/root/.composer:delegated
app82:
build:
context: .
Expand Down
2 changes: 1 addition & 1 deletion lib/FactoryRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use function array_map;
use function implode;

class FactoryRenderer
class FactoryRenderer // Cannot be made readyonly because of test-double
{
public function __construct(
private readonly MethodRenderer $methodRenderer
Expand Down
10 changes: 5 additions & 5 deletions lib/ProxyDumper.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@
use function ltrim;
use function sprintf;

final class ProxyDumper implements DumperInterface
final readonly class ProxyDumper implements DumperInterface
{
public function __construct(
private readonly InterfaceResolver $interfaceResolver = new BasicInterfaceResolver(),
private readonly FactoryRenderer $factoryRenderer = new FactoryRenderer(new MethodRenderer()),
private InterfaceResolver $interfaceResolver = new BasicInterfaceResolver(),
private FactoryRenderer $factoryRenderer = new FactoryRenderer(new MethodRenderer()),
) {
}

/**
* @inheritdoc
*/
public function isProxyCandidate(Definition $definition): bool
public function isProxyCandidate(Definition $definition, bool &$asGhostObject = null, string $id = null): bool
{
$class = $definition->getClass();

Expand Down Expand Up @@ -76,7 +76,7 @@ public function getProxyFactoryCode(Definition $definition, string $id, string $
/**
* @inheritdoc
*/
public function getProxyCode(Definition $definition): string
public function getProxyCode(Definition $definition, string $id = null): string
{
return '';
}
Expand Down

0 comments on commit d08d2f8

Please sign in to comment.