在 symfony 项目中,我典型的
composer outdated
输出如下所示:
Direct dependencies required in composer.json:
aws/aws-sdk-php 3.294.4 3.294.5 AWS SDK for PHP - Use Amazon Web Services in your PHP project
phpunit/phpunit 9.6.15 10.5.3 The PHP Unit Testing framework.
symfony/asset v5.4.31 v7.0.0 Manages URL generation and versioning of web assets such as CSS stylesheets, JavaScript files and image files
symfony/browser-kit v5.4.31 v7.0.0 Simulates the behavior of a web browser, allowing you to make requests, click on links and submit forms programmatically
symfony/console v5.4.32 v7.0.1 Eases the creation of beautiful and testable command line interfaces
symfony/css-selector v5.4.26 v7.0.0 Converts CSS selectors to XPath expressions
鉴于我只使用 symfony LTS 版本 - 我对看到
symfony/*
软件包>=7,<7.4
不感兴趣。
因此有一个问题,是否有可能以某种方式编写一个约束,以便在
symfony/*: >=7,<7.4
输出中根本不显示 composer outdated
?同时保留所有其他包裹。
例如:对于上面的输出,我希望看到
symfony/asset
或 v6.4.0
。
因为您对 LTS 版本感兴趣并希望避免版本 >=7 和 <7.4, you could specify this in your composer.json,如下所示:
"require": {
"symfony/symfony": "^6.4"
}