Let\'s say I have a project with two packages installed by Composer:
php composer.phar require \'squizlabs/php_codesniffer:~2.0\' \'phpmd
To remove package from .json and .lock files you have to remove package as follows:
composer remove package-name