Skip to content

Commit cb50792

Browse files
committed
Maintenance
- Update dependencies - Update .php-cs-fixer.dist.php - Refactor scripts in package.json to streamline phpcs and rector commands - Refactor documentation and improve code consistency Update PHPUnit bootstrap path and remove obsolete bootstrap file
1 parent b56ff95 commit cb50792

18 files changed

Lines changed: 333 additions & 234 deletions

.php-cs-fixer.dist.php

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,32 @@
11
<?php
22
$header = <<<EOF
3-
tomkyle/matomo-api-client (https://github.com/tomkyle/matomo-api-client)
3+
This file is part of {{name}}
4+
5+
{{description}}
46
57
For the full copyright and license information, please view the LICENSE
68
file that was distributed with this source code.
79
EOF;
810

11+
$info = json_decode(file_get_contents(__DIR__ . '/composer.json'), true);
12+
13+
$header = trim(str_replace(
14+
['{{name}}', '{{description}}' ],
15+
[$info['name'], $info['description'] ?? null],
16+
$header
17+
));
18+
19+
920
$finder = PhpCsFixer\Finder::create()
1021
->in([
1122
__DIR__ . '/src',
1223
__DIR__ . '/tests'
1324
]);
1425

15-
return (new PhpCsFixer\Config())->setRules([
26+
return (new PhpCsFixer\Config())
27+
->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect())
28+
->setFinder($finder)
29+
->setRules([
1630
'@PER-CS' => true,
1731

1832
'header_comment' => [
@@ -21,4 +35,4 @@
2135
'location' => 'after_open',
2236
'separate' => 'both',
2337
]
24-
])->setFinder($finder);
38+
]);

composer.lock

Lines changed: 41 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212

1313
"phpstan": "./vendor/bin/phpstan --no-progress analyse",
1414

15-
"phpcs" : "./vendor/bin/php-cs-fixer fix --verbose --diff --dry-run",
15+
"phpcs": "npm run phpcs:apply -- --dry-run",
1616
"phpcs:apply" : "./vendor/bin/php-cs-fixer fix --verbose --diff",
1717

18-
"rector": "./vendor/bin/rector process --dry-run",
18+
"rector": "npm run rector:apply -- --dry-run",
1919
"rector:apply": "./vendor/bin/rector process",
2020

2121
"phpunit": "./vendor/bin/phpunit",

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" colors="true" stopOnFailure="true" bootstrap="tests/bootstrap.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.3/phpunit.xsd" cacheDirectory=".phpunit.cache" beStrictAboutCoverageMetadata="true">
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" colors="true" stopOnFailure="true" bootstrap="vendor/autoload.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.3/phpunit.xsd" cacheDirectory=".phpunit.cache" beStrictAboutCoverageMetadata="true">
33
<coverage>
44
<report>
55
<clover outputFile="tests/build/clover.xml"/>

src/DefaultsAwareInterface.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
<?php
22

33
/**
4-
* tomkyle/matomo-api-client (https://github.com/tomkyle/matomo-api-client)
4+
* This file is part of tomkyle/matomo-api-client
5+
*
6+
* Client library for interacting with the Matomo API. Supports retry logic and PSR-6 caches.
57
*
68
* For the full copyright and license information, please view the LICENSE
79
* file that was distributed with this source code.
@@ -13,25 +15,24 @@
1315

1416
interface DefaultsAwareInterface extends Log\LoggerAwareInterface
1517
{
16-
1718
/**
1819
* Gets default API parameters.
1920
*
20-
* @return array<string,string>
21+
* @return array<string,mixed>
2122
*/
2223
public function getDefaults(): array;
2324

2425
/**
2526
* Sets default API parameters.
2627
*
27-
* @param array<string,string> $defaults
28+
* @param array<string,mixed> $defaults
2829
*/
2930
public function setDefaults(array $defaults): self;
3031

3132
/**
3233
* Merges new API parameters into the existing defaults.
3334
*
34-
* @param array<string,string> $defaults
35+
* @param array<string,mixed> $defaults
3536
*/
3637
public function mergeDefaults(array $defaults): self;
3738
}

0 commit comments

Comments
 (0)