Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
* develop: (85 commits)
  specify next release
  fix documentation
  fix PointInTime::equals() and ::aheadOf()
  increase the number of scenarii per proof in the CI
  test negative cases
  fix negative milliseconds case
  fix precision of elapsed periods
  typos
  fix inability to express a positive offset of less than an hour
  reduce accepted unicity down to 80%
  disable testing with cookie format
  include microseconds in PointInTime::toString()
  add periodic CI
  add Clock::ofFormat()
  remove outdated doc
  remove PointInTime::milliseconds()
  force the use of a format to parse a string
  add documentation
  remove useless ::toString() methods
  cover failing paths of Clock::at()
  ...
  • Loading branch information
Baptouuuu committed Nov 28, 2024
2 parents e26656d + de89fa7 commit 279a66d
Show file tree
Hide file tree
Showing 1,112 changed files with 8,890 additions and 21,085 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/.gitattributes export-ignore
/.gitignore export-ignore
/phpunit.xml.dist export-ignore
/blackbox.php export-ignore
/tests export-ignore
22 changes: 12 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,25 @@ jobs:
os: [ubuntu-latest, macOS-latest]
php-version: ['8.2', '8.3']
dependencies: ['lowest', 'highest']
name: 'PHPUnit'
name: 'BlackBox'
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, intl
coverage: xdebug
- name: Composer
uses: "ramsey/composer-install@v2"
uses: "ramsey/composer-install@v3"
with:
dependency-versions: ${{ matrix.dependencies }}
- name: PHPUnit
run: vendor/bin/phpunit --coverage-clover=coverage.clover
- uses: codecov/codecov-action@v1
- name: BlackBox
run: php blackbox.php
env:
ENABLE_COVERAGE: 'true'
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
psalm:
Expand All @@ -38,14 +40,14 @@ jobs:
name: 'Psalm'
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, intl
- name: Composer
uses: "ramsey/composer-install@v2"
uses: "ramsey/composer-install@v3"
with:
dependency-versions: ${{ matrix.dependencies }}
- name: Psalm
Expand All @@ -58,13 +60,13 @@ jobs:
name: 'CS'
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, intl
- name: Composer
uses: "ramsey/composer-install@v2"
uses: "ramsey/composer-install@v3"
- name: CS
run: vendor/bin/php-cs-fixer fix --diff --dry-run
27 changes: 27 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Documentation
on:
push:
branches: [master]
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install mkdocs-material
- run: mkdocs gh-deploy --force
33 changes: 33 additions & 0 deletions .github/workflows/periodic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Periodic CI

on:
schedule:
- cron: '0 1 * * 0'
push:
paths:
- '.github/workflows/periodic.yml'

jobs:
blackbox:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
php-version: ['8.3']
dependency-versions: ['highest']
name: 'BlackBox'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, intl
coverage: none
- name: Composer
uses: "ramsey/composer-install@v3"
with:
dependency-versions: ${{ matrix.dependencies }}
- name: BlackBox
run: php blackbox.php ci
23 changes: 23 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Create release

on:
push:
tags:
- '*'

permissions:
contents: write

jobs:
release:
name: Create release
runs-on: ubuntu-22.04
steps:
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
run: |
gh release create "$tag" \
--repo="$GITHUB_REPOSITORY" \
--generate-notes
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
composer.lock
vendor
.phpunit.result.cache
.cache
2 changes: 1 addition & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php

return Innmind\CodingStandard\CodingStandard::config(['src', 'tests', 'fixtures']);
return Innmind\CodingStandard\CodingStandard::config(['src', 'proofs', 'tests', 'fixtures']);
78 changes: 78 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,83 @@
# Changelog

## 4.0.0 - 2024-11-28

## Added

- `Innmind\TimeContinuum\Clock::switch()`
- `Innmind\TimeContinuum\Calendar\Month`
- `Innmind\TimeContinuum\PointInTime\Month::ofYear()`
- `Innmind\TimeContinuum\Calendar\Day`
- `Innmind\TimeContinuum\PointInTime\Day::ofWeek()`
- `Innmind\TimeContinuum\Period::year()` named constructor
- `Innmind\TimeContinuum\Period::month()` named constructor
- `Innmind\TimeContinuum\Period::day()` named constructor
- `Innmind\TimeContinuum\Period::hour()` named constructor
- `Innmind\TimeContinuum\Period::minute()` named constructor
- `Innmind\TimeContinuum\Period::second()` named constructor
- `Innmind\TimeContinuum\Period::millisecond()` named constructor
- `Innmind\TimeContinuum\PointInTime::microsecond()`
- `Innmind\TimeContinuum\Clock::ofFormat()`
- `Innmind\TimeContinuum\Offset::plus()`
- `Innmind\TimeContinuum\Offset::minus()`
- `Innmind\TimeContinuum\ElapsedPeriod::asPeriod()`
- `Innmind\TimeContinuum\Period\Value::seconds()`

### Changed

- `Innmind\TimeContinuum\Format` is now a `final class`
- Interfaces in the `Innmind\TimeContinuum\Clock` namespace are now `final class`es
- Classes in the `Innmind\TimeContinuum\Clock` namespace have been moved to `Innmind\TimeContinuum\PointInTime`
- `Innmind\TimeContinuum\Period` is now a `final class`
- `Innmind\TimeContinuum\ElapsedPeriod` is now a `final class`
- `Innmind\TimeContinuum\Earth\Period` has been renamed to `Innmind\TimeContinuum\Period\Value`
- `Innmind\TimeContinuum\PointInTime` is now a `final class`
- Classes in the `Fixtures\Innmind\TimeContinuum\Earth` namespace have been moved to `Fixtures\Innmind\TimeContinuum`
- `Innmind\TimeContinuum\Earth\Clock` as been renamed `Innmind\TimeContinuum\Clock\Live`
- `Innmind\TimeContinuum\Earth\FrozenClock` as been renamed `Innmind\TimeContinuum\Clock\Frozen`
- `Innmind\TimeContinuum\Logger\Clock` as been renamed `Innmind\TimeContinuum\Clock\Logger`
- Classes in the `Innmind\TimeContinuum\Earth\Move` namespace have been moved to `Innmind\TimeContinuum\Move`
- `Innmind\TimeContinuum\Timezone` is now a `final class`
- `Innmind\TimeContinuum\Clock` is now a `final class`
- `Innmind\TimeContinuum\Timezone` has been renamed `Innmind\TimeContinuum\Offset`
- `Innmind\TimeContinuum\PointInTime::changeTimezone()` has been renamed `Innmind\TimeContinuum\PointInTime::changeOffset()`
- `Innmind\TimeContinuum\PointInTime::timezone()` has been renamed `Innmind\TimeContinuum\PointInTime::offset()`
- `Innmind\TimeContinuum\PointInTime\Day::toInt()` has been renamed `Innmind\TimeContinuum\PointInTime\Day::ofMonth()`
- `Innmind\TimeContinuum\ElapsedPeriod::of()` is now an `internal` method
- `Innmind\TimeContinuum\Clock::at()` now requires a `Format`
- `Innmind\TimeContinuum\PointInTime::toString()` now contains the microseconds

### Removed

- Support for `innmind/immutable` `4`
- Classes in the `Innmind\TimeContinuum\Earth\Format` namespaces are now named constructors of `Innmind\TimeContinuum\Format`
- Classes in the `Innmind\TimeContinuum\Earth\Clock` namespace
- Classes in the `Innmind\TimeContinuum\Earth\Period` namespace
- `Innmind\TimeContinuum\Earth\ElapsedPeriod`
- `Innmind\TimeContinuum\Earth\PointInTime\PointInTime`
- `Innmind\TimeContinuum\Earth\PointInTime\Now`
- `Innmind\TimeContinuum\Earth\PointInTime\HighResolution`
- Earth timezones
- `Innmind\TimeContinuum\Timezone::daylightSavingTimeApplied()`
- `Innmind\TimeContinuum\Exception`
- `Innmind\TimeContinuum\PointInTime\Month::toInt()`
- `Innmind\TimeContinuum\PointInTime\Month::toString()`
- `Innmind\TimeContinuum\PointInTime\Day::weekNumber()`
- `Innmind\TimeContinuum\PointInTime\Day::toString()`
- `Innmind\TimeContinuum\PointInTime\Hour::toString()`
- `Innmind\TimeContinuum\PointInTime\Microsecond::toString()`
- `Innmind\TimeContinuum\PointInTime\Millisecond::toString()`
- `Innmind\TimeContinuum\PointInTime\Minute::toString()`
- `Innmind\TimeContinuum\PointInTime\Second::toString()`
- `Innmind\TimeContinuum\PointInTime\Year::toString()`
- `Innmind\TimeContinuum\ElapsedPeriod::maybe()`
- `Innmind\TimeContinuum\ElapsedPeriod::ofPeriod()`
- `Innmind\TimeContinuum\PointInTime::milliseconds()`
- `Innmind\TimeContinuum\Offset::of()`
- `Innmind\TimeContinuum\ElapsedPeriod::milliseconds()`
- `Innmind\TimeContinuum\Period\Value::second`
- `Innmind\TimeContinuum\Period\Value::milliseconds()`

## 3.4.1 - 2023-09-17

### Fixed
Expand Down
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# This command is intended to be run on your computer
serve-doc:
docker run --rm -it -p 8000:8000 -v ${PWD}:/docs squidfunk/mkdocs-material

build-doc:
docker run --rm -it -v ${PWD}:/docs squidfunk/mkdocs-material build
Loading

0 comments on commit 279a66d

Please sign in to comment.