@@ -1,8 +1,8 @@ |
||
| 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'; |
|
@@ -1,8 +1,10 @@ |
||
| 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 | +} |
|
@@ -64,10 +64,10 @@ |
||
| 64 | 64 | ->add(new EntityIdCriteria($entityDescriptor->getEntityID())) |
| 65 | 65 | ->add(new UsageCriteria(UsageType::SIGNING)) |
| 66 | 66 | ->add(new X509CredentialCriteria()) |
| 67 | - ->addIf(ProfileContext::ROLE_IDP === $profileContext->getOwnRole(), function () { |
|
| 67 | + ->addIf(ProfileContext::ROLE_IDP === $profileContext->getOwnRole(), function() { |
|
| 68 | 68 | return new MetadataCriteria(MetadataCriteria::TYPE_IDP, SamlConstants::VERSION_20); |
| 69 | 69 | }) |
| 70 | - ->addIf(ProfileContext::ROLE_SP === $profileContext->getOwnRole(), function () { |
|
| 70 | + ->addIf(ProfileContext::ROLE_SP === $profileContext->getOwnRole(), function() { |
|
| 71 | 71 | return new MetadataCriteria(MetadataCriteria::TYPE_SP, SamlConstants::VERSION_20); |
| 72 | 72 | }) |
| 73 | 73 | ; |
@@ -34,15 +34,15 @@ |
||
| 34 | 34 | */ |
| 35 | 35 | public function register(Container $pimple) |
| 36 | 36 | { |
| 37 | - $pimple[StoreContainer::REQUEST_STATE_STORE] = function () { |
|
| 37 | + $pimple[StoreContainer::REQUEST_STATE_STORE] = function() { |
|
| 38 | 38 | return new RequestStateSessionStore($this->systemContainer->getSession(), 'main'); |
| 39 | 39 | }; |
| 40 | 40 | |
| 41 | - $pimple[StoreContainer::ID_STATE_STORE] = function () { |
|
| 41 | + $pimple[StoreContainer::ID_STATE_STORE] = function() { |
|
| 42 | 42 | return new NullIdStore(); |
| 43 | 43 | }; |
| 44 | 44 | |
| 45 | - $pimple[StoreContainer::SSO_STATE_STORE] = function () { |
|
| 45 | + $pimple[StoreContainer::SSO_STATE_STORE] = function() { |
|
| 46 | 46 | return new SsoStateSessionStore($this->systemContainer->getSession(), 'samlsso'); |
| 47 | 47 | }; |
| 48 | 48 | } |
@@ -23,15 +23,15 @@ |
||
| 23 | 23 | */ |
| 24 | 24 | public function register(Container $pimple) |
| 25 | 25 | { |
| 26 | - $pimple[ProviderContainer::ATTRIBUTE_VALUE_PROVIDER] = function () { |
|
| 26 | + $pimple[ProviderContainer::ATTRIBUTE_VALUE_PROVIDER] = function() { |
|
| 27 | 27 | throw new LightSamlBuildException('Attribute value provider not set'); |
| 28 | 28 | }; |
| 29 | 29 | |
| 30 | - $pimple[ProviderContainer::SESSION_INFO_PROVIDER] = function () { |
|
| 30 | + $pimple[ProviderContainer::SESSION_INFO_PROVIDER] = function() { |
|
| 31 | 31 | throw new LightSamlBuildException('Session info provider not set'); |
| 32 | 32 | }; |
| 33 | 33 | |
| 34 | - $pimple[ProviderContainer::NAME_ID_PROVIDER] = function () { |
|
| 34 | + $pimple[ProviderContainer::NAME_ID_PROVIDER] = function() { |
|
| 35 | 35 | throw new LightSamlBuildException('Name ID provider not set'); |
| 36 | 36 | }; |
| 37 | 37 | } |
@@ -58,11 +58,11 @@ |
||
| 58 | 58 | */ |
| 59 | 59 | public function register(Container $pimple) |
| 60 | 60 | { |
| 61 | - $pimple[OwnContainer::OWN_CREDENTIALS] = function () { |
|
| 61 | + $pimple[OwnContainer::OWN_CREDENTIALS] = function() { |
|
| 62 | 62 | return $this->ownCredentials; |
| 63 | 63 | }; |
| 64 | 64 | |
| 65 | - $pimple[OwnContainer::OWN_ENTITY_DESCRIPTOR_PROVIDER] = function () { |
|
| 65 | + $pimple[OwnContainer::OWN_ENTITY_DESCRIPTOR_PROVIDER] = function() { |
|
| 66 | 66 | return $this->ownEntityDescriptorProvider; |
| 67 | 67 | }; |
| 68 | 68 | } |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | throw new LightSamlBuildException('There are no own credentials'); |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | - $pimple[CredentialContainer::CREDENTIAL_STORE] = function () { |
|
| 64 | + $pimple[CredentialContainer::CREDENTIAL_STORE] = function() { |
|
| 65 | 65 | $factory = new CredentialFactory(); |
| 66 | 66 | |
| 67 | 67 | return $factory->build( |
@@ -61,15 +61,15 @@ discard block |
||
| 61 | 61 | */ |
| 62 | 62 | public function register(Container $pimple) |
| 63 | 63 | { |
| 64 | - $pimple[ServiceContainer::NAME_ID_VALIDATOR] = function () { |
|
| 64 | + $pimple[ServiceContainer::NAME_ID_VALIDATOR] = function() { |
|
| 65 | 65 | return new NameIdValidator(); |
| 66 | 66 | }; |
| 67 | 67 | |
| 68 | - $pimple[ServiceContainer::ASSERTION_TIME_VALIDATOR] = function () { |
|
| 68 | + $pimple[ServiceContainer::ASSERTION_TIME_VALIDATOR] = function() { |
|
| 69 | 69 | return new AssertionTimeValidator(); |
| 70 | 70 | }; |
| 71 | 71 | |
| 72 | - $pimple[ServiceContainer::ASSERTION_VALIDATOR] = function (Container $c) { |
|
| 72 | + $pimple[ServiceContainer::ASSERTION_VALIDATOR] = function(Container $c) { |
|
| 73 | 73 | $nameIdValidator = $c[ServiceContainer::NAME_ID_VALIDATOR]; |
| 74 | 74 | |
| 75 | 75 | return new AssertionValidator( |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | ); |
| 80 | 80 | }; |
| 81 | 81 | |
| 82 | - $pimple[ServiceContainer::ENDPOINT_RESOLVER] = function () { |
|
| 82 | + $pimple[ServiceContainer::ENDPOINT_RESOLVER] = function() { |
|
| 83 | 83 | return new CompositeEndpointResolver([ |
| 84 | 84 | new BindingEndpointResolver(), |
| 85 | 85 | new DescriptorTypeEndpointResolver(), |
@@ -89,33 +89,33 @@ discard block |
||
| 89 | 89 | ]); |
| 90 | 90 | }; |
| 91 | 91 | |
| 92 | - $pimple[ServiceContainer::BINDING_FACTORY] = function () { |
|
| 92 | + $pimple[ServiceContainer::BINDING_FACTORY] = function() { |
|
| 93 | 93 | return new BindingFactory($this->systemContainer->getEventDispatcher()); |
| 94 | 94 | }; |
| 95 | 95 | |
| 96 | - $pimple[ServiceContainer::CREDENTIAL_RESOLVER] = function () { |
|
| 96 | + $pimple[ServiceContainer::CREDENTIAL_RESOLVER] = function() { |
|
| 97 | 97 | $factory = new CredentialResolverFactory($this->credentialContainer->getCredentialStore()); |
| 98 | 98 | |
| 99 | 99 | return $factory->build(); |
| 100 | 100 | }; |
| 101 | 101 | |
| 102 | - $pimple[ServiceContainer::SIGNATURE_RESOLVER] = function (Container $c) { |
|
| 102 | + $pimple[ServiceContainer::SIGNATURE_RESOLVER] = function(Container $c) { |
|
| 103 | 103 | $credentialResolver = $c[ServiceContainer::CREDENTIAL_RESOLVER]; |
| 104 | 104 | |
| 105 | 105 | return new OwnSignatureResolver($credentialResolver); |
| 106 | 106 | }; |
| 107 | 107 | |
| 108 | - $pimple[ServiceContainer::SIGNATURE_VALIDATOR] = function (Container $c) { |
|
| 108 | + $pimple[ServiceContainer::SIGNATURE_VALIDATOR] = function(Container $c) { |
|
| 109 | 109 | $credentialResolver = $c[ServiceContainer::CREDENTIAL_RESOLVER]; |
| 110 | 110 | |
| 111 | 111 | return new SignatureValidator($credentialResolver); |
| 112 | 112 | }; |
| 113 | 113 | |
| 114 | - $pimple[ServiceContainer::LOGOUT_SESSION_RESOLVER] = function () { |
|
| 114 | + $pimple[ServiceContainer::LOGOUT_SESSION_RESOLVER] = function() { |
|
| 115 | 115 | return new LogoutSessionResolver($this->storeContainer->getSsoStateStore()); |
| 116 | 116 | }; |
| 117 | 117 | |
| 118 | - $pimple[ServiceContainer::SESSION_PROCESSOR] = function () { |
|
| 118 | + $pimple[ServiceContainer::SESSION_PROCESSOR] = function() { |
|
| 119 | 119 | return new SessionProcessor($this->storeContainer->getSsoStateStore(), $this->systemContainer->getTimeProvider()); |
| 120 | 120 | }; |
| 121 | 121 | } |
@@ -36,11 +36,11 @@ discard block |
||
| 36 | 36 | */ |
| 37 | 37 | public function register(Container $pimple) |
| 38 | 38 | { |
| 39 | - $pimple[SystemContainer::REQUEST] = function () { |
|
| 39 | + $pimple[SystemContainer::REQUEST] = function() { |
|
| 40 | 40 | return Request::createFromGlobals(); |
| 41 | 41 | }; |
| 42 | 42 | |
| 43 | - $pimple[SystemContainer::SESSION] = function () { |
|
| 43 | + $pimple[SystemContainer::SESSION] = function() { |
|
| 44 | 44 | if ($this->mockSession) { |
| 45 | 45 | $session = new Session(new MockArraySessionStorage()); |
| 46 | 46 | } else { |
@@ -52,15 +52,15 @@ discard block |
||
| 52 | 52 | return $session; |
| 53 | 53 | }; |
| 54 | 54 | |
| 55 | - $pimple[SystemContainer::TIME_PROVIDER] = function () { |
|
| 55 | + $pimple[SystemContainer::TIME_PROVIDER] = function() { |
|
| 56 | 56 | return new SystemTimeProvider(); |
| 57 | 57 | }; |
| 58 | 58 | |
| 59 | - $pimple[SystemContainer::EVENT_DISPATCHER] = function () { |
|
| 59 | + $pimple[SystemContainer::EVENT_DISPATCHER] = function() { |
|
| 60 | 60 | return new EventDispatcher(); |
| 61 | 61 | }; |
| 62 | 62 | |
| 63 | - $pimple[SystemContainer::LOGGER] = function () { |
|
| 63 | + $pimple[SystemContainer::LOGGER] = function() { |
|
| 64 | 64 | return new NullLogger(); |
| 65 | 65 | }; |
| 66 | 66 | } |
@@ -25,15 +25,15 @@ |
||
| 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 | } |