The phrase "granularity control for advanced reporting" is not
accurate anymore. Although we offer much better exception handling
now, we are currently not offering granularity control at a global
level (previously implemented by the check() interface).
If that were to be changed, we can restore that headline. I instead
replaced with the phrase "Advanced exception handling", which
accurately describes what we offer.
I also removed the `concrete-api.md`, which was a document
describing how we don't rely on static calls. We do, in fact,
recommend some of them, such as `ValidatorBuilder::init`, and
although they can be avoided, it relies on setting up a custom
container which we do not offer full documentation for yet.
We tried using `mkdocs-nav-weight` but it turned out quiet limited. Not
only we have to add specific frontmatter to the Markdown files, but we
could also not hide and sort directories.
This commit introduces awesome-pages, which allows us to customize the
order of pages and not list the content of the "validators" directory in
the left menu.
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.
When we make changes to the category of a validator, it's easy to forget
to update overall list of validators. This commit a GitHub actions that
will run a console command to check if the documentation it up-to-date.
The job will fail when we need to change the document, but the console
command will fix the issues, so there isn't a lot of friction there.
We used to have those to preserve the order of the pages when generating
the documentation with MkDocs. This commit introduces the
`mkdocs-nav-weight`, that allows us to make that order without having
those prefixes.
The name "rule" has always been confusing to me. It can be when you talk
about "validation rules", but it’s a very verbose way to describe it,
and it doesn’t work all the time.
This commit will rename the interface `Rule` to `Validator`, but it will
also rename the concept of "rule" to "validator".
The method has been renamed some time ago, but I haven't updated the
documentation to cause less confusion. Now that I want to start updating
the documentation, I switched the default branch on GitHub to the latest
stable version, so I assume there will be less confusion in the
documentation, and I can start updating the docs for the next version.
This commit will also remove Travis and Scrutinizer and will configure
Codecov as a code coverage tool.
A few changes in the PHPUnit configuration already had to be made
before, but became more visible now. They're along with this commit.
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
There is quite some duplication between the "README.md" file and the
"docs/index.md". This commit will separate what belongs to the
documentation and what is specific of the repository.
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
The current documentation is hosted via GitHub pages rendered by
"Couscous". Every time we need a new version of the documentation
published we need to manually execute the "couscous".
This commit reorganize the documentation to be published to
"Read the Docs" because it will also allow us to have documentations per
version of the library most importantly provider a search field for the
documentation.
The documentation will be then published on:
https://respect-validation.readthedocs.io/
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
* `ExceptionInterface`: all Respect\Validation\Exceptions implement through inheritance
* `ValidatorExceptionInterface`: implemented only by AllOfException. This allows the end users to know when there has been a Validator exception rather than just any of our exceptions.
Fixed formatting issues
Created two new exception types
* Created ValidationExceptionInterface
* Created NestedValidationExceptionInterface which extends ValidationExceptionInterface
* Renamed from ValidatorExceptionInterface
* ValidationException implements ValidationExceptionInterface and ValidationExceptionTest checks for the implementation.
* AbstractNestedException implements NestedValidationExceptionInterface and AbstractNestedExceptionTest checks for the implementation.
* CheckExceptionsTest now checks all Rule exceptions to make sure they implement ValidationExceptionInterface
* ValidatorTest now contains test that shows that only ValidationExceptionInterface can be used reliably with `::check()`
* Updated documentation for new exception types
* Reworked examples to show how to catch the exception interfaces
Minor changes in readme.md and ExceptionInterfaces
* Removed `import` statements (hahaha)
* Renamed `$e` to `$exception`
* `ValidationExceptionInterface` now extends `ExceptionInterface`. Changed `ValidationException` to match