Skip to content

Commit ad3ec75

Browse files
committed
Merge branch 'dev'
2 parents 6216193 + bf45e43 commit ad3ec75

11 files changed

Lines changed: 53 additions & 9 deletions

File tree

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@ composer.lock
44

55
# Others
66
*~
7-
nbproject

AlcalynPayplugBundle.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
use Symfony\Component\DependencyInjection\ContainerBuilder;
77
use Alcalyn\PayplugBundle\DependencyInjection\Compiler\RegisterMappingsPass;
88
use Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass;
9-
use Doctrine\Bundle\MongoDBBundle\DependencyInjection\Compiler\DoctrineMongoDBMappingsPass;
10-
use Doctrine\Bundle\CouchDBBundle\DependencyInjection\Compiler\DoctrineCouchDBMappingsPass;
119

1210
class AlcalynPayplugBundle extends Bundle
1311
{

DependencyInjection/Compiler/RegisterMappingsPass.php

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,38 @@
99

1010
class RegisterMappingsPass implements CompilerPassInterface
1111
{
12+
/**
13+
* @var Definition|Reference
14+
*/
1215
private $driver;
16+
17+
/**
18+
* @var string
19+
*/
1320
private $driverPattern;
21+
22+
/**
23+
* @var array
24+
*/
1425
private $namespaces;
26+
27+
/**
28+
* @var array
29+
*/
1530
private $managerParameters;
31+
32+
/**
33+
* @var mixed false or parameter name
34+
*/
1635
private $enabledParameter;
1736

37+
/**
38+
* @param Definition $driver
39+
* @param string $driverPattern
40+
* @param array $namespaces
41+
* @param string[] $managerParameters
42+
* @param mixed $enabledParameter
43+
*/
1844
public function __construct($driver, $driverPattern, $namespaces, $managerParameters, $enabledParameter = false)
1945
{
2046
$this->driver = $driver;
@@ -24,6 +50,9 @@ public function __construct($driver, $driverPattern, $namespaces, $managerParame
2450
$this->enabledParameter = $enabledParameter;
2551
}
2652

53+
/**
54+
* @param ContainerBuilder $container
55+
*/
2756
public function process(ContainerBuilder $container)
2857
{
2958
if ($this->enabledParameter && !$container->hasParameter($this->enabledParameter)) {
@@ -37,6 +66,13 @@ public function process(ContainerBuilder $container)
3766
}
3867
}
3968

69+
/**
70+
* @param ContainerBuilder $container
71+
*
72+
* @return string
73+
*
74+
* @throws ParameterNotFoundException
75+
*/
4076
protected function getChainDriverServiceName(ContainerBuilder $container)
4177
{
4278
foreach ($this->managerParameters as $param) {
@@ -51,6 +87,11 @@ protected function getChainDriverServiceName(ContainerBuilder $container)
5187
throw new ParameterNotFoundException('None of the managerParameters resulted in a valid name');
5288
}
5389

90+
/**
91+
* @param array $mappings
92+
*
93+
* @return \Alcalyn\PayplugBundle\DependencyInjection\Compiler\RegisterMappingsPass
94+
*/
5495
public static function createOrmMappingDriver(array $mappings)
5596
{
5697
$arguments = array($mappings, '.orm.yml');

DependencyInjection/Configuration.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
66
use Symfony\Component\Config\Definition\ConfigurationInterface;
7-
use Alcalyn\PayplugBundle\Model\Payment;
87
use Alcalyn\PayplugBundle\Model\IPN;
98

109
/**

Exceptions/PayplugException.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
class PayplugException extends \Exception
66
{
7+
/**
8+
* @param string $message
9+
*/
710
public function __construct($message)
811
{
912
parent::__construct($message, null, null);

Exceptions/PayplugUndefinedAccountParameterException.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
class PayplugUndefinedAccountParameterException extends PayplugException
66
{
7+
/**
8+
* @param string $missingParameter
9+
*/
710
public function __construct($missingParameter)
811
{
912
parent::__construct(sprintf('Payplug account parameter "%s" is needed but not set.', $missingParameter));

Model/IPN.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
namespace Alcalyn\PayplugBundle\Model;
44

5-
use Doctrine\ORM\Mapping as ORM;
6-
75
/**
86
* IPN
97
*

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ AlcalynPayplugBundle
33

44
[Payplug](https://www.payplug.fr/) integration to symfony2.
55

6+
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/alcalyn/payplug-bundle/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/alcalyn/payplug-bundle/?branch=master)
7+
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/5db1af60-63e4-40a6-bb5a-671725d9ac73/mini.png)](https://insight.sensiolabs.com/projects/5db1af60-63e4-40a6-bb5a-671725d9ac73)
8+
69
## Installation
710

811

Resources/config/doctrine/model/IPN.orm.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,3 @@ Alcalyn\PayplugBundle\Model\IPN:
1111
type: integer
1212
column: id_transaction
1313
nullable: true
14-

Services/PayplugIPNService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function verifyIPNRequest(Request $request)
5656
public function verifyIPN($body, $signature)
5757
{
5858
$publicKey = openssl_pkey_get_public($this->payplugPublicKey);
59-
return openssl_verify($body, $signature, $publicKey, OPENSSL_ALGO_SHA1);
59+
return 1 === openssl_verify($body, $signature, $publicKey, OPENSSL_ALGO_SHA1);
6060
}
6161

6262
/**

0 commit comments

Comments
 (0)