diff --git a/src/Resources/skeleton/security/Voter.tpl.php b/src/Resources/skeleton/security/Voter.tpl.php index 181dbcdac..c3ee8561d 100644 --- a/src/Resources/skeleton/security/Voter.tpl.php +++ b/src/Resources/skeleton/security/Voter.tpl.php @@ -10,10 +10,13 @@ class extends Voter { protected function supports($attribute, $subject) { - // replace with your own logic - // https://symfony.com/doc/current/security/voters.html - return in_array($attribute, ['POST_EDIT', 'POST_VIEW']) - && $subject instanceof \App\Entity\BlogPost; + // Replace with your own logic + // See https://symfony.com/doc/current/security/voters.html + // + // return in_array($attribute, ['POST_EDIT', 'POST_VIEW']) + // && $subject instanceof \App\Entity\YourEntity; + + return false; } protected function voteOnAttribute($attribute, $subject, TokenInterface $token) diff --git a/src/Resources/skeleton/serializer/Normalizer.tpl.php b/src/Resources/skeleton/serializer/Normalizer.tpl.php index 6d38f631b..efe438bbe 100644 --- a/src/Resources/skeleton/serializer/Normalizer.tpl.php +++ b/src/Resources/skeleton/serializer/Normalizer.tpl.php @@ -25,6 +25,11 @@ public function normalize($object, $format = null, array $context = array()): ar public function supportsNormalization($data, $format = null): bool { - return $data instanceof \App\Entity\BlogPost; + // Replace with your own logic + // See https://symfony.com/doc/current/serializer/custom_normalizer.html + // + // return $data instanceof \App\Entity\YourEntity; + + return false; } } diff --git a/tests/ValidatorTest.php b/tests/ValidatorTest.php index ed95e2b61..3133d4bec 100644 --- a/tests/ValidatorTest.php +++ b/tests/ValidatorTest.php @@ -66,7 +66,9 @@ public function testInvalidClassName() public function testInvalidEncodingInClassName() { $this->expectException(RuntimeCommandException::class); - $this->expectExceptionMessage('"�Controller" is not a UTF-8-encoded string.'); - Validator::validateClassName(mb_convert_encoding('Ś', 'ISO-8859-2', 'UTF-8')); + $invalidName = mb_convert_encoding('Fôö', 'ISO-8859-2', 'UTF-8'); + $this->expectExceptionMessage(sprintf('"%s" is not a UTF-8-encoded string.', $invalidName)); + Validator::validateClassName($invalidName); + } }