Skip to content
This repository was archived by the owner on Mar 19, 2026. It is now read-only.

Commit 2cd504f

Browse files
committed
Merge branch 'main' of github.com:codebar-ag/laravel-prerender
2 parents 1f614de + 3470f47 commit 2cd504f

5 files changed

Lines changed: 20 additions & 8 deletions

File tree

.github/workflows/php-cs-fixer.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ jobs:
1111
uses: actions/checkout@v2
1212

1313
- name: Fix style
14-
uses: docker://oskarstark/php-cs-fixer-ga:2.18.6
14+
uses: docker://oskarstark/php-cs-fixer-ga:3.0.0
1515
with:
16-
args: --config=.php_cs --allow-risky=yes
16+
args: --config=.php-cs-fixer.dist.php --allow-risky=yes
1717

1818
- name: Extract branch name
1919
shell: bash

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ coverage
77
docs
88
vendor
99
.php_cs.cache
10+
.php-cs-fixer.cache
1011
coverage.xml

.php_cs renamed to .php-cs-fixer.dist.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,18 @@
66
__DIR__ . '/tests',
77
])
88
->name('*.php')
9+
->notName('*.blade.php')
910
->ignoreDotFiles(true)
1011
->ignoreVCS(true);
1112

12-
return PhpCsFixer\Config::create()
13+
return (new PhpCsFixer\Config())
1314
->setRules([
1415
'@PSR2' => true,
1516
'array_syntax' => ['syntax' => 'short'],
16-
'ordered_imports' => ['sortAlgorithm' => 'alpha'],
17+
'ordered_imports' => ['sort_algorithm' => 'alpha'],
1718
'no_unused_imports' => true,
1819
'not_operator_with_successor_space' => false,
19-
'trailing_comma_in_multiline_array' => true,
20+
'trailing_comma_in_multiline' => true,
2021
'phpdoc_scalar' => true,
2122
'unary_operator_spaces' => true,
2223
'binary_operator_spaces' => true,
@@ -28,6 +29,8 @@
2829
'method_argument_space' => [
2930
'on_multiline' => 'ensure_fully_multiline',
3031
'keep_multiple_spaces_after_comma' => true,
31-
]
32+
],
33+
'single_trait_insert_per_statement' => true,
34+
'single_quote' => true,
3235
])
3336
->setFinder($finder);

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"symfony/psr-http-message-bridge": "^1.3|^2.0"
3535
},
3636
"require-dev": {
37-
"friendsofphp/php-cs-fixer": "2.18.6",
37+
"friendsofphp/php-cs-fixer": "3.0.0",
3838
"orchestra/testbench": "^4.0|^5.0|^6.0",
3939
"phpunit/phpunit": "^8.4|^9.0"
4040
},
@@ -51,7 +51,7 @@
5151
"scripts": {
5252
"test": "vendor/bin/phpunit",
5353
"test-coverage": "vendor/bin/phpunit --coverage-html coverage",
54-
"format": "vendor/bin/php-cs-fixer fix --allow-risky=yes --config=.php_cs"
54+
"format": "vendor/bin/php-cs-fixer fix --allow-risky=yes --config=.php-cs-fixer.dist.php"
5555
},
5656
"config": {
5757
"sort-packages": true

tests/PrerenderMiddlewareTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ public function it_should_prerender_page_with_escaped_fragment_in_query_string()
3131
->assertSuccessful();
3232
}
3333

34+
/** @test */
35+
public function it_should_prerender_when_user_agent_is_part_of_crawler_user_agents()
36+
{
37+
$this->get('/test-middleware', ['User-Agent' => 'Googlebot/2.1 (+http://www.google.com/bot.html)',])
38+
->assertHeader('prerender.io-mock', true)
39+
->assertSuccessful();
40+
}
41+
3442
/** @test */
3543
public function it_should_prerender_page_with_url_in_whitelist()
3644
{

0 commit comments

Comments
 (0)