Skip to content

Commit 5945819

Browse files
author
Mike van den Hoek
committed
(feat): upgrade to php8
1 parent e0de8d5 commit 5945819

File tree

25 files changed

+602
-760
lines changed

25 files changed

+602
-760
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ Thumbs.db
6464
*.log
6565
*.sql
6666
*.sqlite
67+
pg-log-*.json
6768

6869
# ignore compiled files
6970
*.com

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,31 @@ See [here](https://github.com/OpenWebconcept/plugin-prefill-gravity-forms/blob/m
4949
## License
5050

5151
The source code is made available under the [EUPL 1.2 license](https://github.com/OpenWebconcept/plugin-prefill-gravity-forms/blob/main/LICENSE.md). Some of the dependencies are licensed differently, with the BSD or MIT license, for example.
52+
53+
## Logging
54+
55+
Enable logging to monitor errors during communication with DataB.
56+
57+
- Logs are written daily to `pg-log{-date}.json` in the plugin root directory.
58+
- A rotating file handler keeps up to 7 log files by default, deleting the oldest as needed.
59+
- You can change the maximum number of log files using the filter described below.
60+
61+
## Hooks
62+
63+
#### Change the maximum number of log files
64+
65+
Use the following filter to alter the rotating file handler's max files setting:
66+
67+
```php
68+
apply_filters('pg::logger/rotating_filer_handler_max_files', PG_LOGGER_DEFAULT_MAX_FILES)
69+
```
70+
71+
#### Intercept exceptions for custom handling
72+
73+
You can intercept exceptions caught by the plugin for additional processing or custom logging using this filter:
74+
75+
```php
76+
apply_filters('pg::exception/intercept', $exception)
77+
```
78+
79+
The `$exception` parameter contains the caught exception object.

build/blocks.asset.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '33b24b2f8a8b7ff4f915');
1+
<?php
2+
3+
return ['dependencies' => ['react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n'], 'version' => '33b24b2f8a8b7ff4f915'];

build/icons.asset.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
<?php return array('dependencies' => array(), 'version' => '12341f29470476729a0c');
1+
<?php
2+
3+
return ['dependencies' => [], 'version' => '12341f29470476729a0c'];

build/style.asset.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
<?php return array('dependencies' => array(), 'version' => 'd63fd4982613309d5c57');
1+
<?php
2+
3+
return ['dependencies' => [], 'version' => 'd63fd4982613309d5c57'];

composer.json

Lines changed: 44 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,49 @@
11
{
2-
"name": "plugin/prefill-gravity-forms",
3-
"description": "Prefill GravityForms Plugin",
4-
"authors": [
5-
{
6-
"name": "Yard | Digital Agency",
7-
"email": "[email protected]",
8-
"homepage": "https://www.yard.nl"
9-
}
10-
],
11-
"type": "wordpress-plugin",
12-
"repositories": [
13-
{
14-
"type": "composer",
15-
"url": "https://wpackagist.org"
16-
},
17-
{
2+
"name": "plugin/prefill-gravity-forms",
3+
"description": "Prefill GravityForms Plugin",
4+
"authors": [
5+
{
6+
"name": "Yard | Digital Agency",
7+
"email": "[email protected]",
8+
"homepage": "https://www.yard.nl"
9+
}
10+
],
11+
"type": "wordpress-plugin",
12+
"repositories": [
13+
{
14+
"type": "composer",
15+
"url": "https://wpackagist.org"
16+
},
17+
{
1818
"type": "vcs",
1919
"url": "[email protected]:OpenWebconcept/idp-userdata"
2020
}
21-
],
22-
"require": {
23-
"php": ">=7.0",
24-
"php-di/php-di": "^6.0",
25-
"owc/idp-userdata": "^1.0"
26-
},
27-
"require-dev": {
28-
"mockery/mockery": "^1.0",
29-
"phpunit/phpunit": "^9.0",
30-
"10up/wp_mock": "^0.5.0",
31-
"friendsofphp/php-cs-fixer": "^3.0",
32-
"phpstan/phpstan": "^0.12",
33-
"szepeviktor/phpstan-wordpress": "^0.6.0"
34-
},
35-
"autoload": {
36-
"psr-4": {
37-
"OWC\\PrefillGravityForms\\": "./src/PrefillGravityForms"
38-
}
39-
},
40-
"autoload-dev": {
41-
"psr-4": {
42-
"OWC\\PrefillGravityForms\\Tests\\": "./tests/Unit"
43-
}
44-
},
45-
"scripts": {
46-
"test": "clear && ./vendor/bin/phpunit --testsuite 'Unit Test Suite' --colors=always",
47-
"format": "vendor/bin/php-cs-fixer fix",
48-
"phpstan": "./vendor/bin/phpstan analyse"
49-
}
21+
],
22+
"require": {
23+
"php": "^8.0",
24+
"php-di/php-di": "^7.0",
25+
"owc/idp-userdata": "^1.0"
26+
},
27+
"require-dev": {
28+
"10up/wp_mock": "^0.5.0",
29+
"friendsofphp/php-cs-fixer": "^3.0",
30+
"mockery/mockery": "^1.0",
31+
"phpunit/phpunit": "^9.0",
32+
"szepeviktor/phpstan-wordpress": "^1.0"
33+
},
34+
"autoload": {
35+
"psr-4": {
36+
"OWC\\PrefillGravityForms\\": "./src/PrefillGravityForms"
37+
}
38+
},
39+
"autoload-dev": {
40+
"psr-4": {
41+
"OWC\\PrefillGravityForms\\Tests\\": "./tests/Unit"
42+
}
43+
},
44+
"scripts": {
45+
"test": "clear && ./vendor/bin/phpunit --testsuite 'Unit Test Suite' --colors=always",
46+
"format": "vendor/bin/php-cs-fixer fix",
47+
"phpstan": "./vendor/bin/phpstan analyse"
48+
}
5049
}

0 commit comments

Comments
 (0)