Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deprecation (implicit conversion) for PHP 8.1 #11

Closed
wants to merge 13 commits into from
Closed
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ composer.lock
# PHPCS cache files
.php_cs.cache
.phpcs-cache
composer.lock
WengerK marked this conversation as resolved.
Show resolved Hide resolved
.php-cs-fixer.cache
13 changes: 6 additions & 7 deletions .php_cs.dist → .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
<?php

$finder = PhpCsFixer\Finder::create()
$finder = \PhpCsFixer\Finder::create()
->exclude('vendor')
->exclude('.sonarlint')
->in(__DIR__)
;
->in(__DIR__);

return PhpCsFixer\Config::create()
->setRules([
$config = new \PhpCsFixer\Config();

return $config->setRules([
'@Symfony' => true,
'array_syntax' => ['syntax' => 'short'],
'phpdoc_align' => ['align' => 'vertical', 'tags' => ['type', 'var']],
])
->setFinder($finder)
;
->setFinder($finder);
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ 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).

## [Unreleased]
### Fixed
- fixed deprecations for development
- fixed deprecations for PHP 8.1

### Changed
- update changelog following 'keep a changelog' format
- run code-styles Github Actions on PHP 8.1
Expand Down
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 Antistatique
Copyright (c) 2020–2022 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-alpha
0.0.2-alpha
WengerK marked this conversation as resolved.
Show resolved Hide resolved
WengerK marked this conversation as resolved.
Show resolved Hide resolved
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
"description": "Convert GPS (WGS84) to Swiss (LV03 and LV95) coordinates (and vice versa)",
"license": "MIT",
"require": {
"php": ">=7.4"
"php": ">=7.4 || >=8.1"
WengerK marked this conversation as resolved.
Show resolved Hide resolved
},
"require-dev": {
"phpunit/phpunit": "^9.0.0",
"phpunit/php-code-coverage": "^9.2.0",
"friendsofphp/php-cs-fixer": "^2.16",
"friendsofphp/php-cs-fixer": "^3.0",
"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": "^3.11",
"vimeo/psalm": "^4.29",
"phpstan/phpstan-deprecation-rules": "^0.12.2"
},
"autoload": {
Expand Down
30 changes: 13 additions & 17 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
colors="true"
failOnRisky="true"
failOnWarning="true"
stopOnFailure="false">
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" backupStaticAttributes="false" colors="true" failOnRisky="true" failOnWarning="true" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">src</directory>
</include>
<report>
<clover outputFile="./build/logs/clover.xml"/>
<html outputDirectory="./build/logs/coverage-html"/>
</report>
</coverage>
<testsuites>
<testsuite name="Swisstopo Test Suite">
<directory suffix=".php">./tests/</directory>
</testsuite>
</testsuites>
<logging>
<log type="coverage-clover" target="./build/logs/clover.xml"/>
<log type="coverage-html" target="./build/logs/coverage-html"/>
</logging>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src</directory>
</whitelist>
</filter>
<logging/>
<php>
<!-- Temporarily preventing https://github.com/xdebug/xdebug/pull/699 -->
<const name="XDEBUG_CC_UNUSED" value=""/>
<const name="XDEBUG_CC_DEAD_CODE" value="-1"/>
<const name="XDEBUG_CC_UNUSED" value=""/>
<const name="XDEBUG_CC_DEAD_CODE" value="-1"/>
</php>
</phpunit>
2 changes: 1 addition & 1 deletion psalm.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<psalm
errorLevel="1"
autoloader="vendor/autoload.php"
totallyTyped="false"
requireVoidReturnType="false"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
Expand Down
Loading