Commit graph

11 commits

Author SHA1 Message Date
Henrique Moody
cfeb01e89e
Bump respect/coding-standard from 4 to 5 2025-12-18 19:03:39 +01:00
Henrique Moody
7f66bcea10
Bump PHP support from 8.1 to 8.5
We want to release version 3.0 as fresh as possible, without having to
maintain backward compatibility with the previous versions. Because that
version will be on for some time, we decided it will be best to support
only PHP version 8.5 or higher.

Acked-by: Alexandre Gomes Gaigalas <alganet@gmail.com>
2025-12-18 19:03:38 +01:00
agchan12
c4ebcd9d59
Increase CanValidateDateTimeTest invalid data test coverage
This change is to ensure `Respect\Validation` is intentional about the
DateTime formats.

For context the [ISO 8601][] standard says that we shouldn't accept
`-00:00` (or anything similar) offsets.

I noticed that there was an a [change][] in how
`CanValidateDateTime.php` behaved from v2.2 to v2.3.

Prior to v2.3 date time formats of `2018-01-30T19:04:35-00:00` (note the
-00:00) would pass validation. After updating to v2.3 the format is not
accepted.

This is because the `DateTime::createFromFormat` accepts the `$value`
of `2018-01-30T19:04:35-00:00` but internally converts the `-00:00` to
`+00:00`

```
$formattedDate = DateTime::createFromFormat(
    $format,
    $value,
    new DateTimeZone(date_default_timezone_get())
);
```

This in turn causes the validation around
`$value !== $formattedDate->format($format))` to fail

```
if ($formattedDate === false || $value !== $formattedDate->format($format)) {
    return false;
}
```

[ISO 8601]: https://en.wikipedia.org/wiki/ISO_8601#Other_time_offset_specifications
[change]: 5fe4b96ebf
2024-11-27 09:44:33 +01:00
Henrique Moody
12c145756c
Upgrade "phpunit/phpunit"
This commit also replaces PHPUnit annotations with attributes.

Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2024-01-28 14:16:52 +01:00
Henrique Moody
9a13c9fb03
Update coding standards
This change will bring many breaking changes. The good thing is that we
can finally use more modern resources available in PHP.

I can imagine that's not a popular change since it will bring many
breaking changes to users, but we shouldn't be stuck in time because of
that. Using some of those features will make it easier to contribute to
the project. At least, I hope so.

There are still some useless doc-blocks, and we're not using "readonly"
properties when we could. I aim to send those changes soon.

Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2024-01-28 00:22:41 +01:00
Henrique Moody
2ee7509c2e
Make data providers static
From PHPUnit 10, all data providers need to be static. This commit will
make migrating from version 9 to 10 a bit easier.

Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2023-04-03 17:20:31 +02:00
Alexandre Gomes Gaigalas
ab3732f91f Use SPDX IDs for licensing
SPDX IDs are shorter than licensing notes previously used, and
adhere better to FOSS standards. It is also machine-readable.
2023-02-19 00:19:10 -03:00
Alexandre Gomes Gaigalas
15f148da24 Dusting off. See CHANGELOG.md for more details on this commit 2023-02-13 03:59:11 -03:00
Henrique Moody
ef8a8f4b27
Turn LICENSE file into plain/text
There is no need for that file to be a Markdown, and it can be a plain
text file.

Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2019-05-23 16:21:34 +02:00
Henrique Moody
c30603759e
Apply "SlevomatCodingStandard.TypeHints.TypeHintDeclaration"
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2019-02-09 14:09:28 +01:00
Henrique Moody
73f9380d9e
Use a more consisten names for traits
Because traits are behaviors that are added to a class, it makes sense
to name them with the behavior that they add the classes that use them.

Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2018-12-06 21:21:42 +01:00
Renamed from tests/unit/Helpers/DateTimeHelperTest.php (Browse further)