Skip to content

Commit

Permalink
[Validator] Misc tweaks in MacAddress and Charset constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
javiereguiluz committed May 7, 2024
1 parent b80bbc7 commit dabb2d9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions reference/constraints/Charset.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ Options

An encoding or a set of encodings to check against. If you pass an array of
encodings, the validator will check if the value is encoded in *any* of the
encodings. This option accepts any value that can be passed to
:phpfunction:`mb_detect_encoding`.
encodings. This option accepts any value that can be passed to the
:phpfunction:`mb_detect_encoding` PHP function.

.. include:: /reference/constraints/_groups-option.rst.inc

Expand Down
14 changes: 7 additions & 7 deletions reference/constraints/MacAddress.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ Basic Usage
-----------

To use the MacAddress validator, apply it to a property on an object that
will contain a host name.
can contain a MAC address:

.. configuration-block::

.. code-block:: php-attributes
// src/Entity/Author.php
// src/Entity/Device.php
namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
class Author
class Device
{
#[Assert\MacAddress]
protected string $mac;
Expand All @@ -39,7 +39,7 @@ will contain a host name.
.. code-block:: yaml
# config/validator/validation.yaml
App\Entity\Author:
App\Entity\Device:
properties:
mac:
- MacAddress: ~
Expand All @@ -52,7 +52,7 @@ will contain a host name.
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping https://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd">
<class name="App\Entity\Author">
<class name="App\Entity\Device">
<property name="max">
<constraint name="MacAddress"/>
</property>
Expand All @@ -61,13 +61,13 @@ will contain a host name.
.. code-block:: php
// src/Entity/Author.php
// src/Entity/Device.php
namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Validator\Mapping\ClassMetadata;
class Author
class Device
{
// ...
Expand Down

0 comments on commit dabb2d9

Please sign in to comment.