Completed
Push — master ( 3ba758...b5e37b )
by Liaw
02:27
created
src/LightSaml/Bridge/Pimple/Container/Factory/OwnContainerProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -61,11 +61,11 @@
 block discarded – undo
61 61
      */
62 62
     public function register(Container $pimple)
63 63
     {
64
-        $pimple[OwnContainer::OWN_CREDENTIALS] = function () {
64
+        $pimple[OwnContainer::OWN_CREDENTIALS] = function() {
65 65
             return $this->ownCredentials;
66 66
         };
67 67
 
68
-        $pimple[OwnContainer::OWN_ENTITY_DESCRIPTOR_PROVIDER] = function () {
68
+        $pimple[OwnContainer::OWN_ENTITY_DESCRIPTOR_PROVIDER] = function() {
69 69
             return $this->ownEntityDescriptorProvider;
70 70
         };
71 71
     }
Please login to merge, or discard this patch.
src/LightSaml/Bridge/Pimple/Container/Factory/PartyContainerProvider.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -25,15 +25,15 @@
 block discarded – undo
25 25
      */
26 26
     public function register(Container $pimple)
27 27
     {
28
-        $pimple[PartyContainer::IDP_ENTITY_DESCRIPTOR] = function () {
28
+        $pimple[PartyContainer::IDP_ENTITY_DESCRIPTOR] = function() {
29 29
             return new FixedEntityDescriptorStore();
30 30
         };
31 31
 
32
-        $pimple[PartyContainer::SP_ENTITY_DESCRIPTOR] = function () {
32
+        $pimple[PartyContainer::SP_ENTITY_DESCRIPTOR] = function() {
33 33
             return new FixedEntityDescriptorStore();
34 34
         };
35 35
 
36
-        $pimple[PartyContainer::TRUST_OPTIONS_STORE] = function () {
36
+        $pimple[PartyContainer::TRUST_OPTIONS_STORE] = function() {
37 37
             return new FixedTrustOptionsStore(new TrustOptions());
38 38
         };
39 39
     }
Please login to merge, or discard this patch.
src/LightSaml/Resolver/Signature/OwnSignatureResolver.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -70,10 +70,10 @@
 block discarded – undo
70 70
             ->add(new EntityIdCriteria($entityDescriptor->getEntityID()))
71 71
             ->add(new UsageCriteria(UsageType::SIGNING))
72 72
             ->add(new X509CredentialCriteria())
73
-            ->addIf(ProfileContext::ROLE_IDP === $profileContext->getOwnRole(), function () {
73
+            ->addIf(ProfileContext::ROLE_IDP === $profileContext->getOwnRole(), function() {
74 74
                 return new MetadataCriteria(MetadataCriteria::TYPE_IDP, SamlConstants::VERSION_20);
75 75
             })
76
-            ->addIf(ProfileContext::ROLE_SP === $profileContext->getOwnRole(), function () {
76
+            ->addIf(ProfileContext::ROLE_SP === $profileContext->getOwnRole(), function() {
77 77
                 return new MetadataCriteria(MetadataCriteria::TYPE_SP, SamlConstants::VERSION_20);
78 78
             })
79 79
         ;
Please login to merge, or discard this patch.
autoload.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // if library is in dev environement with its own vendor, include its autoload
4
-if(file_exists(__DIR__ . '/vendor'))
5
-    require_once __DIR__ . '/vendor/autoload.php';
4
+if (file_exists(__DIR__.'/vendor'))
5
+    require_once __DIR__.'/vendor/autoload.php';
6 6
 // if library is in vendor of another project, include the global autolaod
7 7
 else
8
-    require_once __DIR__ . '/../../autoload.php';
8
+    require_once __DIR__.'/../../autoload.php';
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,8 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // if library is in dev environement with its own vendor, include its autoload
4
-if(file_exists(__DIR__ . '/vendor'))
5
-    require_once __DIR__ . '/vendor/autoload.php';
4
+if(file_exists(__DIR__ . '/vendor')) {
5
+    require_once __DIR__ . '/vendor/autoload.php';
6
+}
6 7
 // if library is in vendor of another project, include the global autolaod
7
-else
8
-    require_once __DIR__ . '/../../autoload.php';
8
+else {
9
+    require_once __DIR__ . '/../../autoload.php';
10
+}
Please login to merge, or discard this patch.
tests/LightSaml/Tests/Action/ActionLogWrapperTest.php 3 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,10 +17,10 @@
 block discarded – undo
17 17
             ->method('execute')
18 18
             ->with($context);
19 19
 
20
-        $loggerMock  = $this->getLoggerMock();
20
+        $loggerMock = $this->getLoggerMock();
21 21
         $loggerMock->expects($this->once())
22 22
             ->method('debug')
23
-            ->willReturnCallback(function ($pMessage, $pContext) use ($action, $context) {
23
+            ->willReturnCallback(function($pMessage, $pContext) use ($action, $context) {
24 24
                 $expectedMessage = sprintf('Executing action "%s"', get_class($action));
25 25
                 $this->assertEquals($expectedMessage, $pMessage);
26 26
                 $this->assertArrayHasKey('context', $pContext);
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
     }
39 39
 
40 40
     /**
41
-     * @return \PHPUnit_Framework_MockObject_MockObject|ActionInterface
41
+     * @return ActionInterface
42 42
      */
43 43
     private function getActionMock()
44 44
     {
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
     }
47 47
 
48 48
     /**
49
-     * @return \PHPUnit_Framework_MockObject_MockObject|\LightSaml\Context\ContextInterface
49
+     * @return \LightSaml\Context\ContextInterface
50 50
      */
51 51
     private function getContextMock()
52 52
     {
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,6 @@
 block discarded – undo
5 5
 use LightSaml\Action\ActionInterface;
6 6
 use LightSaml\Action\ActionLogWrapper;
7 7
 use LightSaml\Tests\BaseTestCase;
8
-use Psr\Log\LoggerInterface;
9 8
 
10 9
 class ActionLogWrapperTest extends BaseTestCase
11 10
 {
Please login to merge, or discard this patch.
tests/LightSaml/Tests/Action/WrappedActionTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
         $wrapper->expects($this->once())
24 24
             ->method('beforeAction')
25 25
             ->with($context)
26
-            ->willReturnCallback(function () use (&$beforeCalled, &$executeCalled, &$afterCalled) {
26
+            ->willReturnCallback(function() use (&$beforeCalled, &$executeCalled, &$afterCalled) {
27 27
                 $this->assertFalse($beforeCalled, 'beforeAction already called - should be called only once');
28 28
                 $this->assertFalse($executeCalled, 'execute should not been executed before beforeAction');
29 29
                 $this->assertFalse($afterCalled, 'afterAction should be executed before beforeAction');
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
         $action->expects($this->once())
34 34
             ->method('execute')
35 35
             ->with($context)
36
-            ->willReturnCallback(function () use (&$beforeCalled, &$executeCalled, &$afterCalled) {
36
+            ->willReturnCallback(function() use (&$beforeCalled, &$executeCalled, &$afterCalled) {
37 37
                 $this->assertTrue($beforeCalled, 'beforeAction should have been called');
38 38
                 $this->assertFalse($executeCalled, 'execute already called - should be executed only once');
39 39
                 $this->assertFalse($afterCalled, 'afterAction should be executed before beforeAction');
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         $wrapper->expects($this->once())
44 44
             ->method('afterAction')
45 45
             ->with($context)
46
-            ->willReturnCallback(function () use (&$beforeCalled, &$executeCalled, &$afterCalled) {
46
+            ->willReturnCallback(function() use (&$beforeCalled, &$executeCalled, &$afterCalled) {
47 47
                 $this->assertTrue($beforeCalled, 'beforeAction should have been called');
48 48
                 $this->assertTrue($executeCalled, 'execute should be executed before afterAction');
49 49
                 $this->assertFalse($afterCalled, 'afterAction already called - should be executed only once');
Please login to merge, or discard this patch.
tests/LightSaml/Tests/Action/CatchableErrorActionTest.php 3 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 
20 20
     public function test_execute_calls_first_action()
21 21
     {
22
-        $mainAction =  new CatchableErrorAction(
22
+        $mainAction = new CatchableErrorAction(
23 23
             $firstAction = $this->getActionMock(),
24 24
             $secondAction = $this->getActionMock()
25 25
         );
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 
36 36
     public function test_execute_calls_second_action_if_first_throws_exception_and_add_exception_to_context()
37 37
     {
38
-        $mainAction =  new CatchableErrorAction(
38
+        $mainAction = new CatchableErrorAction(
39 39
             $firstAction = $this->getActionMock(),
40 40
             $secondAction = $this->getActionMock()
41 41
         );
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
     }
60 60
 
61 61
     /**
62
-     * @return \PHPUnit_Framework_MockObject_MockObject|\LightSaml\Action\ActionInterface
62
+     * @return ActionInterface
63 63
      */
64 64
     private function getActionMock()
65 65
     {
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
     }
68 68
 
69 69
     /**
70
-     * @return \PHPUnit_Framework_MockObject_MockObject|\LightSaml\Context\ContextInterface
70
+     * @return ContextInterface
71 71
      */
72 72
     private function getContextMock()
73 73
     {
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,6 @@
 block discarded – undo
7 7
 use LightSaml\Context\AbstractContext;
8 8
 use LightSaml\Context\ContextInterface;
9 9
 use LightSaml\Context\Profile\ExceptionContext;
10
-use LightSaml\Context\Profile\ProfileContext;
11 10
 use LightSaml\Context\Profile\ProfileContexts;
12 11
 use LightSaml\Tests\BaseTestCase;
13 12
 
Please login to merge, or discard this patch.
Action/Profile/Inbound/Message/AbstractDestinationValidatorActionTest.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -63,8 +63,8 @@
 block discarded – undo
63 63
     public function makes_descriptor_type_criteria_for_own_role_provider()
64 64
     {
65 65
         return [
66
-           [ProfileContext::ROLE_IDP, IdpSsoDescriptor::class],
67
-           [ProfileContext::ROLE_SP, SpSsoDescriptor::class],
66
+            [ProfileContext::ROLE_IDP, IdpSsoDescriptor::class],
67
+            [ProfileContext::ROLE_SP, SpSsoDescriptor::class],
68 68
         ];
69 69
     }
70 70
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@
 block discarded – undo
82 82
 
83 83
         $endpointResolverMock->expects($this->once())
84 84
             ->method('resolve')
85
-            ->willReturnCallback(function (CriteriaSet $criteriaSet, array $endpoints) use ($descriptorType, $expectedDestination) {
85
+            ->willReturnCallback(function(CriteriaSet $criteriaSet, array $endpoints) use ($descriptorType, $expectedDestination) {
86 86
                 $this->assertTrue($criteriaSet->has(LocationCriteria::class));
87 87
                 $arr = $criteriaSet->get(LocationCriteria::class);
88 88
                 $this->assertCount(1, $arr);
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,6 @@
 block discarded – undo
12 12
 use LightSaml\Profile\Profiles;
13 13
 use LightSaml\Resolver\Endpoint\Criteria\DescriptorTypeCriteria;
14 14
 use LightSaml\Resolver\Endpoint\Criteria\LocationCriteria;
15
-use LightSaml\Resolver\Endpoint\EndpointResolverInterface;
16 15
 use LightSaml\Tests\BaseTestCase;
17 16
 
18 17
 class AbstractDestinationValidatorActionTest extends BaseTestCase
Please login to merge, or discard this patch.
Profile/Inbound/Message/DestinationValidatorAuthnRequestActionTest.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
 
26 26
         $endpointResolverMock->expects($this->once())
27 27
             ->method('resolve')
28
-            ->willReturnCallback(function (CriteriaSet $criteriaSet, array $endpoints) {
28
+            ->willReturnCallback(function(CriteriaSet $criteriaSet, array $endpoints) {
29 29
                 $this->assertTrue($criteriaSet->has(ServiceTypeCriteria::class));
30 30
                 $arr = $criteriaSet->get(ServiceTypeCriteria::class);
31 31
                 $this->assertCount(1, $arr);
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,6 @@
 block discarded – undo
10 10
 use LightSaml\Model\Protocol\AuthnRequest;
11 11
 use LightSaml\Profile\Profiles;
12 12
 use LightSaml\Resolver\Endpoint\Criteria\ServiceTypeCriteria;
13
-use LightSaml\Resolver\Endpoint\EndpointResolverInterface;
14 13
 use LightSaml\Tests\BaseTestCase;
15 14
 
16 15
 class DestinationValidatorAuthnRequestActionTest extends BaseTestCase
Please login to merge, or discard this patch.