Skip to content

Commit 3ae88ef

Browse files
bobfloatsroot
authored and
root
committed
Ran php-cs-fixer on all bundles
1 parent 773db72 commit 3ae88ef

File tree

200 files changed

+12276
-12121
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

200 files changed

+12276
-12121
lines changed

src/VersionControl/DoctrineEncryptBundle/Configuration/Encrypted.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* @author Victor Melnik <melnikvictorl@gmail.com>
99
* @Annotation
1010
*/
11-
class Encrypted {
11+
class Encrypted
12+
{
1213
// some parameters will be added
13-
}
14+
}

src/VersionControl/DoctrineEncryptBundle/DependencyInjection/Configuration.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,19 @@
66
use Symfony\Component\Config\Definition\ConfigurationInterface;
77

88
/**
9-
* Configuration tree for security bundle. Full tree you can see in Resources/docs
10-
*
9+
* Configuration tree for security bundle. Full tree you can see in Resources/docs.
10+
*
1111
* This is the class that validates and merges configuration from your app/config files
1212
*
1313
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
1414
*/
15-
class Configuration implements ConfigurationInterface {
16-
15+
class Configuration implements ConfigurationInterface
16+
{
1717
/**
18-
* {@inheritDoc}
18+
* {@inheritdoc}
1919
*/
20-
public function getConfigTreeBuilder() {
20+
public function getConfigTreeBuilder()
21+
{
2122
$treeBuilder = new TreeBuilder();
2223
$rootNode = $treeBuilder->root('versioncontrol_doctrine_encrypt');
2324
$supportedDrivers = array('orm');
@@ -44,7 +45,7 @@ public function getConfigTreeBuilder() {
4445
->scalarNode('db_driver')
4546
->validate()
4647
->ifNotInArray($supportedDrivers)
47-
->thenInvalid('The driver %s is not supported. Please choose one of ' . json_encode($supportedDrivers))
48+
->thenInvalid('The driver %s is not supported. Please choose one of '.json_encode($supportedDrivers))
4849
->end()
4950
->cannotBeOverwritten()
5051
->defaultValue($supportedDrivers[0])
@@ -54,5 +55,4 @@ public function getConfigTreeBuilder() {
5455

5556
return $treeBuilder;
5657
}
57-
58-
}
58+
}

src/VersionControl/DoctrineEncryptBundle/DependencyInjection/VersionControlDoctrineEncryptExtension.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@
1414
*
1515
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
1616
*/
17-
class VersionControlDoctrineEncryptExtension extends Extension {
18-
17+
class VersionControlDoctrineEncryptExtension extends Extension
18+
{
1919
/**
20-
* {@inheritDoc}
20+
* {@inheritdoc}
2121
*/
22-
public function load(array $configs, ContainerBuilder $container) {
22+
public function load(array $configs, ContainerBuilder $container)
23+
{
2324
$configuration = new Configuration();
2425
$config = $this->processConfiguration($configuration, $configs);
2526
$services = array('orm' => 'orm-services');
@@ -41,7 +42,7 @@ public function load(array $configs, ContainerBuilder $container) {
4142
$container->setParameter('versioncontrol_doctrine_encrypt.encryptor_class_name', $encryptorFullName);
4243
$container->setParameter('versioncontrol_doctrine_encrypt.secret_key', $config['secret_key']);
4344

44-
$loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
45+
$loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
4546
$loader->load(sprintf('%s.xml', $services[$config['db_driver']]));
4647
}
4748

src/VersionControl/DoctrineEncryptBundle/Encryptors/AES256Encryptor.php

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,49 +3,57 @@
33
namespace VersionControl\DoctrineEncryptBundle\Encryptors;
44

55
/**
6-
* Class for AES256 encryption
7-
*
6+
* Class for AES256 encryption.
7+
*
88
* @author Victor Melnik <melnikvictorl@gmail.com>
99
*/
10-
class AES256Encryptor implements EncryptorInterface {
11-
10+
class AES256Encryptor implements EncryptorInterface
11+
{
1212
/**
13-
* Secret key for aes algorythm
13+
* Secret key for aes algorythm.
14+
*
1415
* @var string
1516
*/
1617
private $secretKey;
1718

1819
/**
19-
* Initialization of encryptor
20-
* @param string $key
20+
* Initialization of encryptor.
21+
*
22+
* @param string $key
2123
*/
22-
public function __construct($key) {
24+
public function __construct($key)
25+
{
2326
$this->secretKey = $key;
2427
}
2528

2629
/**
27-
* Implementation of EncryptorInterface encrypt method
30+
* Implementation of EncryptorInterface encrypt method.
31+
*
2832
* @param string $data
33+
*
2934
* @return string
3035
*/
31-
public function encrypt($data) {
36+
public function encrypt($data)
37+
{
3238
return trim(base64_encode(mcrypt_encrypt(
3339
MCRYPT_RIJNDAEL_256, $this->secretKey, $data, MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND
3440
))));
3541
}
3642

3743
/**
38-
* Implementation of EncryptorInterface decrypt method
44+
* Implementation of EncryptorInterface decrypt method.
45+
*
3946
* @param string $data
40-
* @return string
47+
*
48+
* @return string
4149
*/
42-
function decrypt($data) {
50+
public function decrypt($data)
51+
{
4352
return trim(mcrypt_decrypt(
4453
MCRYPT_RIJNDAEL_256, $this->secretKey, base64_decode($data), MCRYPT_MODE_ECB, mcrypt_create_iv(
4554
mcrypt_get_iv_size(
4655
MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB
4756
), MCRYPT_RAND
4857
)));
4958
}
50-
51-
}
59+
}

src/VersionControl/DoctrineEncryptBundle/Encryptors/EncryptorInterface.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,24 @@
33
namespace VersionControl\DoctrineEncryptBundle\Encryptors;
44

55
/**
6-
* Encryptor interface for encryptors
7-
*
6+
* Encryptor interface for encryptors.
7+
*
88
* @author Victor Melnik <melnikvictorl@gmail.com>
99
*/
10-
interface EncryptorInterface {
11-
10+
interface EncryptorInterface
11+
{
1212
/**
13-
* Must accept secret key for encryption
13+
* Must accept secret key for encryption.
1414
*/
1515
public function __construct($secretKey);
1616

1717
/**
18-
* Must accept data and return encrypted data
18+
* Must accept data and return encrypted data.
1919
*/
2020
public function encrypt($data);
2121

2222
/**
23-
* Must accept data and return decrypted data
23+
* Must accept data and return decrypted data.
2424
*/
2525
public function decrypt($data);
26-
}
26+
}

0 commit comments

Comments
 (0)