Editing the composer.json is always prone to errors, and running "composer update" updates all dependencies which in most cases is probably not wanted. In some cases where packages don't follow semantic versioning (cough laravel cough) could see you upgrade an entire version! (e.g: 5.1 to 5.2 if the users version constraint is ~5.1)
Using "composer require" means that we only install the package requested without updating any other dependencies and also removes the need to edit the composer.json directly as its all handled for us, which means the possibility of syntax errors is removed :)
I also updated the version constraint to use ^5.2.0. I'm not sure if this actually has a performance improvement vs. 5.2.* but using the caret is the recommended operator to use.
Editing the composer.json is always prone to errors, and running "composer update" updates all dependencies which in most cases is probably not wanted. In some cases where packages don't follow semantic versioning (cough laravel cough) could see you upgrade an entire version! (e.g: 5.1 to 5.2 if the users version constraint is ~5.1)
Using "composer require" means that we only install the package requested without updating any other dependencies and also removes the need to edit the composer.json directly as its all handled for us, which means the possibility of syntax errors is removed :)
I also updated the version constraint to use ^5.2.0. I'm not sure if this actually has a performance improvement vs. 5.2.* but using the caret is the recommended operator to use.