This repository has been archived by the owner on Jan 29, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from salesupply/feature/allow-options-for-prope…
…rty-encryption Feature/allow options for property encryption
- Loading branch information
Showing
10 changed files
with
682 additions
and
9 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
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,87 @@ | ||
<?php | ||
|
||
namespace ZfDoctrineEncryptModule\Annotation; | ||
|
||
use Doctrine\Common\Annotations\Annotation\Target; | ||
|
||
/** | ||
* Class Encrypted | ||
* @package ZfDoctrineEncryptModule\Annotation | ||
* | ||
* The below register the class as to be used as Doctrine's Annotation and only on class properties. | ||
* | ||
* @Annotation | ||
* @Target("PROPERTY") | ||
*/ | ||
class Encrypted | ||
{ | ||
/** | ||
* @var string linked property which implements \ZfDoctrineEncryptModule\Interfaces\SpicyInterface | ||
*/ | ||
public $spices; | ||
|
||
/** | ||
* @var string linked property which implements \ZfDoctrineEncryptModule\Interfaces\SaltInterface | ||
*/ | ||
public $salt; | ||
|
||
/** | ||
* @var string linked property which implements \ZfDoctrineEncryptModule\Interfaces\PepperInterface | ||
*/ | ||
public $pepper; | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getSpices(): ?string | ||
{ | ||
return $this->spices; | ||
} | ||
|
||
/** | ||
* @param string $spices | ||
* @return Encrypted | ||
*/ | ||
public function setSpices(?string $spices): Encrypted | ||
{ | ||
$this->spices = $spices; | ||
return $this; | ||
} | ||
|
||
/** | ||
* @return null|string | ||
*/ | ||
public function getSalt(): ?string | ||
{ | ||
return $this->salt; | ||
} | ||
|
||
/** | ||
* @param null|string $salt | ||
* @return Encrypted | ||
*/ | ||
public function setSalt(?string $salt): Encrypted | ||
{ | ||
$this->salt = $salt; | ||
return $this; | ||
} | ||
|
||
/** | ||
* @return null|string | ||
*/ | ||
public function getPepper(): ?string | ||
{ | ||
return $this->pepper; | ||
} | ||
|
||
/** | ||
* @param null|string $pepper | ||
* @return Encrypted | ||
*/ | ||
public function setPepper(?string $pepper): Encrypted | ||
{ | ||
$this->pepper = $pepper; | ||
return $this; | ||
} | ||
|
||
} |
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,17 @@ | ||
<?php | ||
|
||
namespace ZfDoctrineEncryptModule\Interfaces; | ||
|
||
interface PepperInterface | ||
{ | ||
/** | ||
* @return string | ||
*/ | ||
public function getPepper(): string; | ||
|
||
/** | ||
* @param string $pepper | ||
* @return PepperInterface | ||
*/ | ||
public function setPepper(string $pepper): PepperInterface; | ||
} |
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,17 @@ | ||
<?php | ||
|
||
namespace ZfDoctrineEncryptModule\Interfaces; | ||
|
||
interface SaltInterface | ||
{ | ||
/** | ||
* @return string | ||
*/ | ||
public function getSalt(): string; | ||
|
||
/** | ||
* @param string $salt | ||
* @return SaltInterface | ||
*/ | ||
public function setSalt(string $salt): SaltInterface; | ||
} |
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 @@ | ||
<?php | ||
|
||
namespace ZfDoctrineEncryptModule\Interfaces; | ||
|
||
interface SpicyInterface extends SaltInterface, PepperInterface | ||
{ | ||
} |
Oops, something went wrong.