Skip to content

Commit

Permalink
Requires PHP 7.3+
Browse files Browse the repository at this point in the history
  • Loading branch information
olvlvl committed Jun 23, 2022
1 parent c645e01 commit 68a6bd5
Show file tree
Hide file tree
Showing 16 changed files with 359 additions and 772 deletions.
5 changes: 4 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
.github
.gitattributes export-ignore
.github export-ignore
.gitignore export-ignore
docker-compose.yml export-ignore
Dockerfile export-ignore
Makefile export-ignore
phpunit.xml.dist export-ignore
phpunit.xml export-ignore
tests/ export-ignore
9 changes: 4 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ on:
jobs:
phpunit:
name: phpunit
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
strategy:
matrix:
php-version:
- "5.6"
- "7.0"
- "7.4"
- "7.3"
- "8.1"
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -40,7 +39,7 @@ jobs:
run: make test-coveralls

- name: Upload code coverage
if: ${{ matrix.php-version == '5.6' }}
if: ${{ matrix.php-version == '7.3' }}
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.phpunit.result.cache
build
composer.lock
vendor
23 changes: 23 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Migration

## v1.x to v2.x

### New Requirements

Requires PHP 7.3+

### New features

None

### Backward Incompatible Changes

None

### Deprecated Features

None

### Other Changes

None
18 changes: 10 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ PHPUNIT = vendor/bin/phpunit
vendor:
@composer install

# testing

.PHONY: test-dependencies
test-dependencies: vendor

Expand All @@ -18,19 +20,19 @@ test: test-dependencies
.PHONY: test-coverage
test-coverage: test-dependencies
@mkdir -p build/coverage
@$(PHPUNIT) --coverage-html build/coverage
@XDEBUG_MODE=coverage $(PHPUNIT) --coverage-html build/coverage

.PHONY: test-coveralls
test-coveralls: test-dependencies
@mkdir -p build/logs
@$(PHPUNIT) --coverage-clover build/logs/clover.xml
@XDEBUG_MODE=coverage $(PHPUNIT) --coverage-clover build/logs/clover.xml

.PHONY: test-container-56
test-container-56:
@docker-compose run --rm app56 sh
.PHONY: test-container-73
test-container-73:
@docker-compose run --rm app73 sh
@docker-compose down

.PHONY: test-container-74
test-container-74:
@docker-compose run --rm app74 sh
.PHONY: test-container-81
test-container-81:
@docker-compose run --rm app81 sh
@docker-compose down
45 changes: 9 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ year, quarter and more has been made especially easy. Also, all instances can be



#### Installation

```bash
composer require icanboogie/datetime
```



### Usage
Expand Down Expand Up @@ -343,36 +349,6 @@ echo $date->localize('fr')->as_medium; // 5 mai 2015 23:13:05



## Installation

The recommended way to install this package is through [Composer](https://getcomposer.org/):

```
$ composer require icanboogie/datetime
```

The package [icanboogie/common](https://github.com/ICanBoogie/Common) is suggested to
provide finer exceptions, such as [PropertyNotDefined][] and [PropertyNotWritable][].
If the package is not included, `RunTimeException` instances are thrown instead.



## Documentation

The package is documented as part of the [ICanBoogie](http://icanboogie.org/) framework
[documentation][]. The documentation for the package and its
dependencies can be generated with the `make doc` command. The documentation is generated in
the `build/docs` directory using [ApiGen](http://apigen.org/). The package directory can later by
cleaned with the `make clean` command.

The following classes are documented:

- [DateTime][]
- [TimeZone][]
- [TimeZoneLocation][]



## Continuous Integration

The project is continuously tested by [GitHub actions](https://github.com/ICanBoogie/DateTime/actions).
Expand All @@ -395,9 +371,6 @@ Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

[ICanBoogie/CLDR]: https://github.com/ICanBoogie/CLDR
[JsonSerializable interface]: http://php.net/manual/en/class.jsonserializable.php
[documentation]: http://api.icanboogie.org/datetime/latest/
[DateTime]: http://api.icanboogie.org/datetime/latest/class-ICanBoogie.DateTime.html
[TimeZone]: http://api.icanboogie.org/datetime/latest/class-ICanBoogie.TimeZone.html
[TimeZoneLocation]: http://api.icanboogie.org/datetime/latest/class-ICanBoogie.TimeZoneLocation.html
[PropertyNotDefined]: http://api.icanboogie.org/common/1.2/class-ICanBoogie.PropertyNotDefined.html
[PropertyNotWritable]: http://api.icanboogie.org/common/1.2/class-ICanBoogie.PropertyNotWritable.html
[DateTime]: lib/DateTime.php
[TimeZone]: lib/TimeZone.php
[TimeZoneLocation]: lib/TimeZoneLocation.php
18 changes: 13 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,35 @@
{
"name": "Olivier Laviale",
"email": "[email protected]",
"homepage": "https://olvlvl.com",
"homepage": "https://olvlvl.com/",
"role" : "Developer"
}
],
"support": {
"issues": "https://github.com/ICanBoogie/DateTime/issues",
"source": "https://github.com/ICanBoogie/DateTime"
},
"config": {
"sort-packages": true
},
"require": {
"php": ">=5.6.0"
"php": ">=7.3"
},
"require-dev": {
"icanboogie/common": "^1.2",
"phpunit/phpunit": "^5.6"
"icanboogie/common": "^2.0",
"phpunit/phpunit": "^9.5"
},
"suggest": {
"icanboogie/common": "Allows finer exceptions to be thrown"
},
"autoload": {
"psr-4": {
"ICanBoogie\\": "lib/"
"ICanBoogie\\": "lib"
}
},
"autoload-dev": {
"psr-4": {
"Test\\ICanBoogie\\": "tests"
}
}
}
8 changes: 4 additions & 4 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
---
version: "3.0"
services:
app56:
app73:
build:
context: .
args:
PHP_VERSION: 5.6
PHP_VERSION: 7.3
environment:
PHP_IDE_CONFIG: "serverName=icanboogie-datetime"
volumes:
- .:/app:delegated
- ~/.composer:/root/.composer:delegated
working_dir: /app
app74:
app81:
build:
context: .
args:
PHP_VERSION: 7.4
PHP_VERSION: 8.1
environment:
PHP_IDE_CONFIG: "serverName=icanboogie-datetime"
volumes:
Expand Down
Loading

0 comments on commit 68a6bd5

Please sign in to comment.