Skip to content
This repository was archived by the owner on Feb 6, 2023. It is now read-only.

Commit 08b5c18

Browse files
Merge branch 'release/3.0.0'
2 parents 9144207 + 82c2e66 commit 08b5c18

18 files changed

+275
-293
lines changed

.editorconfig

+3
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,8 @@ end_of_line = lf
1111
insert_final_newline = true
1212
trim_trailing_whitespace = true
1313

14+
[*.md]
15+
trim_trailing_whitespace = false
16+
1417
[*.yml]
1518
indent_size = 2

.github/ISSUE_TEMPLATE/BUG_REPORT.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve this project
4+
title: ''
5+
labels: bug
6+
assignees: sebastiaanluca
7+
---
8+
9+
### Description
10+
11+
### Expected result
12+
13+
### Steps to reproduce
14+
15+
1.
16+
2.
17+
3.
18+
19+
### Traces
20+
21+
Logs, error output, etc.
22+
23+
### Environment information
24+
25+
Setup, environment, packages, versions, etc.
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: feature
6+
assignees: sebastiaanluca
7+
---
8+
9+
### Description
10+
11+
A clear and concise description of the problem or proposal.
12+
13+
### Suggested solution
14+
15+
A clear and concise description of what you want to happen.
16+
17+
### Possible alternatives
18+
19+
A clear and concise description of any alternative solutions or features you've considered.
20+
21+
### Additional context
22+
23+
Any other context or screenshots to help situate and understand the requested feature.

.github/PULL_REQUEST_TEMPLATE.md

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
name: Pull request
3+
about: Create a new pull request to merge code into the main branch
4+
title: 'A short, descriptive title'
5+
labels: ''
6+
assignees: sebastiaanluca
7+
---
8+
9+
## PR Type
10+
11+
What kind of pull request is this? Put an `x` in all the boxes that apply:
12+
13+
- [ ] Bug fix (non-breaking change which fixes an issue)
14+
- [ ] New feature (non-breaking change which adds functionality)
15+
- [ ] Extend feature (non-breaking change which extends existing functionality)
16+
- [ ] Change feature (non-breaking change which either changes or refactors existing functionality)
17+
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
18+
19+
---
20+
21+
### Description
22+
23+
Clearly describe what this pull request changes and why.
24+
25+
### Steps to follow to verify functionality
26+
27+
1. Clearly state which actions should be performed to fully and correctly review this issue.
28+
2.
29+
30+
### Related issues
31+
32+
Link to the issue(s) this pull request handles.
33+
34+
### Related PRs
35+
36+
Link to any related pull requests.
37+

.github/workflows/test.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: test
2+
3+
on:
4+
push:
5+
pull_request:
6+
schedule:
7+
- cron: '0 0 * * *'
8+
9+
jobs:
10+
test:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
php: [8.0]
16+
laravel: [8.*]
17+
dependency-version: [prefer-lowest, prefer-stable]
18+
os: [ubuntu-latest]
19+
include:
20+
- laravel: 8.*
21+
testbench: 6.*
22+
23+
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}
24+
25+
steps:
26+
- name: Check out code
27+
uses: actions/checkout@v2
28+
29+
- name: Cache dependencies
30+
uses: actions/cache@v2
31+
with:
32+
path: ~/.composer/cache/files
33+
key: dependencies-${{ runner.os }}-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
34+
35+
- name: Validate Composer configuration file
36+
run: composer validate --strict
37+
38+
- name: Set up PHP
39+
uses: shivammathur/setup-php@v2
40+
with:
41+
php-version: ${{ matrix.php }}
42+
extensions: mbstring
43+
coverage: none
44+
45+
- name: Install dependencies
46+
run: |
47+
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
48+
49+
- name: Execute tests
50+
run: vendor/bin/phpunit

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ composer.phar
22
composer.lock
33
vendor
44
tests/files/
5+
/.idea

.travis.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
language: php
22

33
php:
4-
- "7.2"
5-
- "7.3"
6-
- 7.4snapshot
4+
- 7.2
5+
- 7.3
6+
- 7.4
7+
- nightly
78

89
cache:
910
directories:
@@ -16,7 +17,7 @@ env:
1617

1718
matrix:
1819
allow_failures:
19-
- php: 7.4snapshot
20+
- php: nightly
2021
fast_finish: true
2122

2223
before_install:

CHANGELOG.md

+12-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,18 @@ All Notable changes to `sebastiaanluca/php-helpers` will be documented in this f
44

55
Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles.
66

7-
## Unreleased
7+
## 3.0.0 (2021-03-11)
8+
9+
### Added
10+
11+
- Added support for PHP 8
12+
13+
### Removed
14+
15+
- Dropped support for PHP 7.4 and lower
16+
- Dropped support for Carbon 1.x
17+
- Removed Kint package requirement
18+
- Removed debug helpers
819

920
## 2.0.0 (2019-02-27)
1021

README.md

+4-85
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Latest stable release][version-badge]][link-packagist]
44
[![Software license][license-badge]](LICENSE.md)
5-
[![Build status][travis-badge]][link-travis]
5+
[![Build status][githubaction-badge]][link-githubaction]
66
[![Total downloads][downloads-badge]][link-packagist]
77
[![Total stars][stars-badge]][link-github]
88

@@ -28,11 +28,6 @@
2828
- [has\_public\_method](#has_public_method)
2929
- [carbon](#carbon)
3030
- [temporary_file](#temporary_file)
31-
- [Debug global helper functions](#debug-global-helper-functions)
32-
- [sss](#sss)
33-
- [ddd](#ddd)
34-
- [sss_if](#sss_if)
35-
- [ddd_if](#ddd_if)
3631
- [Class helpers](#class-helpers)
3732
- [Constants trait](#constants-trait)
3833
- [Retrieving constants](#retrieving-constants)
@@ -50,7 +45,7 @@
5045

5146
## Requirements
5247

53-
- PHP 7.2 or higher
48+
- PHP 8 or higher
5449

5550
## How to install
5651

@@ -300,82 +295,6 @@ temporary_file();
300295
*/
301296
```
302297

303-
## Global debug helper functions
304-
305-
### sss
306-
307-
Display structured debug information about one or more values **in plain text** using Kint and halt script execution afterwards. Accepts multiple arguments to dump.
308-
309-
Output will be identical to `ddd` when used in a command line interface. In a browser, it'll display plain, but structured text.
310-
311-
Requires the [kint-php/kint](https://github.com/raveren/kint) package.
312-
313-
```php
314-
sss('string');
315-
316-
/*
317-
┌─────────────────────────────────────────┐
318-
│ literal │
319-
└─────────────────────────────────────────┘
320-
string (6) "string"
321-
═══════════════════════════════════════════
322-
Called from .../src/MyClass.php:42
323-
*/
324-
325-
sss('string', 0.42, ['array']);
326-
327-
/*
328-
┌─────────────────────────────────────────┐
329-
│ literal │
330-
└─────────────────────────────────────────┘
331-
string (6) "string"
332-
┌─────────────────────────────────────────┐
333-
│ literal │
334-
└─────────────────────────────────────────┘
335-
double 0.42
336-
┌─────────────────────────────────────────┐
337-
│ literal │
338-
└─────────────────────────────────────────┘
339-
array (1) [
340-
0 => string (5) "array"
341-
]
342-
═══════════════════════════════════════════
343-
Called from .../src/MyClass.php:42
344-
*/
345-
```
346-
347-
### ddd
348-
349-
Display structured debug information about one or more values using Kint and halt script execution afterwards. Accepts multiple arguments to dump. Output will be identical to `sss` when used in a command line interface. In a browser, it'll display an interactive, structured tree-view.
350-
351-
Requires the [kint-php/kint](https://github.com/raveren/kint) package.
352-
353-
See the [sss helper](#sss) for example output.
354-
355-
### sss_if
356-
357-
Display structured debug information about one or more values **in plain text** using Kint and halt script execution afterwards, but only if the condition is truthy. Does nothing if falsy. Accepts multiple arguments to dump.
358-
359-
Requires the [kint-php/kint](https://github.com/raveren/kint) package.
360-
361-
```php
362-
sss_if($user->last_name, 'User has a last name', $user->last_name);
363-
```
364-
365-
See the [sss helper](#sss) for example output.
366-
367-
### ddd_if
368-
369-
Display structured debug information about one or more values using Kint and halt script execution afterwards, but only if the condition is truthy. Does nothing if falsy. Accepts multiple arguments to dump.
370-
371-
Requires the [kint-php/kint](https://github.com/raveren/kint) package.
372-
373-
```php
374-
ddd_if(app()->environment('local'), 'Debugging in a local environment!');
375-
```
376-
377-
See the [ddd helper](#ddd) for example output.
378-
379298
## Class helpers
380299

381300
### Enum trait
@@ -581,7 +500,7 @@ Have a project that could use some guidance? Send me an e-mail at [hello@sebasti
581500

582501
[version-badge]: https://img.shields.io/packagist/v/sebastiaanluca/php-helpers.svg?label=stable
583502
[license-badge]: https://img.shields.io/badge/license-MIT-informational.svg
584-
[travis-badge]: https://img.shields.io/travis/sebastiaanluca/php-helpers/master.svg
503+
[githubaction-badge]: https://github.com/sebastiaanluca/php-helpers/actions/workflows/test.yml/badge.svg?branch=master
585504
[downloads-badge]: https://img.shields.io/packagist/dt/sebastiaanluca/php-helpers.svg?color=brightgreen
586505
[stars-badge]: https://img.shields.io/github/stars/sebastiaanluca/php-helpers.svg?color=brightgreen
587506

@@ -592,7 +511,7 @@ Have a project that could use some guidance? Send me an e-mail at [hello@sebasti
592511

593512
[link-github]: https://github.com/sebastiaanluca/php-helpers
594513
[link-packagist]: https://packagist.org/packages/sebastiaanluca/php-helpers
595-
[link-travis]: https://travis-ci.org/sebastiaanluca/php-helpers
514+
[link-githubaction]: https://github.com/sebastiaanluca/php-helpers/actions/workflows/test.yml?query=branch%3Amaster
596515
[link-twitter-share]: https://twitter.com/intent/tweet?text=Check%20out%20this%20extensive%20set%20of%20generic%20PHP%20helper%20functions%20and%20classes!%20Via%20@sebastiaanluca%20https://github.com/sebastiaanluca/php-helpers
597516
[link-contributors]: ../../contributors
598517

composer.json

+4-7
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,21 @@
2323
}
2424
],
2525
"require": {
26-
"php": "^7.2"
26+
"php": "^8.0"
2727
},
2828
"require-dev": {
29-
"kint-php/kint": "^3.1",
30-
"nesbot/carbon": "^1.22|^2.0",
31-
"phpunit/phpunit": "^8.2"
29+
"nesbot/carbon": "^2.23",
30+
"phpunit/phpunit": "^9.5"
3231
},
3332
"suggest": {
34-
"kint-php/kint": "A powerful and modern PHP debugging tool. Required for the debug helpers.",
3533
"nesbot/carbon": "A simple PHP API extension for DateTime. Required for the carbon helper."
3634
},
3735
"autoload": {
3836
"psr-4": {
3937
"SebastiaanLuca\\PhpHelpers\\": "src"
4038
},
4139
"files": [
42-
"src/Functions/generic.php",
43-
"src/Functions/debug.php"
40+
"src/Functions/generic.php"
4441
]
4542
},
4643
"autoload-dev": {

phpunit.xml

-32
This file was deleted.

0 commit comments

Comments
 (0)