Skip to content

Commit

Permalink
Merge pull request #16 from stevegrunwell/release/v1.2.0
Browse files Browse the repository at this point in the history
Version 1.2.0
  • Loading branch information
stevegrunwell authored Dec 18, 2023
2 parents a83fbc4 + 78f9de0 commit acf6ad0
Show file tree
Hide file tree
Showing 10 changed files with 162 additions and 4,148 deletions.
66 changes: 0 additions & 66 deletions .github/workflows/ci-cd.yml

This file was deleted.

23 changes: 23 additions & 0 deletions .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Coding Standards

on: [pull_request]

jobs:
phpcs:
name: PHP Coding Standards Fixer
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
coverage: none

- name: Install Composer dependencies
uses: ramsey/composer-install@v2

- name: Check coding standards
run: vendor/bin/php-cs-fixer fix --dry-run --verbose
29 changes: 29 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Unit Tests

on: [pull_request]

jobs:
phpunit:
name: PHP ${{ matrix.php-version }}
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: none

- name: Remove PHP-CS-Fixer as a dev dependency
run: composer remove --dev --no-install friendsofphp/php-cs-fixer

- name: Install Composer dependencies
uses: ramsey/composer-install@v2

- name: Run test suite
run: vendor/bin/phpunit --testdox
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/vendor/
.php-cs-fixer.cache
.phpunit.result.cache
.vscode
composer.lock
vendor
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Version 1.2.0] — 2023-12-18

* Add the following multipliers to help with sub-second timings ([#13]):
- `MILLISECONDS_PER_SECOND` (1,000ms/s)
- `MICROSECONDS_PER_SECOND` (1,000,000µs/s)
- `NANOSECONDS_PER_SECOND` (1,000,000,000ns/s)
- `PICOSECONDS_PER_SECOND` (1,000,000,000,000ps/s)
* Remove the composer.lock file, overhaul CI pipeline so tests can be run across all supported versions of PHP ([#14], props @peter279k).
* Define an `archive.exclude` section in `composer.json` ([#15]).

## [Version 1.1.2] – 2022-01-18

* Add PHP 8 support in `composer.json` ([#9])
Expand Down Expand Up @@ -41,6 +51,7 @@ Initial public release of the library, with the following constants:


[Unreleased]: https://github.com/stevegrunwell/time-constants/compare/main...develop
[Version 1.2.0]: https://github.com/stevegrunwell/time-constants/releases/tag/v1.2.0
[Version 1.1.2]: https://github.com/stevegrunwell/time-constants/releases/tag/v1.1.2
[Version 1.1.1]: https://github.com/stevegrunwell/time-constants/releases/tag/v1.1.1
[Version 1.1.0]: https://github.com/stevegrunwell/time-constants/releases/tag/v1.1.0
Expand All @@ -50,3 +61,6 @@ Initial public release of the library, with the following constants:
[#5]: https://github.com/stevegrunwell/time-constants/pull/5
[#9]: https://github.com/stevegrunwell/time-constants/pull/9
[#10]: https://github.com/stevegrunwell/time-constants/pull/10
[#13]: https://github.com/stevegrunwell/time-constants/pull/13
[#14]: https://github.com/stevegrunwell/time-constants/pull/14
[#15]: https://github.com/stevegrunwell/time-constants/pull/15
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Time Constants

[![Build Status](https://travis-ci.org/stevegrunwell/time-constants.svg?branch=develop)](https://travis-ci.org/stevegrunwell/time-constants)
[![CI Pipeline](https://github.com/stevegrunwell/time-constants/actions/workflows/ci-cd.yml/badge.svg?branch=develop)](https://github.com/stevegrunwell/time-constants/actions/workflows/ci-cd.yml)
[![Packagist](https://img.shields.io/packagist/v/stevegrunwell/time-constants.svg)](https://packagist.org/packages/stevegrunwell/time-constants)


Expand Down Expand Up @@ -66,3 +66,16 @@ This is a list of all constants defined by this package, along with their values
* `WEEK_IN_MINUTES` (10,080 minutes)
* `MONTH_IN_MINUTES` (43,200 minutes)
* `YEAR_IN_MINUTES` (525,600 minutes)

### Multipliers

These can be helpful when dealing with fractions of a second. For example, all of the following are equivalent:

```php
6000 === (6 * ONE_SECOND) * 1000 === 6 * MILLISECONDS_PER_SECOND
```

* `MILLISECONDS_PER_SECOND` (1,000ms/s)
* `MICROSECONDS_PER_SECOND` (1,000,000µs/s)
* `NANOSECONDS_PER_SECOND` (1,000,000,000ns/s)
* `PICOSECONDS_PER_SECOND` (1,000,000,000,000ps/s)
14 changes: 9 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.5",
"phpunit/phpunit": "^9.5"
"phpunit/phpunit": "^6.5 | ^8.5 | ^9.5 | ^10.0"
},
"autoload": {
"files": ["constants.php"]
Expand All @@ -32,9 +32,13 @@
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true,
"platform": {
"php": "8.1"
}
"optimize-autoloader": true
},
"archive": {
"exclude": [
".*",
"phpunit.xml.dist",
"tests"
]
}
}
Loading

0 comments on commit acf6ad0

Please sign in to comment.