Skip to content

Conversation

Alejinho
Copy link

@Alejinho Alejinho commented Dec 21, 2023

Fix the Validate Attribute. Currently the 'rule' argument passed to the Validate constructor is normalized but if the variable type is string, then it's not handled properly. Now the Validate attribute works properly if it's initialized with something like this:

<?php

class Foo {
  public function bar(
    #[Validate('some-rule')]
    string $name
  ): string {
    return 'ok';
  }
}

Fix the 'Validate' Attribute. Currently the 'rule' property passed to
the Validate constructor was normalized but wrong value was checked.
Now the Validate attribute should works properly if it's initialized
with something like this:

```php
<?php

class Foo {
  public function bar(
    #[Validate('some-rule')]
    string $name
  ): string {
    return 'ok';
  }
}
```
@Alejinho Alejinho closed this Dec 22, 2023
@Alejinho Alejinho reopened this Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant