Skip to content

Commit 82e6849

Browse files
committed
Custom limitation: applied suggestions
1 parent c58018b commit 82e6849

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

code_samples/back_office/limitation/src/Controller/CustomController.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ private function getCustomLimitationValue(): bool
4444
return $hasAccess;
4545
}
4646

47-
$customLimitationValues = $this->permissionChecker->getRestrictions($hasAccess, CustomLimitationValue::class);
47+
$customLimitationValues = $this->permissionChecker->getRestrictions(
48+
$hasAccess,
49+
CustomLimitationValue::class
50+
);
4851

4952
return $customLimitationValues['value'] ?? false;
5053
}

code_samples/back_office/limitation/src/Security/Limitation/Mapper/CustomLimitationValueMapper.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99

1010
class CustomLimitationValueMapper implements LimitationValueMapperInterface
1111
{
12-
/** return array<bool> */
12+
/**
13+
* @return array<bool>
14+
*/
1315
public function mapLimitationValue(Limitation $limitation): array
1416
{
1517
return [$limitation->limitationValues['value']];
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{# templates/themes/standard/limitation/custom_limitation_value.html.twig #}
22
{% block ibexa_limitation_customlimitation_value %}
3-
{% set isSet = values | first %}
4-
<span style="color: {{ isSet ? 'green' : 'red' }};">{{ isSet ? 'Yes' : 'No' }}</span>
3+
{% set is_set = values | first %}
4+
<span style="color: {{ is_set ? 'green' : 'red' }};">{{ is_set ? 'Yes' : 'No' }}</span>
55
{% endblock %}

0 commit comments

Comments
 (0)