Skip to content

Commit 466e28f

Browse files
committed
bugfix(workflow): fix workflow versions and fix readme links
1 parent 4939fbd commit 466e28f

File tree

3 files changed

+53
-49
lines changed

3 files changed

+53
-49
lines changed

.github/workflows/php-cs-fixer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
name: PHP-CS-Fixer
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v2
10+
- uses: actions/checkout@v3
1111
- name: PHP-CS-Fixer
1212
uses: docker://oskarstark/php-cs-fixer-ga:2.19.0
1313
with:

.github/workflows/testing.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
name: testing
1+
name: Testing
22

33
on: [ push, pull_request ]
44

55
jobs:
66
test:
77
runs-on: ubuntu-latest
8-
name: P${{ matrix.php }} - ${{ matrix.dependency-version }}
8+
name: P${{ matrix.php-versions }} - ${{ matrix.dependency-version }}
99
strategy:
1010
matrix:
1111
php-versions: [7.0, 7.1]
1212
dependency-version: [prefer-lowest, prefer-stable]
1313

1414
steps:
1515
- name: Checkout code
16-
uses: actions/checkout@v2
16+
uses: actions/checkout@v3
1717

1818
- name: Setup PHP
1919
uses: shivammathur/setup-php@v2
@@ -30,4 +30,4 @@ jobs:
3030
run: composer test
3131

3232
- name: Upload coverage to Codecov
33-
uses: codecov/codecov-action@v1
33+
uses: codecov/codecov-action@v3

README.md

Lines changed: 48 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
[![Total Downloads][ico-downloads]][link-downloads]
77
[![Today Downloads][ico-today-downloads]][link-downloads]
88
[![Required PHP Version][ico-php]][link-packagist]
9-
![build](https://github.com/salibhdr/php-dump-logger/actions/workflows/testing.yml/badge.svg?branch=v1)
10-
[![codecov](https://codecov.io/gh/SaliBhdr/php-dump-logger/branch/v1/graph/badge.svg?token=ZG9NV6JRRP)](https://codecov.io/gh/SaliBhdr/php-dump-logger)
9+
[![Testing][ico-testing]][link-testing]
10+
[![codecov][ico-codecov]][link-codecov]
1111
[![Latest Versions][ico-version]][link-packagist]
1212
[![Unstable Version][ico-unstable]][link-packagist]
1313

1414

1515
## Table of Contents
16-
* [Introduction](#intoduction)
16+
* [Introduction](#introduction)
1717
* [Installation](#installation)
1818
* [Version Compatibility](#version-compatibility)
1919
* [Basic Usage](#basic-usage)
@@ -27,31 +27,31 @@
2727
* [Daily Log](#daily-log)
2828
* [Silent Logging](#silent-logging)
2929
* [Loggers](#loggers)
30-
* [Pretty Logger](#pretty-logger)
31-
* [Html Logger](#html-logger)
32-
* [Raw Logger](#raw-logger)
33-
* [Custom Logger](#custom-logger)
30+
* [Pretty Logger](#pretty-logger)
31+
* [Html Logger](#html-logger)
32+
* [Raw Logger](#raw-logger)
33+
* [Custom Logger](#custom-logger)
3434
* [Full Example](#full-example)
3535
* [Issues](#issues)
3636
* [License](#license)
3737
* [Testing](#testing)
3838
* [Contributing](#contributing)
3939

4040

41-
## Introduction
42-
PHP dump logger uses [Symfony's var-dumper][link-symfony-var-dumper] to create a simple, easy to use, eye-friendly, and pretty log files for any PHP application.
43-
If you are the fan of using `dd()` and `dump()`, this package is for you.
41+
## Introduction <span id="introduction"></span>
42+
PHP dump logger uses [Symfony's var-dumper][link-symfony-var-dumper] to create a simple, easy to use, eye-friendly, and pretty log files for any PHP application.
43+
If you are a fan of using `dd()` and `dump()`, this package is for you.
4444

4545
**Example log file content:**
4646

4747
![php dump logger](https://symfony.com/doc/6.2/_images/01-simple.png)
4848

4949
Have you ever tried to log something with Symfony's monolog or laravel's logger facade and tried to find the logged data inside a maze of text?
50-
Specially when you don't have time and don't want to go through installing and configuring Xdebug or there is a bug in production code,
51-
and you just want to see the API responses without messing with the code execution.
52-
The first solution that comes to mind is to use a logger to log the data instead of using `dd()`, `dump()`, or `var_dump()` functions.
53-
But as I said loggers aren't producing readable files. You have to provide them with string, and they are incapable of directly logging a complex class.
54-
How nice could it be to have a functionality like `dd()` without interruption in the code.
50+
Especially when you don't have time and don't want to go through installing and configuring Xdebug or there is a bug in production code,
51+
and you just want to see the API responses without messing with the code execution.
52+
The first solution that comes to mind is to use a logger to log the data instead of using `dd()`, `dump()`, or `var_dump()` functions.
53+
But as I said, loggers aren't producing readable files. You have to provide them with a string, and they are incapable of directly logging a complex class.
54+
How nice would it be to have a functionality like `dd()` without interruption in the code?
5555

5656
Here **php-dump-logger** comes to the rescue.
5757

@@ -68,7 +68,7 @@ You can either log the data in a nice `html` or `log` format or even provide you
6868
* Logging file in a custom level
6969
* Changing the path and directory of the log
7070

71-
## Installation
71+
## Installation <span id="installation"></span>
7272

7373
Install via composer:
7474

@@ -78,11 +78,11 @@ Install via composer:
7878

7979
## Version Compatibility
8080

81-
| PHP | PHP Dump Logger |
82-
|:-------------|:----------------|
83-
| ^7.0 && ^7.1 | 1.x |
81+
| PHP | PHP Dump Logger |
82+
|:---------------|:----------------|
83+
| 7.0.x to 7.1.x | 1.x |
8484

85-
## Basic Usage
85+
## Basic Usage <span id="basic-usage"></span>
8686

8787
```php
8888
<?php
@@ -122,7 +122,7 @@ array:3 [
122122
]
123123
```
124124

125-
## Detailed Usage
125+
## Detailed Usage <span id="detailed-usage"></span>
126126

127127
* [Methods](#methods)
128128
* [Exception Logging](#exception-logging)
@@ -133,7 +133,7 @@ array:3 [
133133
* [Daily Log](#daily-log)
134134
* [Silent Logging](#silent-logging)
135135

136-
### Methods
136+
### Methods <span id="methods"></span>
137137

138138
Each log level (info, error, warning, etc.) creates a separate log file with method's name.
139139

@@ -159,9 +159,9 @@ $logger->log(mixed $data);
159159

160160
<br/>
161161

162-
### Exception Logging
162+
### Exception Logging <span id="exception-logging"></span>
163163

164-
If you want to log the exception in much more readable way You should use `exception()` method.
164+
If you want to log the exception in a much more readable way You should use the `exception()` method.
165165
It is good for creating logs for exceptions like this:
166166
If You want to see the trace of the exception you can set the second argument named `$withTrace` to true:
167167

@@ -195,7 +195,7 @@ array:5 [
195195

196196
<br/>
197197

198-
### Custom Log Level
198+
### Custom Log Level <span id="custom-log-level"></span>
199199

200200
As mentioned before each log level creates a separate log file. So you can create custom log level with custom
201201
file name by changing the value of `$level` argument in `log()` method:
@@ -208,7 +208,7 @@ This will create a file named `custom-level.log`.
208208

209209
<br/>
210210

211-
### Path
211+
### Path <span id="path"></span>
212212

213213
By default, the path to log directory is set to be `$_SERVER['DOCUMENT_ROOT']` but if you call this logger
214214
from a console command the document rule will be null and the logger could not find a directory to save the file, and it will throw
@@ -222,7 +222,7 @@ $logger->path('__path-to-dir__');
222222

223223
<br/>
224224

225-
### Directory Name
225+
### Directory Name <span id="directory-name"></span>
226226

227227
By default, The parent directory of log files is called `dump` but you can change the directory name of the log file with `dir()` method:
228228

@@ -243,7 +243,7 @@ $logger->dir('dump/custom')
243243

244244
<br/>
245245

246-
### Directory Permission
246+
### Directory Permission <span id="directory-permission"></span>
247247

248248
Sometimes you want to put your log files in a directory with restricted permission.
249249
In order to do that you can change the log file's directory permission with the `permission()` method.
@@ -261,7 +261,7 @@ $logger->permission(0777);
261261

262262
<br/>
263263

264-
### Daily Log
264+
### Daily Log <span id="daily-log"></span>
265265

266266
Sometimes you want to log data daily into separate file's based on date, You can separate the log files daily with date suffix by calling the `daily()` method.
267267

@@ -284,11 +284,11 @@ info-2023-02-01.log
284284

285285
<br/>
286286

287-
### Silent Logging
287+
### Silent Logging <span id="silent-logging"></span>
288288

289-
Calling `silent()` method allows you to log data without throwing an error.
289+
Calling `silent()` method allows you to log data without throwing an error.
290290

291-
Remember that in some cases the logger will throw an error like when the $path is empty, or when it couldn't write into the target file for permission reasons.
291+
Remember that in some cases the logger will throw an error like when the $path is empty, or when it couldn't write into the target file for permission reasons.
292292

293293
So if you want to avoid that, and you don't want to interrupt the code execution, you can call `silent()` method.
294294
In the background this method will force the logger to execute the code in try-catch block and return a boolean instead of the exception.
@@ -301,15 +301,15 @@ $logger->silent(); //result will be true for success and false for failed attemp
301301

302302
<br/>
303303

304-
## Loggers
304+
## Loggers <span id="loggers"></span>
305305

306306
* [Pretty Logger](#pretty-logger)
307307
* [Html Logger](#html-logger)
308308
* [Raw Logger](#raw-logger)
309309
* [Custom Logger](#custom-logger)
310310

311311

312-
### Pretty Logger
312+
### Pretty Logger <span id="pretty-logger"></span>
313313

314314
The pretty logger is used for creating a log file with `.log` extension in a pretty readable way.
315315

@@ -334,7 +334,7 @@ $logger = Logger::pretty();
334334

335335
<br/>
336336

337-
### Html Logger
337+
### Html Logger <span id="html-logger"></span>
338338

339339
The html logger is used for creating a log file with `.html` extension in a pretty readable way.
340340
You can navigate throw different variables, toggle the multidimensional arrays and complex class properties.
@@ -356,10 +356,10 @@ $logger = Logger::html();
356356

357357
<br/>
358358

359-
### Raw Logger
359+
### Raw Logger <span id="raw-logger"></span>
360360

361361
Raw Logger is base logger class that other loggers are using it. The only difference between Raw Logger and the others is that there
362-
is no dumper or path specified in this logger, and you have to provide a dumper and the file extension with `dumper()` and the path with `path()` method.
362+
is no dumper or path specified in this logger, and you have to provide a dumper and the file extension with `dumper()` and the path with `path()` method.
363363
Otherwise, it will throw `SaliBhdr\DumpLog\ExceptionsInvalidArgumentException`
364364

365365
Remember that the dumper should be the instance of `Symfony\Component\VarDumper\Dumper\AbstractDumper`.
@@ -383,7 +383,7 @@ $logger->path('__path_to_dir__')
383383

384384
<br/>
385385

386-
### Custom Logger
386+
### Custom Logger <span id="custom-logger"></span>
387387

388388
You can create your own dump logger by implementing the `SaliBhdr\DumpLog\Contracts\DumpLoggerInterface` or `SaliBhdr\DumpLog\Contracts\ChangeableDumperLoggerInterface`.
389389
You can also use the RawLogger in your own logger by first instantiating the RawLogger in your Logger and then use the `SaliBhdr\DumpLog\Traits\LogsThroughRawLogger` trait.
@@ -419,7 +419,7 @@ class CustomTextLogger implements DumpLoggerInterface
419419
```
420420
<br />
421421

422-
## Full Example
422+
## Full Example <span id="full-example"></span>
423423

424424
```php
425425
<?php
@@ -436,11 +436,11 @@ Logger::make()
436436

437437
```
438438

439-
## Issues
439+
## Issues <span id="issues"></span>
440440

441441
You can report issues in GitHub repository [here][link-issues]
442442

443-
## License
443+
## License <span id="license"></span>
444444

445445
PHP dump logger is released under the MIT License.
446446

@@ -457,7 +457,7 @@ Created by [Salar Bahador][link-github]
457457

458458
Built with ❤ for you.
459459

460-
## Testing
460+
## Testing <span id="testing"></span>
461461

462462
for testing:
463463

@@ -477,17 +477,21 @@ for both csfix and test:
477477
composer testfix
478478
```
479479

480-
## Contributing
480+
## Contributing <span id="contributing"></span>
481481

482482
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
483483

484484

485-
[ico-php]: https://img.shields.io/badge/php-7.0|7.1-8892bf?style=flat-square&logo=php
485+
[ico-php]: https://img.shields.io/badge/php-7.*|8.*-8892bf?style=flat-square&logo=php
486+
[ico-testing]: https://github.com/salibhdr/php-dump-logger/actions/workflows/testing.yml/badge.svg?branch=v1
487+
[ico-codecov]: https://codecov.io/gh/SaliBhdr/php-dump-logger/branch/v1/graph/badge.svg?token=ZG9NV6JRRP
486488
[ico-downloads]: https://poser.pugx.org/salibhdr/php-dump-logger/downloads
487489
[ico-today-downloads]: https://img.shields.io/packagist/dd/salibhdr/php-dump-logger.svg?style=flat-square
488490
[ico-unstable]: https://poser.pugx.org/salibhdr/php-dump-logger/v/unstable
489491
[ico-version]: https://img.shields.io/packagist/v/salibhdr/php-dump-logger.svg?style=flat-square
490492

493+
[link-codecov]: https://codecov.io/gh/SaliBhdr/php-dump-logger
494+
[link-testing]: https://github.com/SaliBhdr/php-dump-logger/actions/workflows/testing.yml
491495
[link-logo]: https://drive.google.com/a/domain.com/thumbnail?id=12yntFCiYIGJzI9FMUaF9cRtXKb0rXh9X
492496
[link-packagist]: https://packagist.org/packages/salibhdr/php-dump-logger
493497
[link-downloads]: https://packagist.org/packages/salibhdr/php-dump-logger/stats

0 commit comments

Comments
 (0)