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

Toward 3.0 #81

Open
wants to merge 32 commits into
base: 3.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
30227b1
ci: remove travis file
lyrixx Feb 29, 2024
33883c9
composer: remove branch alias
lyrixx Feb 29, 2024
6940144
composer: re-organise it a bit
lyrixx Feb 29, 2024
7276758
composer: simplify autoloader
lyrixx Feb 29, 2024
ba19a51
composer: move tests to it's own folder
lyrixx Feb 29, 2024
733f06e
phpunit: use symfony/phpunit-bridge
lyrixx Feb 29, 2024
4d33fa1
zabbix: Remove collector
lyrixx Feb 29, 2024
1cdf63d
composer: bump requirements to PHP 8.1+
lyrixx Feb 29, 2024
5457cf6
composer: drop support for Symfony < 5.4
lyrixx Feb 29, 2024
b5ac1c9
composer: switch to symfony http-client instead of buzz
lyrixx Feb 29, 2024
11f8e4a
chore: modernise PHP code
lyrixx Feb 29, 2024
871a1fa
chore: add php-cs-fixer
lyrixx Feb 29, 2024
ef3c16c
chore: add phpstan
lyrixx Feb 29, 2024
dcd89cf
chore: fixed test
lyrixx Feb 29, 2024
b0d856d
composer: fix some constraints
lyrixx Feb 29, 2024
1ed9ab7
ci: add GHA
lyrixx Feb 29, 2024
d59d77b
chore: ensure Collector cannot raise error or exception
lyrixx Feb 29, 2024
cc5cc9a
example: init blank symfony application
lyrixx Feb 29, 2024
da7f179
bundle: enhance the configuration parsing + add AliasForArgument
lyrixx Feb 29, 2024
2163463
collector: drop librato integration
lyrixx Feb 29, 2024
c4b8b61
chore: fixed license
lyrixx Feb 29, 2024
92ce236
collector: fix doctrine dbal deprecations
lyrixx Mar 1, 2024
9b2b101
collector: change inner dependency of InfluxDB
lyrixx Mar 1, 2024
ceae017
collector: rename InfluxDB to InfluxDbV1
lyrixx Mar 1, 2024
a6bf9ab
bundle: enhance configuration + add kernel.reset tag
lyrixx Mar 1, 2024
e0c3d02
collector: change inner dependency of Prometheus
lyrixx Mar 1, 2024
8679461
composer: cleaning
lyrixx Mar 1, 2024
669d5a3
doc: reword the readme
lyrixx Mar 1, 2024
bfab645
chore: remove the TaggableCollectorInterface
lyrixx Mar 1, 2024
4d8365b
example: add very basic integration
lyrixx Feb 29, 2024
e533b98
doc: create CHANGELOG.md
lyrixx Feb 29, 2024
4689791
--
lyrixx Mar 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
66 changes: 66 additions & 0 deletions .github/workflows/ci.yaml
@@ -0,0 +1,66 @@
name: CI

on:
push:
# FIXME: Change the branch name to your main branch
branches: [main]
pull_request: ~

jobs:
cs:
name: PHP-CS-Fixer
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: PHP-CS-Fixer
uses: docker://oskarstark/php-cs-fixer-ga
with:
args: --diff --dry-run

phpstan:
name: PHPStan
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Composer dependencies
run: composer update --prefer-dist --no-interaction

- name: PHPStan
env:
CHECK_PLATFORM_REQUIREMENTS: false
REQUIRE_DEV: true
uses: docker://oskarstark/phpstan-ga

phpunit:
name: PHPUnit on PHP ${{ matrix.php-version }} ${{ matrix.name }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-version: ["8.2", "8.3"]
composer-flags: [""]
name: [""]
include:
- php-version: 8.1
composer-flags: "--prefer-lowest"
name: "(prefer lowest dependencies)"
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, xml
ini-values: phar.readonly="Off"

- name: Install Composer dependencies
run: composer update --prefer-dist --no-interaction ${{ matrix.composer-flags }}

- name: Run Tests
run: vendor/bin/simple-phpunit
1 change: 1 addition & 0 deletions .gitignore
@@ -1,2 +1,3 @@
/composer.lock
/vendor/
/.phpunit.cache/
45 changes: 45 additions & 0 deletions .php-cs-fixer.php
@@ -0,0 +1,45 @@
<?php

/*
* This file is part of the beberlei/metrics project.
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/

$fileHeaderComment = <<<'LICENSE'
This file is part of the beberlei/metrics project.

For the full copyright and license information, please view the LICENSE.md
file that was distributed with this source code.
LICENSE;

$finder = PhpCsFixer\Finder::create()
->ignoreVCSIgnored(true)
->in(__DIR__)
->append([
__FILE__,
])
;

return (new PhpCsFixer\Config())
->setRiskyAllowed(true)
->setRules([
'@PHP81Migration' => true,
'@PhpCsFixer' => true,
'@Symfony' => true,
'@Symfony:risky' => true,
'heredoc_indentation' => false,
'header_comment' => ['header' => $fileHeaderComment],
'single_line_empty_body' => false,
'ordered_types' => false, // From @PhpCsFixer but we don't want it
'php_unit_internal_class' => false, // From @PhpCsFixer but we don't want it
'php_unit_test_class_requires_covers' => false, // From @PhpCsFixer but we don't want it
'phpdoc_add_missing_param_annotation' => false, // From @PhpCsFixer but we don't want it
'concat_space' => ['spacing' => 'one'],
'ordered_class_elements' => true, // Symfony(PSR12) override the default value, but we don't want
'blank_line_before_statement' => true, // Symfony(PSR12) override the default value, but we don't want
'method_chaining_indentation' => false, // Do not work well with Tree builder
])
->setFinder($finder)
;
13 changes: 0 additions & 13 deletions .travis.yml

This file was deleted.

43 changes: 43 additions & 0 deletions CHANGELOG.md
@@ -0,0 +1,43 @@
# CHANGELOG

## v3.0.0 (unreleased)

### Breaking changes

* Drop support for PHP < 8.1
* Drop support for Symfony < 5.4
* Drop support for zabbix collector
* Drop support for librato collector
* Rename InfluxDB collector to InfluxDbV1
* Change inner dependency of InfluxDbV1
* Change inner dependency of Prometheus
* Remove the TaggableCollectorInterface. Tags can be injected in the constructor
instead

### New features

* collector:
* Ensure all collectors cannot raise error or exception
* bundle:
* All collectors has alias for autowiring. Use
`#[Target('name-of-the-collector')]` to inject a collector
* All collectors are tagged with `kernel.reset` to reset their state
* All collectors are tagged with
`Beberlei\Metrics\Collector\CollectorInterface`
* add a symfony application in the `examples` folder will all collectors enabled
and visualisation with Grafana

### Minor changes

* collector:
* Fix doctrine dbal deprecations
* chore:
* modernise PHP code, use PHP 8.1 features
* add license file, and link it in each PHP files
* ci:
* use symfony/phpunit-bridge instead of phpunit
* add php-cs-fixer
* add phpstan
* replace Travis by GitHub Actions
* composer:
* move tests to it's own folder, and it's own autoloader
19 changes: 19 additions & 0 deletions LICENSE.md
@@ -0,0 +1,19 @@
Copyright (c) 2004-preset Benjamin Eberlei

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.