Skip to content

Commit

Permalink
Merge branch 'release/1.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
WengerK committed Jun 24, 2024
2 parents 7733d8c + d40feb1 commit 8706bd4
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 28 deletions.
21 changes: 21 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: composer
directory: "/"
versioning-strategy: lockfile-only
allow:
- dependency-type: production
registries:
- composer
schedule:
interval: weekly
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: weekly

17 changes: 10 additions & 7 deletions .github/workflows/code-styles.yml → .github/workflows/styles.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: code-styles
on: [pull_request]
name: Code styles
on:
push:
schedule:
- cron: '0 0 * * THU'

jobs:
php-cs-fixer:
Expand All @@ -9,7 +12,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
php-version: '8.2'
extensions: mbstring, intl, gd, xml, dom, json, fileinfo, curl, zip, iconv
tools: php-cs-fixer, cs2pr
- uses: actions/checkout@v2
Expand All @@ -23,7 +26,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
extensions: mbstring, intl, gd, xml, dom, json, fileinfo, curl, zip, iconv
- uses: actions/checkout@v2
- run: composer install --prefer-dist
Expand All @@ -36,7 +39,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
extensions: mbstring, intl, gd, xml, dom, json, fileinfo, curl, zip, iconv
- uses: actions/checkout@v2
- run: composer install --prefer-dist
Expand All @@ -49,7 +52,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
extensions: mbstring, intl, gd, xml, dom, json, fileinfo, curl, zip, iconv
tools: phpstan, cs2pr
- uses: actions/checkout@v2
Expand All @@ -63,7 +66,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
extensions: mbstring, intl, gd, xml, dom, json, fileinfo, curl, zip, iconv
- uses: actions/checkout@v2
- run: composer install --prefer-dist
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@ name: Tests
on:
push:
schedule:
- cron: "0 0 * * THU"
- cron: '0 0 * * THU'

jobs:
tests:
runs-on: ubuntu-latest

strategy:
matrix:
php-versions: ['8.0', '8.1']
php-versions: ['8.0', '8.1', '8.2', '8.3']
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
tools: composer:v2
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: php-actions/composer@v6
with:
php_version: ${{ matrix.php-versions }}
Expand Down
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.0.0] - 2024-06-24
### Added
- add dependabot
- add tests on PHP 8.3

### Removed
- remove sensiolabs/security-checker from direct dependency

### Security
- update friendsofphp/php-cs-fixer (v3.4.0 => v3.21.1)

## [0.0.1] - 2023-07-12
### Fixed
- fixed deprecations for development
Expand All @@ -31,6 +42,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- allow conversion of GPS (WGS84) coordinates from/to CH1903/LV03 (MN03)
- allow conversion of GPS (WGS84) coordinates from/to CH1995/LV95 (MN95)

[Unreleased]: https://github.com/antistatique/swisstopo/compare/0.0.1...HEAD
[Unreleased]: https://github.com/antistatique/swisstopo/compare/1.0.0...HEAD
[1.0.0]: https://github.com/antistatique/swisstopo/compare/0.0.1...1.0.0
[0.0.1]: https://github.com/antistatique/swisstopo/compare/0.0.1-alpha...v0.0.1
[0.0.1-alpha]: https://github.com/antistatique/swisstopo/releases/tag/0.0.1-alpha
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020–2022 Antistatique
Copyright (c) 2020–2023 Antistatique

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.1
1.0.0
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
"require-dev": {
"phpunit/phpunit": "^9.0.0",
"phpunit/php-code-coverage": "^9.2.0",
"friendsofphp/php-cs-fixer": "^3.0",
"friendsofphp/php-cs-fixer": "^3.21",
"phpmd/phpmd": "^2.8",
"sebastian/phpcpd": "^6.0",
"sensiolabs/security-checker": "^5.0",
"php-coveralls/php-coveralls": "^2.1",
"php-mock/php-mock-phpunit": "^2.4",
"vimeo/psalm": "^4.29",
Expand Down
16 changes: 8 additions & 8 deletions src/SwisstopoConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class SwisstopoConverter
public static function fromMN95ToWGS(float|int $east, float|int $north): array
{
return [
'lat' => self::fromMN95ToWGSLatitude($east, $north),
'long' => self::fromMN95ToWGSLongitude($east, $north),
'lat' => self::fromMN95ToWGSLatitude($east, $north),
'long' => self::fromMN95ToWGSLongitude($east, $north),
];
}

Expand All @@ -40,8 +40,8 @@ public static function fromMN95ToWGS(float|int $east, float|int $north): array
public static function fromWGSToMN95(float $lat, float $long): array
{
return [
'east' => self::fromWGSToMN95East($lat, $long),
'north' => self::fromWGSToMN95North($lat, $long),
'east' => self::fromWGSToMN95East($lat, $long),
'north' => self::fromWGSToMN95North($lat, $long),
];
}

Expand All @@ -59,8 +59,8 @@ public static function fromWGSToMN95(float $lat, float $long): array
public static function fromMN03ToWGS(int $y, int $x): array
{
return [
'lat' => self::fromMN03ToWGSLatitude($y, $x),
'long' => self::fromMN03ToWGSLongitude($y, $x),
'lat' => self::fromMN03ToWGSLatitude($y, $x),
'long' => self::fromMN03ToWGSLongitude($y, $x),
];
}

Expand All @@ -78,8 +78,8 @@ public static function fromMN03ToWGS(int $y, int $x): array
public static function fromWGSToMN03(float $lat, float $long): array
{
return [
'x' => self::fromWGSToMN03x($lat, $long),
'y' => self::fromWGSToMN03y($lat, $long),
'x' => self::fromWGSToMN03x($lat, $long),
'y' => self::fromWGSToMN03y($lat, $long),
];
}

Expand Down
8 changes: 3 additions & 5 deletions tests/Traits/InvokeMethodTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace Antistatique\Swisstopo\Tests\Traits;

use ReflectionClass;

/**
* Provides a function to invoke protected/private methods of a class.
*/
Expand All @@ -21,14 +19,14 @@ trait InvokeMethodTrait
* @param array $protected_properties
* Array of values that should be set on protected properties
*
* @throws \ReflectionException
*
* @return mixed
* Method return
*
* @throws \ReflectionException
*/
protected function invokeMethod(&$object, $method_name, array $parameters = [], array $protected_properties = [])
{
$reflection = new ReflectionClass(\get_class($object));
$reflection = new \ReflectionClass(\get_class($object));

foreach ($protected_properties as $property => $value) {
$property = $reflection->getProperty($property);
Expand Down

0 comments on commit 8706bd4

Please sign in to comment.