Skip to content

Commit 67bc682

Browse files
committed
Misc. updates
1 parent cc33a01 commit 67bc682

25 files changed

+183
-628
lines changed

.github/workflows/run-tests.yml

+6-10
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,26 @@ jobs:
99
strategy:
1010
fail-fast: true
1111
matrix:
12-
php: ['8.1', '8.2', '8.3']
13-
laravel: ['10.*', '11.*']
12+
php: ['8.2', '8.3', '8.4']
13+
laravel: ['10.*', '11.*', '12.*']
1414
composer-flags: ['--prefer-stable']
1515
can-fail: [false]
1616
include:
17-
- php: '8.1'
17+
- php: '8.2'
1818
laravel: '10.*'
1919
composer-flags: '--prefer-stable --prefer-lowest'
2020
can-fail: false
2121
exclude:
2222
- php: '8.1'
2323
laravel: '11.*'
24+
- php: '8.1'
25+
laravel: '12.*'
2426

2527
name: "PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}${{ matrix.composer-flags != '' && format(' - Composer {0}', matrix.composer-flags) || '' }}"
2628

2729
steps:
2830
- name: Checkout code
29-
uses: actions/checkout@v3
30-
31-
- name: Cache dependencies
32-
uses: actions/cache@v3
33-
with:
34-
path: ~/.composer/cache/files
35-
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}-flags-${{ matrix.composer-flags }}
31+
uses: actions/checkout@v4
3632

3733
- name: Setup PHP
3834
uses: shivammathur/setup-php@v2

.php-cs-fixer.php

+107-109
Original file line numberDiff line numberDiff line change
@@ -10,116 +10,114 @@
1010
->ignoreVCS(true);
1111

1212
return (new PhpCsFixer\Config())
13-
->setRules(
14-
[
15-
'@PHP81Migration' => true,
16-
'@PHP80Migration:risky' => true,
17-
'@PHPUnit100Migration:risky' => true,
18-
'@PSR12' => true,
19-
'@PSR2' => true,
20-
'align_multiline_comment' => true,
21-
'array_indentation' => true,
22-
'array_syntax' => [
23-
'syntax' => 'short',
13+
->setRules([
14+
'@PHP82Migration' => true,
15+
'@PHP82Migration:risky' => true,
16+
'@PHPUnit100Migration:risky' => true,
17+
'@PER-CS' => true,
18+
'@PER-CS:risky' => true,
19+
'align_multiline_comment' => true,
20+
'array_indentation' => true,
21+
'array_syntax' => [
22+
'syntax' => 'short',
23+
],
24+
'blank_line_after_opening_tag' => true,
25+
'blank_line_before_statement' => [
26+
'statements' => [
27+
'break',
28+
'case',
29+
'continue',
30+
'for',
31+
'foreach',
32+
'if',
33+
'return',
34+
'switch',
35+
'throw',
36+
'try',
37+
'while',
2438
],
25-
'blank_line_after_opening_tag' => true,
26-
'blank_line_before_statement' => [
27-
'statements' => [
28-
'break',
29-
'case',
30-
'continue',
31-
'for',
32-
'foreach',
33-
'if',
34-
'return',
35-
'switch',
36-
'throw',
37-
'try',
38-
'while',
39-
],
39+
],
40+
'braces' => true,
41+
'cast_spaces' => [
42+
'space' => 'single',
43+
],
44+
'class_definition' => true,
45+
'combine_consecutive_issets' => true,
46+
'combine_consecutive_unsets' => true,
47+
'compact_nullable_typehint' => true,
48+
'concat_space' => [
49+
'spacing' => 'one',
50+
],
51+
'declare_strict_types' => false,
52+
'dir_constant' => true,
53+
'function_to_constant' => true,
54+
'function_typehint_space' => true,
55+
'increment_style' => [
56+
'style' => 'post',
57+
],
58+
'is_null' => true,
59+
'linebreak_after_opening_tag' => true,
60+
'logical_operators' => true,
61+
'lowercase_cast' => true,
62+
'lowercase_static_reference' => true,
63+
'magic_constant_casing' => true,
64+
'method_argument_space' => [
65+
'on_multiline' => 'ensure_fully_multiline',
66+
],
67+
'method_chaining_indentation' => true,
68+
'modernize_types_casting' => true,
69+
'native_constant_invocation' => true,
70+
'native_function_casing' => true,
71+
'native_function_invocation' => true,
72+
'new_with_braces' => true,
73+
'no_alias_functions' => true,
74+
'no_blank_lines_after_class_opening' => true,
75+
'no_blank_lines_after_phpdoc' => true,
76+
'no_empty_phpdoc' => true,
77+
'no_empty_statement' => true,
78+
'no_extra_blank_lines' => true,
79+
'no_leading_import_slash' => true,
80+
'no_mixed_echo_print' => true,
81+
'no_multiline_whitespace_around_double_arrow' => true,
82+
'no_null_property_initialization' => true,
83+
'no_short_bool_cast' => true,
84+
'no_spaces_after_function_name' => true,
85+
'no_spaces_inside_parenthesis' => true,
86+
'no_superfluous_elseif' => true,
87+
'no_trailing_comma_in_singleline_array' => true,
88+
'no_trailing_whitespace' => true,
89+
'no_trailing_whitespace_in_comment' => true,
90+
'no_unneeded_control_parentheses' => true,
91+
'no_unused_imports' => true,
92+
'no_useless_else' => true,
93+
'no_useless_return' => true,
94+
'no_whitespace_before_comma_in_array' => true,
95+
'ordered_imports' => true,
96+
'phpdoc_align' => true,
97+
'phpdoc_scalar' => true,
98+
'protected_to_private' => true,
99+
'return_type_declaration' => true,
100+
'set_type_to_cast' => true,
101+
'simplified_null_return' => true,
102+
'single_blank_line_at_eof' => true,
103+
'single_class_element_per_statement' => [
104+
'elements' => ['property'],
105+
],
106+
'single_import_per_statement' => true,
107+
'single_line_after_imports' => true,
108+
'switch_case_semicolon_to_colon' => true,
109+
'switch_case_space' => true,
110+
'ternary_to_null_coalescing' => true,
111+
'trailing_comma_in_multiline' => [
112+
'after_heredoc' => true,
113+
'elements' => [
114+
'arrays',
40115
],
41-
'braces' => true,
42-
'cast_spaces' => [
43-
'space' => 'single',
44-
],
45-
'class_definition' => true,
46-
'combine_consecutive_issets' => true,
47-
'combine_consecutive_unsets' => true,
48-
'compact_nullable_typehint' => true,
49-
'concat_space' => [
50-
'spacing' => 'one',
51-
],
52-
'declare_strict_types' => false,
53-
'dir_constant' => true,
54-
'function_to_constant' => true,
55-
'function_typehint_space' => true,
56-
'increment_style' => [
57-
'style' => 'post',
58-
],
59-
'is_null' => true,
60-
'linebreak_after_opening_tag' => true,
61-
'logical_operators' => true,
62-
'lowercase_cast' => true,
63-
'lowercase_static_reference' => true,
64-
'magic_constant_casing' => true,
65-
'method_argument_space' => [
66-
'on_multiline' => 'ensure_fully_multiline',
67-
],
68-
'method_chaining_indentation' => true,
69-
'modernize_types_casting' => true,
70-
'native_constant_invocation' => true,
71-
'native_function_casing' => true,
72-
'native_function_invocation' => true,
73-
'new_with_braces' => true,
74-
'no_alias_functions' => true,
75-
'no_blank_lines_after_class_opening' => true,
76-
'no_blank_lines_after_phpdoc' => true,
77-
'no_empty_phpdoc' => true,
78-
'no_empty_statement' => true,
79-
'no_extra_blank_lines' => true,
80-
'no_leading_import_slash' => true,
81-
'no_mixed_echo_print' => true,
82-
'no_multiline_whitespace_around_double_arrow' => true,
83-
'no_null_property_initialization' => true,
84-
'no_short_bool_cast' => true,
85-
'no_spaces_after_function_name' => true,
86-
'no_spaces_inside_parenthesis' => true,
87-
'no_superfluous_elseif' => true,
88-
'no_trailing_comma_in_singleline_array' => true,
89-
'no_trailing_whitespace' => true,
90-
'no_trailing_whitespace_in_comment' => true,
91-
'no_unneeded_control_parentheses' => true,
92-
'no_unused_imports' => true,
93-
'no_useless_else' => true,
94-
'no_useless_return' => true,
95-
'no_whitespace_before_comma_in_array' => true,
96-
'ordered_imports' => true,
97-
'phpdoc_align' => true,
98-
'phpdoc_scalar' => true,
99-
'protected_to_private' => true,
100-
'return_type_declaration' => true,
101-
'set_type_to_cast' => true,
102-
'simplified_null_return' => true,
103-
'single_blank_line_at_eof' => true,
104-
'single_class_element_per_statement' => [
105-
'elements' => ['property'],
106-
],
107-
'single_import_per_statement' => true,
108-
'single_line_after_imports' => true,
109-
'switch_case_semicolon_to_colon' => true,
110-
'switch_case_space' => true,
111-
'ternary_to_null_coalescing' => true,
112-
'trailing_comma_in_multiline' => [
113-
'after_heredoc' => true,
114-
'elements' => [
115-
'arrays',
116-
],
117-
],
118-
'visibility_required' => [
119-
'elements' => ['property', 'method', 'const'],
120-
],
121-
'yoda_style' => false,
122-
]
123-
)
116+
],
117+
'visibility_required' => [
118+
'elements' => ['property', 'method', 'const'],
119+
],
120+
'yoda_style' => false,
121+
])
124122
->setRiskyAllowed(true)
125123
->setFinder($finder);

UPGRADE-2.0.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ The below guide will assist in upgrading from the 1.x versions to 2.0.
55
## Package Requirements
66

77
- Laravel 10 or later
8-
- PHP 8.1 or later
8+
- PHP 8.2 or later
99

1010
## General Changes
1111

1212
- The default view is now the `breadcrumbs::tailwind` view
13+
- Removed support for `facade/ignition-contracts`

composer.json

+10-11
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,18 @@
77
"breadcrumb"
88
],
99
"require": {
10-
"php": "^8.1",
11-
"facade/ignition-contracts": "^1.0",
12-
"illuminate/collections": "^10.0 || ^11.0",
13-
"illuminate/events": "^10.0 || ^11.0",
14-
"illuminate/filesystem": "^10.0 || ^11.0",
15-
"illuminate/routing": "^10.0 || ^11.0",
16-
"illuminate/support": "^10.0 || ^11.0",
17-
"illuminate/view": "^10.0 || ^11.0"
10+
"php": "^8.2",
11+
"illuminate/collections": "^10.0 || ^11.0 || ^12.0",
12+
"illuminate/events": "^10.0 || ^11.0 || ^12.0",
13+
"illuminate/filesystem": "^10.0 || ^11.0 || ^12.0",
14+
"illuminate/routing": "^10.0 || ^11.0 || ^12.0",
15+
"illuminate/support": "^10.0 || ^11.0 || ^12.0",
16+
"illuminate/view": "^10.0 || ^11.0 || ^12.0"
1817
},
1918
"require-dev": {
20-
"laravel/framework": "^10.0 || ^11.0",
21-
"orchestra/testbench": "^8.0 || ^9.0",
22-
"phpunit/phpunit": "^10.0 || ^11.0",
19+
"laravel/framework": "^10.0 || ^11.0 || ^12.0",
20+
"orchestra/testbench": "^8.0 || ^9.0 || ^10.0",
21+
"phpunit/phpunit": "^10.5 || ^11.5",
2322
"spatie/phpunit-snapshot-assertions": "^5.0"
2423
},
2524
"autoload": {

src/BreadcrumbFileRegistrar.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,11 @@
99
*
1010
* @internal
1111
*/
12-
final class BreadcrumbFileRegistrar
12+
final readonly class BreadcrumbFileRegistrar
1313
{
1414
public function __construct(
15-
private readonly BreadcrumbsManager $breadcrumbs,
16-
) {
17-
}
15+
private BreadcrumbsManager $breadcrumbs,
16+
) {}
1817

1918
public function register(string $file): void
2019
{

src/BreadcrumbsGenerator.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ class BreadcrumbsGenerator implements BreadcrumbsGeneratorContract
2727
*/
2828
protected array $callbacks = [];
2929

30-
public function __construct(protected Dispatcher $dispatcher)
31-
{
32-
}
30+
public function __construct(protected Dispatcher $dispatcher) {}
3331

3432
/**
3533
* @param array<string, callable> $callbacks The registered breadcrumb-generating callbacks.

src/BreadcrumbsManager.php

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

33
namespace BabDev\Breadcrumbs;
44

5+
use BabDev\Breadcrumbs\Contracts\BreadcrumbsGenerator as BreadcrumbsGeneratorContract;
56
use BabDev\Breadcrumbs\Contracts\BreadcrumbsManager as BreadcrumbsManagerContract;
67
use BabDev\Breadcrumbs\Exceptions\DuplicateBreadcrumbException;
78
use BabDev\Breadcrumbs\Exceptions\InvalidBreadcrumbException;
@@ -35,15 +36,14 @@ class BreadcrumbsManager implements BreadcrumbsManagerContract
3536
protected $route;
3637

3738
public function __construct(
38-
protected BreadcrumbsGenerator $generator,
39+
protected BreadcrumbsGeneratorContract $generator,
3940
protected Router $router,
4041
protected ViewFactory $viewFactory,
41-
) {
42-
}
42+
) {}
4343

4444
/**
4545
* @param string $name The name of the page.
46-
* @param callable $callback The callback, which should accept a {@link BreadcrumbsGenerator} instance as the first parameter and may accept additional parameters.
46+
* @param callable $callback The callback, which should accept a {@link BreadcrumbsGeneratorContract} instance as the first parameter and may accept additional parameters.
4747
*
4848
* @throws DuplicateBreadcrumbException if the given name has already been used.
4949
*/

src/Events/AfterBreadcrumbGenerated.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,4 @@
22

33
namespace BabDev\Breadcrumbs\Events;
44

5-
class AfterBreadcrumbGenerated extends BreadcrumbGenerated
6-
{
7-
}
5+
class AfterBreadcrumbGenerated extends BreadcrumbGenerated {}

src/Events/BeforeBreadcrumbGenerated.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,4 @@
22

33
namespace BabDev\Breadcrumbs\Events;
44

5-
class BeforeBreadcrumbGenerated extends BreadcrumbGenerated
6-
{
7-
}
5+
class BeforeBreadcrumbGenerated extends BreadcrumbGenerated {}

src/Events/BreadcrumbGenerated.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,5 @@ public function __construct(
1010
public BreadcrumbsGenerator $breadcrumbs,
1111
public string $name,
1212
public array $params
13-
) {
14-
}
13+
) {}
1514
}

src/Exceptions/BreadcrumbsException.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,4 @@
55
/**
66
* Marker interface for all package exceptions
77
*/
8-
interface BreadcrumbsException extends \Throwable
9-
{
10-
}
8+
interface BreadcrumbsException extends \Throwable {}

0 commit comments

Comments
 (0)