-
-
Notifications
You must be signed in to change notification settings - Fork 58
Description
As mentioned in #74, I would like to add support for PHP 8.4. I have made the following changes in src/Graph/GraphComposer.php:
/**
*
* @param string $dir
* @param GraphViz|null $graphviz
*/
public function __construct($dir, $graphviz = null)
{
if ($graphviz === null) {
$graphviz = new GraphViz();
$graphviz->setFormat('svg');
}
$analyzer = new \JMS\Composer\DependencyAnalyzer();
$this->dependencyGraph = $analyzer->analyze($dir);
$this->graphviz = $graphviz;
}This change works well and addresses the PHP 8.4 deprecation where implicitly nullable parameter declarations are deprecated. However, the bigger issue is the dependency on jms/composer-deps-analyzer.
The jms/composer-deps-analyzer package has not been updated since 2016 and therefore lacks support for PHP 8.4+ and its stricter nullable type requirements. This dependency prevents us from maintaining full compatibility across all PHP versions without potentially significant effort to identify and migrate to alternative dependencies.
There are some different approaches here:
-
Release a new major version of graph-composer that drops support for older PHP versions and only supports PHP 8.0+. This would allow us to modernize the codebase and dependencies.
-
Investigate and migrate to a more actively maintained alternative to
jms/composer-deps-analyzer, though this would require substantial research and testing. -
Fork the
jms/composer-deps-analyzerpackage and maintain our own PHP 8.4+ compatible version.
Not sure which of this options might be the way to go yet.