Skip to content

Commit

Permalink
Added the version number to the message of plugin install command.
Browse files Browse the repository at this point in the history
  • Loading branch information
rackberg committed Sep 26, 2018
1 parent 59ca0c8 commit e0ef135
Show file tree
Hide file tree
Showing 15 changed files with 434 additions and 233 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## Unreleased
### Changed
- Changed the output of the message that will be shown after installing a new plugin.
- Default is now the highest stable version for a plugin to install.
### Removed
- Dependencies to the composer factory

## [2.2.3] - 2018-09-25
### Fixed
- Memory exhaustion when executing the plugins:available command.
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"monolog/monolog": "^1.22",
"symfony/finder": "^4.0",
"composer/composer": "^1.6",
"guzzlehttp/guzzle": "^6.3"
"guzzlehttp/guzzle": "^6.3",
"symfony/serializer": "^4.1"
},
"require-dev": {
"phpunit/phpunit": "^6.0",
Expand Down
142 changes: 140 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 3 additions & 6 deletions config/services/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ services:
filesystem:
class: Symfony\Component\Filesystem\Filesystem

composer_factory:
class: Composer\Factory

guzzle.http_client:
class: GuzzleHttp\Client

Expand All @@ -65,9 +62,9 @@ services:
para.plugin.plugin_manager:
class: Para\Plugin\PluginManager
arguments:
- '@composer_factory'
- '@para.factory.plugin_factory'
- '@para.factory.process_factory'
- '@para.factory.encoder.json_encoder_factory'
- '@para.package.stable_package_finder'
- '@para.service.packagist.packagist'
- '%para.root%'
Expand Down Expand Up @@ -120,8 +117,8 @@ services:
para.factory.table_output_factory:
class: Para\Factory\TableOutputFactory

para.factory.composite_repository_factory:
class: Para\Factory\CompositeRepositoryFactory
para.factory.encoder.json_encoder_factory:
class: Para\Factory\Encoder\JsonEncoderFactory

para.factory.plugin_factory:
class: Para\Factory\PluginFactory
Expand Down
7 changes: 4 additions & 3 deletions src/Command/InstallPluginCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected function configure()
'version',
InputArgument::OPTIONAL,
'The version of the plugin.',
'dev'
''
);
}

Expand All @@ -71,8 +71,9 @@ protected function execute(InputInterface $input, OutputInterface $output)

$output->writeln(
sprintf(
'<info>The plugin "%s" has been installed successfully.</info>',
$pluginName
'<info>The plugin "%s" version "%s" has been installed successfully.</info>',
$pluginName,
$version
)
);
} catch (PluginAlreadyInstalledException $e) {
Expand Down
21 changes: 21 additions & 0 deletions src/Factory/Encoder/JsonEncoderFactory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace Para\Factory\Encoder;

use Symfony\Component\Serializer\Encoder\JsonEncoder;

/**
* Class JsonEncoderFactory.
*
* @package Factory\Encoder
*/
class JsonEncoderFactory implements JsonEncoderFactoryInterface
{
/**
* {@inheritdoc}
*/
public function getEncoder(): JsonEncoder
{
return new JsonEncoder();
}
}
20 changes: 20 additions & 0 deletions src/Factory/Encoder/JsonEncoderFactoryInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace Para\Factory\Encoder;

use Symfony\Component\Serializer\Encoder\JsonEncoder;

/**
* Interface JsonEncoderFactoryInterface.
*
* @package Para\Factory\Encoder
*/
interface JsonEncoderFactoryInterface
{
/**
* Creates and returns a new json encoder instance.
*
* @return \Symfony\Component\Serializer\Encoder\JsonEncoder
*/
public function getEncoder(): JsonEncoder;
}
4 changes: 2 additions & 2 deletions src/Plugin/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function getName(): string
*/
public function getDescription(): string
{
return $this->description;
return $this->description ?: '';
}

/**
Expand All @@ -75,7 +75,7 @@ public function setDescription(string $description): void
*/
public function getVersion(): string
{
return $this->version;
return $this->version ?: '';
}

/**
Expand Down
Loading

0 comments on commit e0ef135

Please sign in to comment.