This repository has been archived by the owner on Sep 18, 2024. It is now read-only.
forked from reprovinci/doctrine-encrypt
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* PHP 7.1 support & cleanup * Idea files should be in global .gitignore * Add return type to getSubscribedEvents method * Remove redundant paragraph * Link to license file * Remove redundant composer install flag * Use proper PHP 7.1 requirement "proper" * Remove redundant Composer config option * Fix indents in phpunit xml file * Don't use bootstrap file to autoload annotations * Fix docblocks * Further improve annotation loading * Remove unnecessary method * Add upgrading guide * Remove type-hints from EncryptorInterface * Make PHP 7.0 the new minimum version * Re-add docblocks
- Loading branch information
1 parent
1407d7e
commit eac8f36
Showing
19 changed files
with
150 additions
and
261 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
composer.lock | ||
vendor | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,11 @@ | ||
language: php | ||
|
||
php: | ||
- 5.4 | ||
- 5.5 | ||
- 5.6 | ||
- 7.0 | ||
- hhvm | ||
- 7.1 | ||
|
||
before_script: | ||
- composer --prefer-source install | ||
- composer install | ||
|
||
script: | ||
- ./vendor/bin/phpunit -c tests/phpunit.xml.dist | ||
|
||
matrix: | ||
allow_failures: | ||
- php: hhvm | ||
- ./vendor/bin/phpunit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Upgrading | ||
|
||
## 5.x to 6.x | ||
|
||
When upgrading to 6.x it is important to know that this library now requires PHP 7.0 as a minimum version. | ||
|
||
Because of the new minimum PHP version the old `AES256Encryptor` class has been removed since Mcrypt is no longer supported. If you want to keep using this library you'll need to write your own implementation of the `EncryptorInterface` or use the new `LaravelEncryptor` if you use the Laravel framework. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,19 +4,23 @@ | |
"keywords": ["doctrine", "aes256", "encrypt", "decrypt"], | ||
"license": "MIT", | ||
"description": "Package encrypts and decrypts Doctrine fields through life cycle events.", | ||
|
||
"require": { | ||
"php": ">=5.3.2", | ||
"doctrine/orm": "~2.0", | ||
"ext-mcrypt": "*" | ||
"php": "^7.0", | ||
"doctrine/orm": "^2.5" | ||
}, | ||
|
||
"require-dev": { | ||
"phpunit/phpunit": "~3.7" | ||
"illuminate/encryption": "^5.4", | ||
"phpunit/phpunit": "^5.7" | ||
}, | ||
|
||
"autoload": { | ||
"psr-0": { "DoctrineEncrypt": "src" } | ||
"psr-4": { | ||
"DoctrineEncrypt\\": "src" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"DoctrineEncrypt\\Tests\\": "tests" | ||
} | ||
}, | ||
"authors": [ | ||
{ | ||
|
@@ -26,6 +30,13 @@ | |
{ | ||
"name": "Dustin Thomson", | ||
"email": "[email protected]" | ||
}, | ||
{ | ||
"name": "Dries Vints", | ||
"email": "[email protected]" | ||
} | ||
] | ||
], | ||
"config": { | ||
"sort-packages": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,24 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit | ||
bootstrap="TestInit.php" | ||
colors="true" | ||
bootstrap="vendor/autoload.php" | ||
backupGlobals="false" | ||
backupStaticAttributes="false" | ||
colors="true" | ||
verbose="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
processIsolation="false" | ||
stopOnFailure="false" | ||
> | ||
<testsuites> | ||
<testsuite name="DoctrineEncrypt Test Suite"> | ||
<directory>./DoctrineEncrypt</directory> | ||
<directory>tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
<filter> | ||
<whitelist addUncoveredFilesFromWhitelist="true"> | ||
<directory suffix=".php">./src</directory> | ||
<whitelist> | ||
<directory suffix=".php">src/</directory> | ||
</whitelist> | ||
</filter> | ||
</phpunit> |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
namespace DoctrineEncrypt\Encryptors; | ||
|
||
use Illuminate\Contracts\Encryption\Encrypter; | ||
|
||
class LaravelEncryptor implements EncryptorInterface | ||
{ | ||
/** | ||
* @var Encrypter | ||
*/ | ||
private $encrypter; | ||
|
||
public function __construct(Encrypter $encrypter) | ||
{ | ||
$this->encrypter = $encrypter; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function encrypt($data) | ||
{ | ||
return $this->encrypter->encrypt($data); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function decrypt($data) | ||
{ | ||
return $this->encrypter->decrypt($data); | ||
} | ||
} |
Oops, something went wrong.