Skip to content

Commit 66ef654

Browse files
committed
chore(*): add documentation + fix phpstan
# Conflicts: # src/PhpinsightsFormatterServiceProvider.php
1 parent fa1abf5 commit 66ef654

23 files changed

+830
-185
lines changed

.php-cs-fixer.dist.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<?php declare(strict_types=1);
22

33
$finder = PhpCsFixer\Finder::create()->in([
4-
'config',
5-
'database',
64
'src',
75
'tests',
86
]);

README.md

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
# Provides formatters for Phpinsights
1+
![alt text](https://soyhuce.fr/wp-content/uploads/2020/06/logo-soyhuce-dark-1.png "Soyhuce")
2+
3+
# PhpInsights formatters
24

35
[![Latest Version on Packagist](https://img.shields.io/packagist/v/soyhuce/phpinsights-formatter.svg?style=flat-square)](https://packagist.org/packages/soyhuce/phpinsights-formatter)
46
[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/soyhuce/phpinsights-formatter/run-tests?label=tests)](https://github.com/soyhuce/phpinsights-formatter/actions?query=workflow%3Arun-tests+branch%3Amain)
57
[![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/soyhuce/phpinsights-formatter/Check%20&%20fix%20styling?label=code%20style)](https://github.com/soyhuce/phpinsights-formatter/actions?query=workflow%3A"Check+%26+fix+styling"+branch%3Amain)
68
[![GitHub PHPStan Action Status](https://img.shields.io/github/workflow/status/soyhuce/phpinsights-formatter/PHPStan?label=phpstan)](https://github.com/soyhuce/phpinsights-formatter/actions?query=workflow%3APHPStan+branch%3Amain)
79
[![Total Downloads](https://img.shields.io/packagist/dt/soyhuce/phpinsights-formatter.svg?style=flat-square)](https://packagist.org/packages/soyhuce/phpinsights-formatter)
810

9-
This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.
11+
Ce package permet l'ajout de formatters pour [PhpInsights](https://phpinsights.com/)
1012

1113
## Installation
1214

@@ -16,44 +18,30 @@ You can install the package via composer:
1618
composer require soyhuce/phpinsights-formatter
1719
```
1820

19-
You can publish and run the migrations with:
21+
### Text Formatter
2022

23+
Utilisez le formatter via
2124
```bash
22-
php artisan vendor:publish --tag="phpinsights-formatter-migrations"
23-
php artisan migrate
25+
php artisan insights --format=\\Soyhuce\\PhpInsights\\TextFormatter > insights.txt
2426
```
2527

26-
You can publish the config file with:
28+
### Markdown Formatter
2729

30+
Utilisez le formatter via
2831
```bash
29-
php artisan vendor:publish --tag="phpinsights-formatter-config"
32+
php artisan insights --format=\\Soyhuce\\PhpInsights\\MarkdownFormatter
3033
```
3134

32-
This is the contents of the published config file:
33-
34-
```php
35-
return [
36-
];
37-
```
35+
Le résultat sera stocké sous `insights-full.md`
3836

39-
Optionally, you can publish the views using
37+
### Light Markdown Formatter
4038

39+
Utilisez le formatter via
4140
```bash
42-
php artisan vendor:publish --tag="phpinsights-formatter-views"
41+
php artisan insights --format=\\Soyhuce\\PhpInsights\\LightMarkdownFormatter
4342
```
4443

45-
## Usage
46-
47-
```php
48-
$phpinsightsFormatter = new Soyhuce\PhpinsightsFormatter();
49-
echo $phpinsightsFormatter->echoPhrase('Hello, Soyhuce!');
50-
```
51-
52-
## Testing
53-
54-
```bash
55-
composer test
56-
```
44+
Le résultat sera stocké sous `insights.md`
5745

5846
## Changelog
5947

composer.json

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"keywords": [
55
"Soyhuce",
66
"laravel",
7-
"phpinsights-formatter"
7+
"phpinsights"
88
],
99
"homepage": "https://github.com/soyhuce/phpinsights-formatter",
1010
"license": "MIT",
@@ -17,8 +17,7 @@
1717
],
1818
"require": {
1919
"php": "^8.1",
20-
"spatie/laravel-package-tools": "^1.9.2",
21-
"illuminate/contracts": "^9.0"
20+
"nunomaduro/phpinsights": "^2.3"
2221
},
2322
"require-dev": {
2423
"friendsofphp/php-cs-fixer": "^3.7",
@@ -34,13 +33,7 @@
3433
},
3534
"autoload": {
3635
"psr-4": {
37-
"Soyhuce\\PhpinsightsFormatter\\": "src",
38-
"Soyhuce\\PhpinsightsFormatter\\Database\\Factories\\": "database/factories"
39-
}
40-
},
41-
"autoload-dev": {
42-
"psr-4": {
43-
"Soyhuce\\PhpinsightsFormatter\\Tests\\": "tests"
36+
"Soyhuce\\PhpInsights\\": "src"
4437
}
4538
},
4639
"scripts": {
@@ -58,17 +51,8 @@
5851
"sort-packages": true,
5952
"allow-plugins": {
6053
"pestphp/pest-plugin": true,
61-
"phpstan/extension-installer": true
62-
}
63-
},
64-
"extra": {
65-
"laravel": {
66-
"providers": [
67-
"Soyhuce\\PhpinsightsFormatter\\PhpinsightsFormatterServiceProvider"
68-
],
69-
"aliases": {
70-
"PhpinsightsFormatter": "Soyhuce\\PhpinsightsFormatter\\Facades\\PhpinsightsFormatter"
71-
}
54+
"phpstan/extension-installer": true,
55+
"dealerdirect/phpcodesniffer-composer-installer": true
7256
}
7357
},
7458
"minimum-stability": "dev",

config/phpinsights-formatter.php

Lines changed: 0 additions & 4 deletions
This file was deleted.

database/factories/ModelFactory.php

Lines changed: 0 additions & 19 deletions
This file was deleted.

database/migrations/create_phpinsights_formatter_table.php.stub

Lines changed: 0 additions & 19 deletions
This file was deleted.

phpstan-baseline.neon

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
parameters:
2+
ignoreErrors:
3+
- message: "#^Offset string on array\\{\\} on left side of \\?\\?\\= does not exist\\.$#"
4+
count: 1
5+
path: src/MarkdownFormatter.php
6+
7+
- message: "#^Parameter \\#1 \\$path of function realpath expects string, string\\|false given\\.$#"
8+
count: 1
9+
path: src/MarkdownFormatter.php
10+
11+
- message: "#^Parameter \\#1 \\$path of function realpath expects string, string\\|false given\\.$#"
12+
count: 1
13+
path: src/TextFormatter.php

phpstan.neon.dist

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ parameters:
55
level: 8
66
paths:
77
- src
8-
- config
9-
- database
108
checkOctaneCompatibility: true
119
checkModelProperties: true
1210
checkMissingIterableValueType: true

resources/views/.gitkeep

Whitespace-only changes.

src/Commands/PhpinsightsFormatterCommand.php

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)