diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..cdd7de1 --- /dev/null +++ b/.github/dependabot.yml @@ -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 + diff --git a/.github/workflows/code-styles.yml b/.github/workflows/styles.yml similarity index 91% rename from .github/workflows/code-styles.yml rename to .github/workflows/styles.yml index ccaf7f3..e01f345 100644 --- a/.github/workflows/code-styles.yml +++ b/.github/workflows/styles.yml @@ -1,5 +1,8 @@ -name: code-styles -on: [pull_request] +name: Code styles +on: + push: + schedule: + - cron: '0 0 * * THU' jobs: php-cs-fixer: @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2031e42..ee66064 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -2,7 +2,7 @@ name: Tests on: push: schedule: - - cron: "0 0 * * THU" + - cron: '0 0 * * THU' jobs: tests: @@ -10,14 +10,14 @@ jobs: 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 }} diff --git a/CHANGELOG.md b/CHANGELOG.md index a6dfaa9..ac9038a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 @@ -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 diff --git a/LICENSE b/LICENSE index c81dca7..cf5a268 100644 --- a/LICENSE +++ b/LICENSE @@ -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 diff --git a/VERSION b/VERSION index 8acdd82..3eefcb9 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.0.1 +1.0.0 diff --git a/composer.json b/composer.json index 70b6ca9..e2b3578 100644 --- a/composer.json +++ b/composer.json @@ -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", diff --git a/src/SwisstopoConverter.php b/src/SwisstopoConverter.php index 9c97d28..1952ef5 100644 --- a/src/SwisstopoConverter.php +++ b/src/SwisstopoConverter.php @@ -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), ]; } @@ -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), ]; } @@ -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), ]; } @@ -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), ]; } diff --git a/tests/Traits/InvokeMethodTrait.php b/tests/Traits/InvokeMethodTrait.php index 1fe05cc..4661e87 100644 --- a/tests/Traits/InvokeMethodTrait.php +++ b/tests/Traits/InvokeMethodTrait.php @@ -2,8 +2,6 @@ namespace Antistatique\Swisstopo\Tests\Traits; -use ReflectionClass; - /** * Provides a function to invoke protected/private methods of a class. */ @@ -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);