Improves SPDX header linting to ensure consistent license metadata across
the codebase.
Key changes:
- Enforce deterministic tag ordering (License-Identifier, FileCopyrightText,
FileContributor) to ensure consistency, prevent merge conflicts, and
simplify code reviews
- Add contributor alias mapping to consolidate contributors with multiple
emails or name variations (e.g., "nickl-" → "Nick Lombard")
- Add --contributions-strategy option with "blame" (current code authors)
and "log" (all historical contributors) to support different attribution
philosophies
- Add optional path argument to lint specific files or directories
- Add --fix option to automatically correct header issues
Assisted-by: Claude Code (claude-opus-4-5-20251101)
This commit introduces REUSE compliance by annotating all files
with SPDX information and placing the reused licences in the
LICENSES folder.
We additionally removed the docheader tool which is made obsolete
by this change.
The main LICENSE and copyright text of the project is now not under
my personal name anymore, and it belongs to "The Respect Project
Contributors" instead.
This change restores author names to several files, giving the
appropriate attribution for contributions.
Missing date information are now reset to 0 (1970-01-01T00:00:00),
because otherwise they are taken from current date/time, so:
`Respect\Validation\Validator::date("m")->isValid('06')` is not valid on
31st of every month.
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>
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
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>
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>
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)