Skip to content

Commit

Permalink
Merge pull request #9 from nicolasmure/feture/symfony4-support
Browse files Browse the repository at this point in the history
symfony4 support
  • Loading branch information
nicolasmure authored Dec 2, 2017
2 parents 042a879 + 47e519e commit 850a925
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 11 deletions.
7 changes: 2 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@ language: php

matrix:
include:
- php: 5.4
- php: 7.1
env:
- SYMFONY_VERSION='2.3.*'
- php: 7.0
env:
- SYMFONY_VERSION='3.0.*'
- SYMFONY_VERSION='4.0.*'

before_install:
- mkdir -p build/logs
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## v2.0.0 (2017-12-02)
Symfony 4 support.

**BC breaks** :
- The built-in [formatters](/README.md#formatters) services are now
declared as `private`.
- Symfony 4 is now the minimum requirement, as PHP 7.1.

## v1.0.0 (2016-08-07)
Integration of the [nmure/encryptor](https://github.com/nicolasmure/NmureEncryptor "PHP data encryptor using open_ssl") library.
First stable release. BC break with the previous dev versions.
Expand Down
4 changes: 3 additions & 1 deletion DependencyInjection/NmureEncryptorExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ private function configureEncryptor($name, array $settings, ContainerBuilder $co

$definition = $container->register(sprintf('nmure_encryptor.%s', $name), 'Nmure\Encryptor\Encryptor')
->addArgument($settings['secret'])
->addArgument($settings['cipher']);
->addArgument($settings['cipher'])
->setPublic(true)
;

if (isset($settings['formatter'])) {
$this->configureFormatter($definition, $settings['formatter'], $container);
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ It is **recommended** to read the lib's documentation before continuing here.
Open a command console, enter your project directory and execute the
following command to download the latest stable version of this bundle:

```bash
$ composer require nmure/encryptor-bundle "~2.0.0"
```

For Symfony < 4.0, run
```bash
$ composer require nmure/encryptor-bundle "~1.0.0"
```
Expand Down Expand Up @@ -115,6 +120,8 @@ into services that you can use when configuring your encryptors :
- [`Base64Formatter`](https://github.com/nicolasmure/NmureEncryptor#base64formatter "Nmure\Encryptor\Formatter\Base64Formatter") => `nmure_encryptor.formatters.base64_formatter`
- [`HexFormatter`](https://github.com/nicolasmure/NmureEncryptor#hexformatter "Nmure\Encryptor\Formatter\HexFormatter") => `nmure_encryptor.formatters.hex_formatter`

**Note** : If you use Symfony >= 4.0, these services will be declared as `private`.

## Informations

Useful informations about:
Expand Down
3 changes: 0 additions & 3 deletions Tests/DependencyInjection/NmureEncryptorExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,6 @@ public function testValidConfiguration()
$this->configuration->compile();

$this->assertInstanceOf('Nmure\Encryptor\Encryptor', $this->configuration->get('nmure_encryptor.first_encryptor'));
// default settings
$this->assertInstanceOf('Nmure\Encryptor\Formatter\Base64Formatter', $this->configuration->get('nmure_encryptor.formatters.base64_formatter'));
$this->assertInstanceOf('Nmure\Encryptor\Formatter\HexFormatter', $this->configuration->get('nmure_encryptor.formatters.hex_formatter'));
}

public function testTurnHexKeyToBin()
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
}
],
"require": {
"php": ">=5.4",
"symfony/framework-bundle": "~2.3|~3.0",
"php": ">=7.1",
"symfony/framework-bundle": "~4.0",
"nmure/encryptor": "~1.0.0"
},
"autoload": {
Expand Down

0 comments on commit 850a925

Please sign in to comment.