PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, January 26, 2022

[FIXED] Composer require to save patch version in JSON

 January 26, 2022     composer-php, php     No comments   

Issue

When I run

composer require symfony/symfony

I have this in my composer JSON:

"symfony/symfony": "^2.7"

while I would like to have this:

"symfony/symfony": "^2.7.6"

Can I make composer to save patch (from convention MAJOR.MINOR.PATCH) into composer.json?

If that's not possible then why?


Solution

It is not possible, because of convention. In ~ 99% use cases it does not make sense to lock to patch version.

According to Semantic versioning, package should be compatible in every minor version. Meaning 2.5 won't break after update from 2.4.

Software evolves and the less version you need to upgrade, the easier. This is kind of soft enforcement to upgrade (in words: don't be stuck on version 2.4, if there is 2.15) and support back package development.



Answered By - Tomas Votruba
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing