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

Commit 2f2430d

Browse files
WIP
1 parent 6070abd commit 2f2430d

File tree

15 files changed

+251
-273
lines changed

15 files changed

+251
-273
lines changed
Lines changed: 25 additions & 0 deletions
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.
Lines changed: 23 additions & 0 deletions
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

Lines changed: 37 additions & 0 deletions
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

Lines changed: 50 additions & 0 deletions
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: curl, mbstring, pdo
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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ composer.phar
22
composer.lock
33
vendor
44
tests/files/
5+
/.idea

CHANGELOG.md

Lines changed: 12 additions & 1 deletion
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

Lines changed: 0 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -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)
@@ -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

composer.json

Lines changed: 4 additions & 7 deletions
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.3",
30-
"nesbot/carbon": "^1.22|^2.0",
31-
"phpunit/phpunit": "^8.5"
29+
"nesbot/carbon": "^2.0",
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

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

phpunit.xml.dist

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
5+
bootstrap="vendor/autoload.php"
6+
backupGlobals="false"
7+
backupStaticAttributes="false"
8+
colors="true"
9+
verbose="true"
10+
processIsolation="false"
11+
convertErrorsToExceptions="true"
12+
convertNoticesToExceptions="true"
13+
convertWarningsToExceptions="true"
14+
beStrictAboutTestsThatDoNotTestAnything="true"
15+
beStrictAboutOutputDuringTests="true"
16+
stopOnFailure="false"
17+
failOnRisky="true"
18+
failOnWarning="true"
19+
stopOnError="false"
20+
cacheResult="false">
21+
<coverage>
22+
<include>
23+
<directory suffix=".php">src/</directory>
24+
</include>
25+
</coverage>
26+
<testsuites>
27+
<testsuite name="Unit Tests">
28+
<directory suffix="Test.php">./tests/Unit</directory>
29+
</testsuite>
30+
</testsuites>
31+
</phpunit>

0 commit comments

Comments
 (0)