Code Monkey home page Code Monkey logo

composer-constraint-updater's Introduction

Composer constraint upgrader

Helps You automatically resolve composer conflicts

E.g. Need to upgrade your framework to the newest version? Just run

composer major-update --composer-json=composerPath --constraint=package/package:^10.0 --constraint=php:^8.1

Want to upgrade minor versions and also update your compose.json file to the up-to-date versions? Run

composer minor-update --composer-json=composerPath

Installation

Use composer to automatically add it Your project

composer require martinsr/constraint-updater

How to use

  • Add it to Your project
  • Specify your composer json/lock location when running any of the commands if needed
--composer-json=composer/json/path --composer-lock=composer/lock/path
  • Specify Your needed constraints when running composer major-update
--constraint=php:^8.1 --constraint=package/package:^10.0
  • Run the either composer major-update or composer minor-update with your params.

How it works

major-update

It will replace all your composer.json package versions with * except for packages You have added with --constraint.

Versions you add for the packages will be taken literally.

Examples:

constraint=laravel/framework:^10.0 will set the version to ^10.0 constraint=laravel/framework:10.0 will set it to 10.0.

Would suggest to always add the ^ since composer will still keep the major version the same, while updating to the newest minor version other packages support.

This will make composer install the most up-to-date versions possible, taken the constraints and there won't be any conflicts as long as there is a supported version'.

After composer update has been run, it will fix your composer.json file from versions that were installed and specified in Your composer.lock

minor-update

This will run composer update and after that fix the composer.json with the actual versions that were installed.

Examples:

Run

composer minor-update

Will run composer update command, and rebuild composer.json file to have up-to-date dependencies with the lock file

composer-constraint-updater's People

Contributors

martinsrucevskis avatar

Stargazers

 avatar

Watchers

 avatar  avatar

composer-constraint-updater's Issues

Expamnd PHP-CS-FIXER rules

You can use as base and see which ones works for project

        '@PSR2' => true,
        '@PhpCsFixer' => true,
        '@PHP73Migration' => true,
        'global_namespace_import' => true,
        'self_static_accessor' => true,
        'void_return' => true,
        'array_syntax' => ['syntax' => 'short'],
        'concat_space' => ['spacing' => 'one'],
        'multiline_whitespace_before_semicolons' => ['strategy' => 'no_multi_line'],
        'single_quote' => ['strings_containing_single_quote_chars' => true],
        'yoda_style' => false,
        'blank_line_before_statement' => [],
        'method_chaining_indentation' => false,
        'logical_operators' => true,
        'modernize_types_casting' => true,
        'php_unit_test_class_requires_covers' => false,
        'strict_comparison' => true,
        'psr_autoloading' => true,
        'is_null' => true,
        'no_alias_functions' => true,
        'no_unreachable_default_argument_value' => true,
        'dir_constant' => true,
        'combine_nested_dirname' => true,
        'no_alternative_syntax' => false,
        'increment_style' => ['style' => 'post'],
        'single_line_empty_body' => false,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.