Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
lib
unicaen
auth
Commits
a0f28d86
Commit
a0f28d86
authored
Apr 13, 2016
by
Laurent Lécluse
Browse files
Ajout de asserts, qui permet de chaîner des tests dans les assertions
parent
926e9703
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/UnicaenAuth/Assertion/AbstractAssertion.php
View file @
a0f28d86
...
...
@@ -274,6 +274,29 @@ abstract class AbstractAssertion implements AssertionInterface, ServiceLocatorAw
/**
* Parcours la liste des résultats des assertions transmises (liste de booleans)
* Si l'une d'entres elles est fausse alors false est retourné. true sinon.
*
* @param array $assertions
*
* @return bool
*/
protected
function
asserts
(
$assertions
)
{
if
(
!
is_array
(
$assertions
)){
$assertions
=
[
$assertions
];
}
foreach
(
$assertions
as
$assertion
){
if
(
!
$assertion
)
return
false
;
}
return
true
;
}
/**
* @return MvcEvent
*/
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment