Skip to content

Commit

Permalink
Composer versions (#72)
Browse files Browse the repository at this point in the history
* [MixerApi] load MixerApi/Bake as dev dependency only

* [MixerApi] load MixerApi/Bake as dev dependency only

* ignore code coverage

* modifying composer versions

* updates composer files, use tilda operator when possible
  • Loading branch information
cnizzardini committed Jul 1, 2021
1 parent c82e680 commit fef2e27
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 37 deletions.
46 changes: 10 additions & 36 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,47 +7,20 @@
"require": {
"php": ">=7.2",
"cakephp/cakephp": "~4.0",
"cnizzardini/cakephp-swagger-bake": "^1.0",
"friendsofcake/search": "^6.0",
"mixerapi/bake": "^0.2",
"mixerapi/collection-view": "^0.2",
"mixerapi/core": "^0.2",
"mixerapi/exception-render": "^0.2",
"mixerapi/hal-view": "^0.2",
"mixerapi/json-ld-view": "^0.2",
"mixerapi/rest": "^0.2"
},
"require-dev": {
"phpunit/phpunit": "~8.5.0",
"cakephp/cakephp-codesniffer": "^4.2",
"phpstan/phpstan": "^0.12.32",
"phpmd/phpmd": "^2.8"
"cnizzardini/cakephp-swagger-bake": "~1.0",
"mixerapi/bake": "~0.2",
"mixerapi/collection-view": "~0.2",
"mixerapi/core": "~0.2",
"mixerapi/exception-render": "~0.2",
"mixerapi/hal-view": "~0.2",
"mixerapi/json-ld-view": "~0.2",
"mixerapi/rest": "~0.2"
},
"autoload": {
"psr-4": {
"MixerApi\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"MixerApi\\Test\\": "tests/",
"MixerApi\\Test\\App\\": "tests/test_app/src"
}
},
"scripts": {
"check": [
"@test",
"@cs-check",
"@stan",
"@md"
],
"cs-check": "phpcs --colors -p --standard=vendor/cakephp/cakephp-codesniffer/CakePHP src/",
"cs-fix": "phpcbf --colors --standard=vendor/cakephp/cakephp-codesniffer/CakePHP src/",
"stan": "phpstan analyse src/",
"test": "phpunit --colors=always",
"md": "phpmd src/ ansi phpmd.xml",
"coverage": "phpunit --coverage-html coverage-reports/"
},
"support": {
"source": "https://github.com/mixerapi/mixerapi"
},
Expand All @@ -58,7 +31,8 @@
}
],
"suggest": {
"cnizzardini/cakephp-preloader": "An OpCache preloader for php >= 7.4 cakephp projects"
"cnizzardini/cakephp-preloader": "An OpCache preloader for php >= 7.4 cakephp projects",
"friendsofcake/search": "Search provides a simple interface to create paginate-able filters for your project"
},
"prefer-stable": true,
"minimum_stability": "dev"
Expand Down
9 changes: 8 additions & 1 deletion src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

use Cake\Console\CommandCollection;
use Cake\Core\BasePlugin;
use Cake\Core\Exception\MissingPluginException;
use Cake\Core\PluginApplicationInterface;
use MixerApi\Command\InstallCommand;

Expand All @@ -25,7 +26,13 @@ public function bootstrap(PluginApplicationInterface $app): void
$app->addPlugin('SwaggerBake');

if (PHP_SAPI === 'cli') {
$app->addPlugin('MixerApi/Bake');
try {
$app->addPlugin('MixerApi/Bake');
// @codeCoverageIgnoreStart
} catch (MissingPluginException $e) {
// Do not halt if the plugin is missing
}
// @codeCoverageIgnoreEnd
}

parent::bootstrap($app);
Expand Down

0 comments on commit fef2e27

Please sign in to comment.