Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add date rules #678

Merged
merged 45 commits into from
Apr 3, 2024
Merged

Add date rules #678

merged 45 commits into from
Apr 3, 2024

Conversation

vjik
Copy link
Member

@vjik vjik commented Mar 29, 2024

Q A
Is bugfix?
New feature? ✔️
Breaks BC?
Fixed issues

@vjik vjik added the status:under development Someone is working on a pull request. label Mar 29, 2024
Copy link

what-the-diff bot commented Mar 29, 2024

PR Summary

  • New Entry in Changelog
    A new entry for release notes has been added in the project's changelog. This notes the addition of a feature related to date validation.

  • New Rules for Date Validation
    Two new files, Date.php and DateHandler.php have been added. These work together to introduce a new rule in the software that helps in validating dates.

  • Test File Addition
    A new file tests/Rule/DateTest.php has been added to ensure that the newly added date validation rule is working as expected. This file contains automated tests that check the correct functioning of these rules.

Note: This summary focuses on the actions taken and the larger scope changes. If more detailed, file-specific changes are needed, please let me know.

Copy link

codecov bot commented Mar 29, 2024

Codecov Report

Attention: Patch coverage is 85.32819% with 38 lines in your changes are missing coverage. Please review.

❗ No coverage uploaded for pull request base (1.x@c219619). Click here to learn what that means.

Files Patch % Lines
src/Rule/Date/DateTime.php 40.00% 15 Missing ⚠️
src/Rule/Date/Time.php 28.57% 15 Missing ⚠️
src/Rule/Date/DateTimeHandler.php 76.47% 4 Missing ⚠️
src/Rule/Date/DateHandler.php 86.66% 2 Missing ⚠️
src/Rule/Date/TimeHandler.php 86.66% 2 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##             1.x     #678   +/-   ##
======================================
  Coverage       ?   94.07%           
  Complexity     ?      906           
======================================
  Files          ?      104           
  Lines          ?     2817           
  Branches       ?        0           
======================================
  Hits           ?     2650           
  Misses         ?      167           
  Partials       ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@vjik vjik changed the title Add Date rule Add date rules Mar 29, 2024
@vjik vjik added status:code review The pull request needs review. and removed status:under development Someone is working on a pull request. labels Mar 29, 2024
@vjik vjik added status:under development Someone is working on a pull request. status:code review The pull request needs review. and removed status:code review The pull request needs review. status:under development Someone is working on a pull request. labels Apr 1, 2024
src/Rule/Date/BaseDateHandler.php Show resolved Hide resolved
src/Rule/Date/Date.php Outdated Show resolved Hide resolved
src/Rule/Date/Date.php Outdated Show resolved Hide resolved
src/Rule/Date/Date.php Outdated Show resolved Hide resolved
src/Rule/Date/Date.php Outdated Show resolved Hide resolved
src/Rule/Date/DateTime.php Outdated Show resolved Hide resolved
src/Rule/Date/DateTime.php Outdated Show resolved Hide resolved
src/Rule/Date/Time.php Outdated Show resolved Hide resolved
src/Rule/Date/Time.php Outdated Show resolved Hide resolved
src/Rule/Date/Time.php Outdated Show resolved Hide resolved
vjik and others added 10 commits April 1, 2024 21:16
Co-authored-by: Alexander Makarov <sam@rmcreative.ru>
Co-authored-by: Alexander Makarov <sam@rmcreative.ru>
Co-authored-by: Alexander Makarov <sam@rmcreative.ru>
Co-authored-by: Alexander Makarov <sam@rmcreative.ru>
Co-authored-by: Alexander Makarov <sam@rmcreative.ru>
Co-authored-by: Alexander Makarov <sam@rmcreative.ru>
Co-authored-by: Alexander Makarov <sam@rmcreative.ru>
Co-authored-by: Alexander Makarov <sam@rmcreative.ru>
Co-authored-by: Alexander Makarov <sam@rmcreative.ru>
@vjik vjik merged commit f4c688c into 1.x Apr 3, 2024
34 of 35 checks passed
@vjik vjik deleted the date branch April 3, 2024 06:50
arogachev added a commit that referenced this pull request May 23, 2024
* update irc link (#663)

* update docs folder link (#666)

* Add methods `addErrorWithFormatOnly()` and `addErrorWithoutPostProcessing()` to `Result` object (#665)

* Clarify psalm types in `Result` (#668)

* Update result docs (#676)

* Add `Image` validation rule (#670)

Co-authored-by: Alexey Rogachev <arogachev90@gmail.com>
Co-authored-by: Alexander Makarov <sam@rmcreative.ru>

* Add missed params to `Image` rule options (#680)

* Add date rules (#678)

Co-authored-by: Alexander Makarov <sam@rmcreative.ru>

* Add aspect ratio support to `Image` rule (#681)

* Add aspect ratio support to `Image` rule

* Apply fixes from StyleCI

* Code coverage, mutants

* Add detailed test cases' descriptions in data providers

* Change placeholders

* Work with options

* Work with options 2

* More configuration checks

* Fix logic, add PHPDoc

* Use value object for aspect ratio

* Actualize fix for mutant for absolute margin

* Fix error messages

* Fix new mutants

* Update src/Rule/Image/ImageAspectRatio.php

Co-authored-by: Sergei Predvoditelev <sergei@predvoditelev.ru>

* Do not use dedicated container in tests, fix last mutant

---------

Co-authored-by: StyleCI Bot <bot@styleci.io>
Co-authored-by: Sergei Predvoditelev <sergei@predvoditelev.ru>

* Release version 1.3.0

* Prepare for next release

* Update guides in english and Translate guides into Brazilian Portuguese  (#691)

* Add `Result::add()` method for merging other results to the base one (#686)

* Add `Result::add()` method for merging other results to the base one

* Apply fixes from StyleCI

* Update PR template [skip ci]

* Update src/Result.php

Co-authored-by: Alexander Makarov <sam@rmcreative.ru>

---------

Co-authored-by: StyleCI Bot <bot@styleci.io>
Co-authored-by: Alexander Makarov <sam@rmcreative.ru>

* Add type rules and `Any` rule (#692)

* Add type rules and handlers

* Apply fixes from StyleCI

* Mention in the docs + basic tests

* Apply fixes from StyleCI

* Fix copy paste [skip ci]

* Test error message

* Update changelog [skip ci]

* Update PHPDoc [skip ci]

* More tests and descriptions

* Apply fixes from StyleCI

* Include type in error message

* Add Any rule

* Apply fixes from StyleCI

* Update changelog [skip ci]

* Note [skip ci]

* Add translations [skip ci]

* Fix tests

* Test attributes

* Extract PHP >= 8.1 specific tests

* Apply fixes from StyleCI

* Extract PHP >= 8.1 specific tests 2

* Fix mutant

* Update CHANGELOG.md

Co-authored-by: Sergei Predvoditelev <sergei@predvoditelev.ru>

* Rename Any to AnyRule (review)

---------

Co-authored-by: StyleCI Bot <bot@styleci.io>
Co-authored-by: Sergei Predvoditelev <sergei@predvoditelev.ru>

* Rename `Any` rule in docs (#699)

* Rename AnyHandler (remaining occurence) (#701)

* Add methods for getting first error messages to `Result` (#697)

* Add methods for getting first error messages to `Result`

* Bump coverage

* Update src/Result.php

Co-authored-by: Sergei Predvoditelev <sergei@predvoditelev.ru>

* Update src/Result.php

Co-authored-by: Sergei Predvoditelev <sergei@predvoditelev.ru>

* Apply fixes from StyleCI

* Remove newline [skip ci]

* Add changelog entry [skip ci]

---------

Co-authored-by: Sergei Predvoditelev <sergei@predvoditelev.ru>
Co-authored-by: StyleCI Bot <bot@styleci.io>

* Translate Each rule docs into Russian (#688)

* Add `Unique` rule (#695)

* Add Unique rule

* Apply fixes from StyleCI

* More tests, messages [WIP]

* Apply fixes from StyleCI

* Test traslated attributes

* Test using as attribute

* Ready for review

* Apply fixes from StyleCI

* Update src/Rule/UniqueHandler.php

Co-authored-by: Dmitriy Derepko <xepozz@list.ru>

* Apply fixes from StyleCI

* Slightly different approach

* Apply fixes from StyleCI

* New test case to check strict equality

* Different approach

* Minor adjustments

* Remove comma, rename

* Update changelog [skip ci]

---------

Co-authored-by: StyleCI Bot <bot@styleci.io>
Co-authored-by: Dmitriy Derepko <xepozz@list.ru>
Co-authored-by: Sergei Predvoditelev <sergei@predvoditelev.ru>

* Fix typo in array shape (#705)

* Fix docs, translate brazilian portuguese (#708)

Co-authored-by: Sergei Predvoditelev <sergei@predvoditelev.ru>

* Release version 1.4.0

* Prepare for next release

* Merge fixes

---------

Co-authored-by: Ihor Sychevskyi <arhell333@gmail.com>
Co-authored-by: Alexey Rogachev <arogachev90@gmail.com>
Co-authored-by: Alexander Makarov <sam@rmcreative.ru>
Co-authored-by: StyleCI Bot <bot@styleci.io>
Co-authored-by: Luiz Marin <67489841+luizcmarin@users.noreply.github.com>
Co-authored-by: Danil Arduanov <rylezz@gmail.com>
Co-authored-by: Dmitriy Derepko <xepozz@list.ru>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:code review The pull request needs review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants