Matthias Lantsch(1 year, 5 months ago)
php 8 version constraint
Browse Filesdiff --git a/e6ea4622eb92eee170bf7ca1291062ec99ed4945 b/4118ba2b65c73ac373073e122e9f533071ef6230
index e6ea462..4118ba2 100644
--- a/e6ea4622eb92eee170bf7ca1291062ec99ed4945
+++ b/4118ba2b65c73ac373073e122e9f533071ef6230
@@ -6,6 +6,7 @@ insert_final_newline = true
indent_style = tab
indent_size = 4
-[*.{html,xml}]
+[*.{html,xml,tpl.php,json}]
indent_size = 2
+indent_style = space
diff --git a/b0c63d594edc6cffa57e65712d2210879b9abaad b/fb87637f5789154a756e5bd96a9ed70053a0c14c
index b0c63d5..fb87637 100644
--- a/b0c63d594edc6cffa57e65712d2210879b9abaad
+++ b/fb87637f5789154a756e5bd96a9ed70053a0c14c
@@ -1,8 +1,9 @@
/vendor/
/phpdoc/
/.php_cs
-/.php_cs.cache
+/.php-cs-fixer.cache
/.phpunit.result.cache
+tests/coverage/*
/composer.lock
.idea/
<?php
$config = require 'vendor/holonet/hdev/.php-cs-fixer.dist.php';
$config->setFinder(PhpCsFixer\Finder::create()
->exclude('vendor')
->in(__DIR__)
);
return $config;
diff --git a/f7e27cabc00df27a2ba3303686605770165faadb b/64528e634c775546b2e06f44021dc0fe13d6847f
index f7e27ca..64528e6 100644
--- a/f7e27cabc00df27a2ba3303686605770165faadb
+++ b/64528e634c775546b2e06f44021dc0fe13d6847f
@@ -9,24 +9,23 @@
}
],
"require": {
- "php": ">=7.4",
+ "php": ">=8.1",
"monolog/monolog": "^2.0",
- "myclabs/php-enum": "^1.7",
"psr/container": "1.0.0"
},
+ "require-dev": {
+ "holonet/hdev": "~1.1.0@dev",
+ "phpunit/phpunit": "^9.5"
+ },
"provide": {
"psr/container-implementation": "1.0.0"
},
- "require-dev": {
- "holonet/hdev": "~1.0.0",
- "phpunit/phpunit": "^8.4.1"
- },
- "extra": {
- "branch-alias": {
- "dev-develop": "1.5.x-dev",
- "dev-master": "1.4.x-dev"
+ "repositories": [
+ {
+ "type": "composer",
+ "url": "https://holonet.easylabs.ch/hgit/composer/"
}
- },
+ ],
"autoload": {
"psr-4": {
"holonet\\common\\": "src/"
@@ -40,12 +39,17 @@
"holonet\\common\\tests\\": "tests/"
}
},
- "repositories": [
- {
- "type": "composer",
- "url": "https://holonet.easylabs.ch/hgit/composer/"
+ "config": {
+ "allow-plugins": {
+ "ergebnis/composer-normalize": true
}
- ],
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-develop": "1.5.x-dev",
+ "dev-master": "1.4.x-dev"
+ }
+ },
"scripts": {
"fix": [
"@composer normalize --diff",
diff --git a/2a5c2f795fccd3d9be03ff1f22bcdd6beaa1ca60 b/dcfabe5d30bfe0cff973c8208a48d78cfa85ae6f
index 2a5c2f7..dcfabe5 100644
--- a/2a5c2f795fccd3d9be03ff1f22bcdd6beaa1ca60
+++ b/dcfabe5d30bfe0cff973c8208a48d78cfa85ae6f
@@ -1,7 +1,16 @@
<phpunit
- forceCoversAnnotation="true"
- bootstrap="vendor/autoload.php">
- <testsuite name="tests">
- <directory>./tests</directory>
- </testsuite>
+ forceCoversAnnotation="true"
+ bootstrap="vendor/autoload.php"
+ colors="true">
+ <testsuite name="tests">
+ <directory>./tests</directory>
+ </testsuite>
+ <coverage processUncoveredFiles="true">
+ <include>
+ <directory suffix=".php">./src</directory>
+ </include>
+ <report>
+ <html outputDirectory="tests/coverage/html"/>
+ </report>
+ </coverage>
</phpunit>
diff --git a/96a56fc0abe00b3d6f4a3b22df8a1887922d76be b/ceda524845255f96824216ccf0e678a49e59f53d
index 96a56fc..ceda524 100644
--- a/96a56fc0abe00b3d6f4a3b22df8a1887922d76be
+++ b/ceda524845255f96824216ccf0e678a49e59f53d
@@ -49,7 +49,7 @@ class ChangeAwareCollection implements ArrayAccess, ComparableInterface, Countab
* @param mixed $entry Either the key or the value that changes
* @return mixed reference to the value or null if it doesn't exist
*/
- public function &change($entry) {
+ public function &change($entry): mixed {
$key = $this->findKeyForKeyOrEntry($entry);
if ($key !== null) {
$this->changed[] = $key;
@@ -139,7 +139,7 @@ class ChangeAwareCollection implements ArrayAccess, ComparableInterface, Countab
* @param string $key The key for the value
* @return mixed the value from the $this->all array or null if not found
*/
- public function get(string $key) {
+ public function get(string $key): mixed {
if (isset($this->all[$key]) && !in_array($key, $this->removed)) {
return $this->all[$key];
}
@@ -310,7 +310,7 @@ class ChangeAwareCollection implements ArrayAccess, ComparableInterface, Countab
* @param mixed $entry Either the key or the value
* @return mixed|null the key of the value/the key if it's a key
*/
- private function findKeyForKeyOrEntry($entry) {
+ private function findKeyForKeyOrEntry($entry): mixed {
//check if $entry is an array key (allow null, so no isset)
if ((is_string($entry) || is_int($entry)) && array_key_exists($entry, $this->all)) {
return $entry;
diff --git a/e105c818e448b3f863781c68aed42b1b4e6c7ff8 b/9510ed1c515965a33905858c2b9fd1d10b798794
index e105c81..9510ed1 100644
--- a/e105c818e448b3f863781c68aed42b1b4e6c7ff8
+++ b/9510ed1c515965a33905858c2b9fd1d10b798794
@@ -17,7 +17,7 @@ class ConfigRegistry extends Registry {
* Extend base placeholder logic to replace env variables in config values
* {@inheritDoc}
*/
- protected function replacePlaceholder($position) {
+ protected function replacePlaceholder($position): mixed {
if (is_string($position) && mb_strpos($position, '%') !== false) {
$matches = array();
preg_match_all('/%(?:env\(|)([^%]+?)(?:\)|)%/', $position, $matches, \PREG_SET_ORDER);
@@ -28,7 +28,7 @@ class ConfigRegistry extends Registry {
if (($envval = $_ENV[$placeholderPair[1]] ?? getenv($placeholderPair[1])) !== false) {
$position = str_replace($placeholderPair[0], $envval, $position);
} else {
- return;
+ return $position;
}
} else {
//if the placeholder is a value in the registry, replace it, otherwise leave it with the % signs
diff --git a/abc3883d5f4978a748bc727e2a5fad1208598d48 b/3223d2824f955c7f0f55f299df3268194795a363
index abc3883..3223d28 100644
--- a/abc3883d5f4978a748bc727e2a5fad1208598d48
+++ b/3223d2824f955c7f0f55f299df3268194795a363
@@ -153,7 +153,7 @@ class Registry implements ArrayAccess {
* @param mixed $position The value to be searched for placeholders
* @return mixed the updated value
*/
- protected function replacePlaceholder($position) {
+ protected function replacePlaceholder($position): mixed {
if (is_string($position) && mb_strpos($position, '%') !== false) {
$matches = array();
preg_match_all('/%([^%]+)%/', $position, $matches, \PREG_SET_ORDER);
diff --git a/c97b73b3d7a6e7a6db9de7aa0b23d8c78b933c7c b/93df6f43cc0249a01deaa5ae62ab94bee4ad2f72
index c97b73b..93df6f4 100644
--- a/c97b73b3d7a6e7a6db9de7aa0b23d8c78b933c7c
+++ b/93df6f43cc0249a01deaa5ae62ab94bee4ad2f72
@@ -45,8 +45,14 @@ class Error {
* @return string with a message describing this error
*/
public function __toString(): string {
- return sprintf('[%s] %s(%s): %s in the file %s on line %d',
- date('D M d H:i:s Y'), mb_strtoupper($this->errorlevel), $this->errorno, $this->errormsg, $this->errorfile, $this->errorline ?? ''
+ return sprintf(
+ '[%s] %s(%s): %s in the file %s on line %d',
+ date('D M d H:i:s Y'),
+ mb_strtoupper($this->errorlevel),
+ $this->errorno,
+ $this->errormsg,
+ $this->errorfile,
+ $this->errorline ?? ''
);
}
}