Skip to content

Commit

Permalink
Merge 1ba9536 into 3ba7583
Browse files Browse the repository at this point in the history
  • Loading branch information
william-suppo committed Apr 7, 2021
2 parents 3ba7583 + 1ba9536 commit b42cd31
Show file tree
Hide file tree
Showing 210 changed files with 636 additions and 1,719 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -10,7 +10,7 @@ php:
before_install:
- composer self-update
- composer --version
- if [ "$TRAVIS_PHP_VERSION" == "7.2" ]; then wget http://get.sensiolabs.org/php-cs-fixer.phar -O php-cs-fixer.phar; fi
- if [ "$TRAVIS_PHP_VERSION" == "7.2" ]; then wget https://cs.symfony.com/download/php-cs-fixer-v2.phar -O php-cs-fixer.phar; fi
- if [ "$TRAVIS_PHP_VERSION" == "7.2" ]; then php php-cs-fixer.phar --version; fi
- if [ "$TRAVIS_PHP_VERSION" == "7.2" ]; then wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.1.0/php-coveralls.phar; fi

Expand Down
2 changes: 1 addition & 1 deletion contrib/setup.sh
Expand Up @@ -2,7 +2,7 @@

if [ ! -f php-cs-fixer.phar ]; then
echo "The php-cs-fixer.phar is required... downloading..."
wget http://get.sensiolabs.org/php-cs-fixer.phar -O php-cs-fixer.phar || curl http://get.sensiolabs.org/php-cs-fixer.phar -o php-cs-fixer.phar || { echo >&2 "I require wget or curl but they are not installed. Aborting."; exit 1; }
wget https://cs.symfony.com/download/php-cs-fixer-v2.phar -O php-cs-fixer.phar || curl https://cs.symfony.com/download/php-cs-fixer-v2.phar -o php-cs-fixer.phar || { echo >&2 "I require wget or curl but they are not installed. Aborting."; exit 1; }
fi

# Copy the pre-commit hook to the current repository hooks directory.
Expand Down
3 changes: 0 additions & 3 deletions src/LightSaml/Action/ActionInterface.php
Expand Up @@ -15,8 +15,5 @@

interface ActionInterface
{
/**
* @param ContextInterface $context
*/
public function execute(ContextInterface $context);
}
5 changes: 0 additions & 5 deletions src/LightSaml/Action/ActionLogWrapper.php
Expand Up @@ -20,17 +20,12 @@ class ActionLogWrapper implements ActionWrapperInterface
*/
private $logger;

/**
* @param LoggerInterface $logger
*/
public function __construct(LoggerInterface $logger)
{
$this->logger = $logger;
}

/**
* @param ActionInterface $action
*
* @return ActionInterface
*/
public function wrap(ActionInterface $action)
Expand Down
2 changes: 0 additions & 2 deletions src/LightSaml/Action/ActionWrapperInterface.php
Expand Up @@ -14,8 +14,6 @@
interface ActionWrapperInterface
{
/**
* @param ActionInterface $action
*
* @return ActionInterface
*/
public function wrap(ActionInterface $action);
Expand Down
9 changes: 0 additions & 9 deletions src/LightSaml/Action/Assertion/AbstractAssertionAction.php
Expand Up @@ -22,17 +22,11 @@ abstract class AbstractAssertionAction implements ActionInterface
/** @var LoggerInterface */
protected $logger;

/**
* @param LoggerInterface $logger
*/
public function __construct(LoggerInterface $logger)
{
$this->logger = $logger;
}

/**
* @param ContextInterface $context
*/
public function execute(ContextInterface $context)
{
if ($context instanceof AssertionContext) {
Expand All @@ -42,8 +36,5 @@ public function execute(ContextInterface $context)
}
}

/**
* @param AssertionContext $context
*/
abstract protected function doExecute(AssertionContext $context);
}
Expand Up @@ -24,8 +24,7 @@ class AssertionIssuerFormatValidatorAction extends AbstractAssertionAction
private $expectedIssuerFormat = SamlConstants::NAME_ID_FORMAT_ENTITY;

/**
* @param LoggerInterface $logger
* @param string $expectedIssuerFormat
* @param string $expectedIssuerFormat
*/
public function __construct(LoggerInterface $logger, $expectedIssuerFormat)
{
Expand All @@ -34,9 +33,6 @@ public function __construct(LoggerInterface $logger, $expectedIssuerFormat)
$this->expectedIssuerFormat = $expectedIssuerFormat;
}

/**
* @param AssertionContext $context
*/
protected function doExecute(AssertionContext $context)
{
if (null == $context->getAssertion()->getIssuer()) {
Expand Down
Expand Up @@ -31,9 +31,7 @@ class AssertionSignatureValidatorAction extends AbstractAssertionAction
protected $requireSignature;

/**
* @param LoggerInterface $logger
* @param SignatureValidatorInterface $signatureValidator
* @param bool $requireSignature
* @param bool $requireSignature
*/
public function __construct(LoggerInterface $logger, SignatureValidatorInterface $signatureValidator, $requireSignature = true)
{
Expand All @@ -44,8 +42,6 @@ public function __construct(LoggerInterface $logger, SignatureValidatorInterface
}

/**
* @param AssertionContext $context
*
* @return void
*/
protected function doExecute(AssertionContext $context)
Expand All @@ -70,9 +66,9 @@ protected function doExecute(AssertionContext $context)
$keyNames = $credential->getKeyNames();
$this->logger->debug(
sprintf('Assertion signature validated with key "%s"', implode(', ', $keyNames)),
LogHelper::getActionContext($context, $this, array(
LogHelper::getActionContext($context, $this, [
'credential' => $credential,
))
])
);
} else {
$this->logger->warning(
Expand Down
Expand Up @@ -21,20 +21,13 @@ class AssertionValidatorAction extends AbstractAssertionAction
/** @var AssertionValidatorInterface */
protected $assertionValidator;

/**
* @param LoggerInterface $logger
* @param AssertionValidatorInterface $assertionValidator
*/
public function __construct(LoggerInterface $logger, AssertionValidatorInterface $assertionValidator)
{
parent::__construct($logger);

$this->assertionValidator = $assertionValidator;
}

/**
* @param AssertionContext $context
*/
protected function doExecute(AssertionContext $context)
{
$this->assertionValidator->validateAssertion($context->getAssertion());
Expand Down
Expand Up @@ -25,20 +25,13 @@ class InResponseToValidatorAction extends AbstractAssertionAction
/** @var RequestStateStoreInterface */
protected $requestStore;

/**
* @param LoggerInterface $logger
* @param RequestStateStoreInterface $requestStore
*/
public function __construct(LoggerInterface $logger, RequestStateStoreInterface $requestStore)
{
parent::__construct($logger);

$this->requestStore = $requestStore;
}

/**
* @param AssertionContext $context
*/
protected function doExecute(AssertionContext $context)
{
if (null === $context->getAssertion()->getSubject()) {
Expand All @@ -62,8 +55,7 @@ protected function doExecute(AssertionContext $context)
}

/**
* @param string $inResponseTo
* @param AssertionContext $context
* @param string $inResponseTo
*
* @return \LightSaml\State\Request\RequestState
*/
Expand Down
Expand Up @@ -23,10 +23,6 @@ class KnownAssertionIssuerAction extends AbstractAssertionAction
/** @var EntityDescriptorStoreInterface */
private $idpEntityDescriptorProvider;

/**
* @param LoggerInterface $logger
* @param EntityDescriptorStoreInterface $idpEntityDescriptorProvider
*/
public function __construct(LoggerInterface $logger, EntityDescriptorStoreInterface $idpEntityDescriptorProvider)
{
parent::__construct($logger);
Expand All @@ -35,8 +31,6 @@ public function __construct(LoggerInterface $logger, EntityDescriptorStoreInterf
}

/**
* @param AssertionContext $context
*
* @return void
*/
protected function doExecute(AssertionContext $context)
Expand Down
Expand Up @@ -30,10 +30,6 @@ class RecipientValidatorAction extends AbstractAssertionAction
/** @var EndpointResolverInterface */
private $endpointResolver;

/**
* @param LoggerInterface $logger
* @param EndpointResolverInterface $endpointResolver
*/
public function __construct(LoggerInterface $logger, EndpointResolverInterface $endpointResolver)
{
parent::__construct($logger);
Expand All @@ -42,8 +38,6 @@ public function __construct(LoggerInterface $logger, EndpointResolverInterface $
}

/**
* @param AssertionContext $context
*
* @return void
*/
protected function doExecute(AssertionContext $context)
Expand All @@ -53,20 +47,13 @@ protected function doExecute(AssertionContext $context)
}
}

/**
* @param AssertionContext $context
*/
protected function validateBearerAssertion(AssertionContext $context)
{
foreach ($context->getAssertion()->getSubject()->getBearerConfirmations() as $subjectConfirmation) {
$this->validateSubjectConfirmation($context, $subjectConfirmation);
}
}

/**
* @param AssertionContext $context
* @param SubjectConfirmation $subjectConfirmation
*/
protected function validateSubjectConfirmation(AssertionContext $context, SubjectConfirmation $subjectConfirmation)
{
$recipient = $subjectConfirmation->getSubjectConfirmationData()->getRecipient();
Expand Down
Expand Up @@ -29,10 +29,6 @@ class RepeatedIdValidatorAction extends AbstractAssertionAction
/** @var IdStoreInterface */
protected $idStore;

/**
* @param LoggerInterface $logger
* @param IdStoreInterface $idStore
*/
public function __construct(LoggerInterface $logger, IdStoreInterface $idStore)
{
parent::__construct($logger);
Expand All @@ -41,8 +37,6 @@ public function __construct(LoggerInterface $logger, IdStoreInterface $idStore)
}

/**
* @param AssertionContext $context
*
* @return void
*/
protected function doExecute(AssertionContext $context)
Expand All @@ -53,8 +47,6 @@ protected function doExecute(AssertionContext $context)
}

/**
* @param AssertionContext $context
*
* @throws \LightSaml\Error\LightSamlContextException
*/
protected function validateBearerAssertion(AssertionContext $context)
Expand Down Expand Up @@ -92,8 +84,6 @@ protected function validateBearerAssertion(AssertionContext $context)
}

/**
* @param AssertionContext $context
*
* @throws \LogicException
* @throws \LightSaml\Error\LightSamlValidationException
*
Expand Down
Expand Up @@ -29,10 +29,7 @@ class TimeValidatorAction extends AbstractAssertionAction
protected $allowedSecondsSkew;

/**
* @param LoggerInterface $logger
* @param AssertionTimeValidatorInterface $assertionTimeValidator
* @param TimeProviderInterface $timeProvider
* @param int $allowedSecondsSkew
* @param int $allowedSecondsSkew
*/
public function __construct(
LoggerInterface $logger,
Expand All @@ -48,8 +45,6 @@ public function __construct(
}

/**
* @param AssertionContext $context
*
* @return void
*/
protected function doExecute(AssertionContext $context)
Expand Down
6 changes: 0 additions & 6 deletions src/LightSaml/Action/CatchableErrorAction.php
Expand Up @@ -23,19 +23,13 @@ class CatchableErrorAction implements ActionInterface
/** @var ActionInterface */
protected $errorAction;

/**
* @param ActionInterface $mainAction
* @param ActionInterface $errorAction
*/
public function __construct(ActionInterface $mainAction, ActionInterface $errorAction)
{
$this->mainAction = $mainAction;
$this->errorAction = $errorAction;
}

/**
* @param ContextInterface $context
*
* @return void
*/
public function execute(ContextInterface $context)
Expand Down
16 changes: 6 additions & 10 deletions src/LightSaml/Action/CompositeAction.php
Expand Up @@ -16,12 +16,12 @@
class CompositeAction implements ActionInterface, DebugPrintTreeActionInterface, CompositeActionInterface
{
/** @var ActionInterface[] */
protected $children = array();
protected $children = [];

/**
* @param ActionInterface[] $children
*/
public function __construct(array $children = array())
public function __construct(array $children = [])
{
foreach ($children as $action) {
$this->add($action);
Expand All @@ -37,8 +37,6 @@ public function getChildren()
}

/**
* @param ActionInterface $action
*
* @return CompositeAction
*/
public function add(ActionInterface $action)
Expand All @@ -64,8 +62,6 @@ public function map($callable)
}

/**
* @param ContextInterface $context
*
* @return void
*/
public function execute(ContextInterface $context)
Expand All @@ -80,18 +76,18 @@ public function execute(ContextInterface $context)
*/
public function debugPrintTree()
{
$arr = array();
$arr = [];
foreach ($this->children as $childAction) {
if ($childAction instanceof DebugPrintTreeActionInterface) {
$arr = array_merge($arr, $childAction->debugPrintTree());
} else {
$arr = array_merge($arr, array(get_class($childAction) => array()));
$arr = array_merge($arr, [get_class($childAction) => []]);
}
}

$result = array(
$result = [
static::class => $arr,
);
];

return $result;
}
Expand Down
2 changes: 0 additions & 2 deletions src/LightSaml/Action/CompositeActionInterface.php
Expand Up @@ -14,8 +14,6 @@
interface CompositeActionInterface extends ActionInterface
{
/**
* @param ActionInterface $action
*
* @return CompositeActionInterface
*/
public function add(ActionInterface $action);
Expand Down

0 comments on commit b42cd31

Please sign in to comment.