Comments (10)
I'm not sure why PDepend 2.16.0 declares itself compatible with Symfony/Config v7 (as per its composer.json) if this method declaration clearly doesn't match what's in v7.
from pdepend.
It's now fixed in master branch:
composer require "pdepend/pdepend:dev-master as 2.16.1" --dev
It will soon be released.
from pdepend.
This seems to have a proposed fix here: #696
Commenting so the issue and PR are connected
Currently I have tested this in my project (pdepend is required by phpmd for me) by adding the following to my composer json:
"repositories": {
"pdepend/pdepend": {
"type": "package",
"package": {
"name": "pdepend/pdepend",
"version": "2.16.1",
"source": {
"type": "git",
"url": "https://github.com/symfonyaml/pdepend.git",
"reference": "patch-1"
},
"require": {
"php": ">=5.3.7",
"symfony/dependency-injection": "^2.3.0|^3|^4|^5|^6.0|^7.0",
"symfony/filesystem": "^2.3.0|^3|^4|^5|^6.0|^7.0",
"symfony/config": "^2.3.0|^3|^4|^5|^6.0|^7.0",
"symfony/polyfill-mbstring": "^1.19"
},
"require-dev": {
"phpunit/phpunit": "^4.8.36|^5.7.27",
"squizlabs/php_codesniffer": "^2.0.0",
"gregwar/rst": "^1.0",
"easy-doc/easy-doc": "0.0.0|^1.2.3"
},
"autoload": {
"psr-4": {
"PDepend\\": "src/main/php/PDepend"
}
}
},
"comment": "TODO: Remove this once the next stable version of pdepend is released"
},
}
and then adding "phpdepend/phpdepend": "2.16.1",
in the require section of the composer json.
from pdepend.
I also notice this on PHP 8.3 8.2 after updating these packages:
- Upgrading composer/pcre (3.1.0 => 3.1.1): Extracting archive
- Upgrading symfony/filesystem (v6.3.1 => v7.0.0): Extracting archive
- Upgrading symfony/var-exporter (v6.3.4 => v7.0.0): Extracting archive
- Upgrading symfony/service-contracts (v3.3.0 => v3.4.0): Extracting archive
- Upgrading symfony/deprecation-contracts (v3.3.0 => v3.4.0): Extracting archive
- Upgrading symfony/dependency-injection (v6.3.5 => v7.0.0): Extracting archive
- Upgrading symfony/config (v6.3.2 => v7.0.0): Extracting archive
- Upgrading pdepend/pdepend (2.15.1 => 2.16.0): Extracting archive
EDIT: Sorry, I meant PHP 8.2
from pdepend.
If you're on Symfony6 or less, don't update to 2.16
for now
In composer.json
, I changed the requirement to "phpdepend/phpdepend": "2.15.*"
, it's working for now
from pdepend.
As you can see in this code snippet:
{
"type": "git",
"url": "https://github.com/symfonyaml/pdepend.git",
"reference": "patch-1"
}
It's not taking pdepend from a trusted/stable source, the symfonyaml
in this URL means it's provided by @symfonyaml who kindly worked on this fix (🙏), and patch-1
is the branch, this was a possible work-around, but as a general practice be careful about what you put in your dependencies, a branch can change, the owner can change the content at any time so better be sure to trust whoever you take a fork from, they can add some code to search credentials and send them to some endpoint, modify other dependencies etc.
I would strongly recommend to think twice before putting stuff like that in a composer.json that can end in production, and even in a dev/local machine it's a risk to consider.
Secondly, as soon as the namespace is not pdepend
or phpmd
, it's out of out team responsibility and no warranty can be provided by our team on those repositories.
Last, branch are by nature not meant to live forever, one should not assume it would be permanent nor rely on it.
If you are on Symfony 6, please just lock your PDepend version until we'll provide the proper fix:
composer require pdepend/pdepend:~2.15 --dev
from pdepend.
[07-Dec-2023 10:57:30 UTC] PHP Fatal error: Declaration of PDepend\DependencyInjection\Configuration::getConfigTreeBuilder() must be compatible with Symfony\Component\Config\Definition\ConfigurationInterface::getConfigTreeBuilder(): Symfony\Component\Config\Definition\Builder\TreeBuilder in .../vendor/pdepend/pdepend/src/main/php/PDepend/DependencyInjection/Configuration.php on line 77
is that solved ?
from pdepend.
Thanks @olliescase, i'll use the workaround until waiting the proper fix.
Cheers!
from pdepend.
This seems to have a proposed fix here: #696
Commenting so the issue and PR are connected
Currently I have tested this in my project (pdepend is required by phpmd for me) by adding the following to my composer json:
"repositories": { "pdepend/pdepend": { "type": "package", "package": { "name": "pdepend/pdepend", "version": "2.16.1", "source": { "type": "git", "url": "https://github.com/symfonyaml/pdepend.git", "reference": "patch-1" }, "require": { "php": ">=5.3.7", "symfony/dependency-injection": "^2.3.0|^3|^4|^5|^6.0|^7.0", "symfony/filesystem": "^2.3.0|^3|^4|^5|^6.0|^7.0", "symfony/config": "^2.3.0|^3|^4|^5|^6.0|^7.0", "symfony/polyfill-mbstring": "^1.19" }, "require-dev": { "phpunit/phpunit": "^4.8.36|^5.7.27", "squizlabs/php_codesniffer": "^2.0.0", "gregwar/rst": "^1.0", "easy-doc/easy-doc": "0.0.0|^1.2.3" }, "autoload": { "psr-4": { "PDepend\\": "src/main/php/PDepend" } } }, "comment": "TODO: Remove this once the next stable version of pdepend is released" }, }and then adding
"phpdepend/phpdepend": "2.16.1",
in the require section of the composer json.
Ohhh they removed the branch, 👎 making this workaroud not possible anymore.
from pdepend.
The issue will be closed when it is
from pdepend.
Related Issues (20)
- Halstead Volume Formula HOT 1
- PHP 8.3 syntax
- Values of hnd and hnt are mixed up in XML report HOT 1
- Response for a class (RFC) measure HOT 4
- Critical Error: A compilation unit should contain at least one token HOT 3
- Typo in encoding name HOT 4
- Invalid characters passed to "octdec" HOT 1
- Broken Interface Type for Symfony\Component\Config\Definition\ConfigurationInterface::getConfigTreeBuilder HOT 2
- Missing .phar's HOT 1
- Major version 3.0.0 HOT 2
- Fail to parse throw exception in key offset access
- Trait method collision error for valid php file
- TooManyPublicMethods ignore exceptions
- Use of "Parent" in namespace triggers "Unexpected token: Parent".
- Backed enum expects the type to be all lowercase HOT 2
- `Unexpected token: |` when using union typed constants HOT 4
- "Unexpected token: [" error when accessing array constant item HOT 2
- Cannot load xml namespace for validating config HOT 2
- FIlter pattern exclude regression HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pdepend.