Skip to content

Commit 97b219c

Browse files
Upgrade
1 parent 6e88db1 commit 97b219c

14 files changed

+110
-142
lines changed

.github/ISSUE_TEMPLATE/bug.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Bug Report
2+
description: Report an Issue or Bug with the Package
3+
title: "[Bug]: "
4+
labels: ["bug"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
We're sorry to hear you have a problem. Can you help us solve it by providing the following details.
10+
- type: textarea
11+
id: what-happened
12+
attributes:
13+
label: What happened?
14+
description: What did you expect to happen?
15+
placeholder: I cannot currently do X thing because when I do, it breaks X thing.
16+
validations:
17+
required: true
18+
- type: textarea
19+
id: how-to-reproduce
20+
attributes:
21+
label: How to reproduce the bug
22+
description: How did this occur, please add any config values used and provide a set of reliable steps if possible.
23+
placeholder: When I do X I see Y.
24+
validations:
25+
required: true
26+
- type: input
27+
id: package-version
28+
attributes:
29+
label: Package Version
30+
description: What version of our Package are you running? Please be as specific as possible
31+
placeholder: 2.0.0
32+
validations:
33+
required: true
34+
- type: input
35+
id: php-version
36+
attributes:
37+
label: PHP Version
38+
description: What version of PHP are you running? Please be as specific as possible
39+
placeholder: 8.2.0
40+
validations:
41+
required: true
42+
- type: input
43+
id: laravel-version
44+
attributes:
45+
label: Laravel Version
46+
description: What version of Laravel are you running? Please be as specific as possible
47+
placeholder: 9.0.0
48+
validations:
49+
required: true
50+
- type: dropdown
51+
id: operating-systems
52+
attributes:
53+
label: Which operating systems does with happen with?
54+
description: You may select more than one.
55+
multiple: true
56+
options:
57+
- macOS
58+
- Windows
59+
- Linux
60+
- type: textarea
61+
id: notes
62+
attributes:
63+
label: Notes
64+
description: Use this field to provide any other notes that you feel might be relevant to the issue.
65+
validations:
66+
required: false

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,3 @@ contact_links:
99
- name: Report a security issue
1010
url: https://github.com/michaelnabil230/laravel-setting/security/policy
1111
about: Learn how to notify us for sensitive bugs
12-
- name: Report a bug
13-
url: https://github.com/michaelnabil230/laravel-setting/issues/new
14-
about: Report a reproducible bug

.github/workflows/dependabot-auto-merge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
steps:
1313
- name: Dependabot metadata
1414
id: metadata
15-
uses: dependabot/fetch-metadata@v1.3.4
15+
uses: dependabot/fetch-metadata@v1.3.6
1616
with:
1717
github-token: "${{ secrets.GITHUB_TOKEN }}"
1818

.github/workflows/fix-php-code-style-issues.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: Fix PHP code style issues
22

3-
on: [push]
3+
on:
4+
push:
5+
paths:
6+
- "**.php"
47

58
jobs:
69
php-code-styling:
@@ -13,7 +16,7 @@ jobs:
1316
ref: ${{ github.head_ref }}
1417

1518
- name: Fix PHP code style issues
16-
uses: aglipanci/laravel-pint-action@1.0.0
19+
uses: aglipanci/laravel-pint-action@2.1.0
1720

1821
- name: Commit changes
1922
uses: stefanzweifel/git-auto-commit-action@v4

.github/workflows/phpstan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
coverage: none
2121

2222
- name: Install composer dependencies
23-
uses: ramsey/composer-install@v1
23+
uses: ramsey/composer-install@v2
2424

2525
- name: Run PHPStan
2626
run: ./vendor/bin/phpstan --error-format=github

.github/workflows/run-tests.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,16 @@ jobs:
66
test:
77
runs-on: ${{ matrix.os }}
88
strategy:
9-
fail-fast: false
9+
fail-fast: true
1010
matrix:
1111
os: [ubuntu-latest, windows-latest]
12-
php: [8.0, 8.1]
13-
laravel: [8.*, 9.*]
14-
stability: [prefer-stable]
12+
php: [8.2, 8.1]
13+
laravel: [10.*]
14+
stability: [prefer-lowest, prefer-stable]
1515
include:
16-
- laravel: 8.*
17-
testbench: ^6.25
18-
- laravel: 9.*
19-
testbench: 7.*
16+
- laravel: 10.*
17+
testbench: 8.*
18+
carbon: ^2.63
2019

2120
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
2221

@@ -38,10 +37,10 @@ jobs:
3837
3938
- name: Install dependencies
4039
run: |
41-
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
40+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "nesbot/carbon:${{ matrix.carbon }}" --no-interaction --no-update
4241
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
4342
44-
- name: List installed dependencies
43+
- name: List Installed Dependencies
4544
run: composer show -D
4645

4746
- name: Execute tests

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This package allows you to persist in setting for Laravel projects and support laravel 8 & 9.
1+
# This package allows you to persist in setting for Laravel projects and support laravel 10.
22

33
[![Latest Version on Packagist](https://img.shields.io/packagist/v/michaelnabil230/laravel-setting.svg)](https://packagist.org/packages/michaelnabil230/laravel-setting)
44
[![Total Downloads](https://img.shields.io/packagist/dt/michaelnabil230/laravel-setting.svg)](https://packagist.org/packages/michaelnabil230/laravel-setting)

composer.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,21 @@
2424
}
2525
],
2626
"require": {
27-
"php": "^8.0",
28-
"illuminate/contracts": "^8.73|^9.0",
29-
"spatie/laravel-package-tools": "1.11.0"
27+
"php": "^8.1",
28+
"spatie/laravel-package-tools": "^1.14.0",
29+
"illuminate/contracts": "^10.0"
3030
},
3131
"require-dev": {
32-
"laravel/pint": "^1.0",
33-
"nunomaduro/collision": "^5.10|^6.0",
34-
"nunomaduro/larastan": "^1.0|^2.2.5",
35-
"orchestra/testbench": "^6.22|^7.0",
32+
"laravel/pint": "^1.2",
33+
"nunomaduro/collision": "^6.1",
34+
"nunomaduro/larastan": "^2.0.1",
35+
"orchestra/testbench": "^8.0",
3636
"pestphp/pest": "^1.21",
3737
"pestphp/pest-plugin-laravel": "^1.1",
3838
"phpstan/extension-installer": "^1.1",
3939
"phpstan/phpstan-deprecation-rules": "^1.0",
4040
"phpstan/phpstan-phpunit": "^1.0",
41-
"phpunit/phpunit": "^9.5"
41+
"phpunit/phpunit": "^9.6"
4242
},
4343
"autoload": {
4444
"psr-4": {
@@ -79,4 +79,4 @@
7979
},
8080
"minimum-stability": "dev",
8181
"prefer-stable": true
82-
}
82+
}

src/Interfaces/Store.php

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ public function get($key, $default = null);
1515

1616
/**
1717
* Loaded data from the store.
18-
*
19-
* @return void
2018
*/
2119
public function loadedData(): void;
2220

@@ -32,10 +30,9 @@ public function set($key, $value = null);
3230
/**
3331
* Determine if a key exists in the settings data.
3432
*
35-
* @param string $key
3633
* @return bool
3734
*/
38-
public function has($key);
35+
public function has(string $key);
3936

4037
/**
4138
* Save any changes done to the settings data.
@@ -47,7 +44,6 @@ public function save();
4744
/**
4845
* Write the data into the store.
4946
*
50-
* @param array $data
5147
* @return void
5248
*/
5349
public function write(array $data);
@@ -64,34 +60,30 @@ public function all();
6460
*
6561
* This method exists for convenience.
6662
*
67-
* @param mixed $key
6863
* @return $this
6964
*/
70-
public function flip($key);
65+
public function flip(mixed $key);
7166

7267
/**
7368
* Sets the specified key to true.
7469
*
75-
* @param mixed $key
7670
* @return $this
7771
*/
78-
public function enable($key);
72+
public function enable(mixed $key);
7973

8074
/**
8175
* Sets the specified key to false.
8276
*
83-
* @param mixed $key
8477
* @return $this
8578
*/
86-
public function disable($key);
79+
public function disable(mixed $key);
8780

8881
/**
8982
* Unset a key in the settings data.
9083
*
91-
* @param string $key
9284
* @return bool
9385
*/
94-
public function forget($key);
86+
public function forget(string $key);
9587

9688
/**
9789
* Unset all keys in the settings data.
@@ -103,7 +95,6 @@ public function forgetAll();
10395
/**
10496
* Set extra columns to be added to the rows.
10597
*
106-
* @param array $columns
10798
* @return $this
10899
*/
109100
public function setExtraColumns(array $columns);

src/SettingManager.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ public function getDefaultDriver()
2020
/**
2121
* Register a new store.
2222
*
23-
* @param string $driver
24-
* @param array $params
2523
* @return self
2624
*/
2725
public function register(string $driver, array $params)

src/Stores/DatabaseSettingStore.php

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,8 @@ class DatabaseSettingStore extends SettingStore
5555

5656
/**
5757
* SettingStore constructor.
58-
*
59-
* @param array $options
60-
* @return void
6158
*/
62-
public function postOptions($options = []): void
59+
public function postOptions(array $options = []): void
6360
{
6461
$this->model = $options['model'];
6562
$this->cache = $this->app['cache'];
@@ -69,9 +66,6 @@ public function postOptions($options = []): void
6966

7067
/**
7168
* Write the data into the store.
72-
*
73-
* @param array $data
74-
* @return void
7569
*/
7670
public function write(array $data): void
7771
{
@@ -90,8 +84,6 @@ public function write(array $data): void
9084

9185
/**
9286
* Loaded data from the store.
93-
*
94-
* @return void
9587
*/
9688
public function loadedData(): void
9789
{
@@ -108,11 +100,8 @@ public function loadedData(): void
108100

109101
/**
110102
* Unset a key in the settings data.
111-
*
112-
* @param string $key
113-
* @return bool
114103
*/
115-
public function forget($key): bool
104+
public function forget(string $key): bool
116105
{
117106
$this->loadedData();
118107

@@ -133,8 +122,6 @@ public function forget($key): bool
133122

134123
/**
135124
* Unset all keys in the settings data.
136-
*
137-
* @return bool
138125
*/
139126
public function forgetAll(): bool
140127
{
@@ -148,7 +135,6 @@ public function forgetAll(): bool
148135
/**
149136
* Set extra columns to be added to the rows.
150137
*
151-
* @param array $columns
152138
* @return $this
153139
*/
154140
public function setExtraColumns(array $columns): self
@@ -160,9 +146,6 @@ public function setExtraColumns(array $columns): self
160146

161147
/**
162148
* Sync the deleted records.
163-
*
164-
* @param array $deleted
165-
* @return void
166149
*/
167150
private function syncDeleted(array $deleted): void
168151
{
@@ -173,8 +156,6 @@ private function syncDeleted(array $deleted): void
173156

174157
/**
175158
* Read the original data from dataBase.
176-
*
177-
* @return array
178159
*/
179160
private function readOriginalData(): array
180161
{
@@ -183,9 +164,6 @@ private function readOriginalData(): array
183164

184165
/**
185166
* Get the changed settings data.
186-
*
187-
* @param array $data
188-
* @return array
189167
*/
190168
private function getChanges(array $data): array
191169
{
@@ -207,9 +185,6 @@ private function getChanges(array $data): array
207185
/**
208186
* Transforms settings data into an array ready to be inserted into the database.
209187
* Call array_dot on a multidimensional array before passing it into this method!
210-
*
211-
* @param array $data
212-
* @return array
213188
*/
214189
private function prepareData(array $data): array
215190
{

0 commit comments

Comments
 (0)