Skip to content

Commit af63f1c

Browse files
authored
Merge branch 'main' into try-rector-dev-main
2 parents a8bdbc5 + a1679a1 commit af63f1c

File tree

21 files changed

+134
-34
lines changed

21 files changed

+134
-34
lines changed

CHANGELOG.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,26 @@
22

33
All notable changes to this project will be documented in this file.
44

5-
## [2.3.3](https://github.com/tempestphp/tempest-framework/compare/v2.3.2..2.3.3) — 2025-10-09
5+
## [2.4.0](https://github.com/tempestphp/tempest-framework/compare/v2.3.3..2.4.0) — 2025-10-22
6+
7+
### 🚨 Breaking changes
8+
9+
- **http**: [**breaking**] add `--crawl` flag to `static:generate` command (#1656) ([fee1230](https://github.com/tempestphp/tempest-framework/commit/fee1230971fed3cc7ec1836fe29c89f5d32a87b5))
10+
11+
### 🚀 Features
12+
13+
- **http**: add accepts helper method (#1638) ([b61d352](https://github.com/tempestphp/tempest-framework/commit/b61d352e9842fc5a4bcd5aef7ec93ae63bba8a6b))
14+
- **intl**: add `current_locale` util (#1643) ([1dab1c7](https://github.com/tempestphp/tempest-framework/commit/1dab1c7e6629725e81f40e13aefd6dbcf81302ff))
15+
16+
### 🐛 Bug fixes
17+
18+
- **auth**: invalid key file arguments for Apple OAuth provider (#1640) ([bf476c0](https://github.com/tempestphp/tempest-framework/commit/bf476c00ac80e6b2ef6abbbfbd2159f180d3bb33))
19+
- **http**: desrialize csrf token from headers (#1616) ([d1ee721](https://github.com/tempestphp/tempest-framework/commit/d1ee7211e9dd457350fc9d22819e09de22beafff))
20+
- **reflection**: return null for method return type if not defined (#1645) ([b3acd5f](https://github.com/tempestphp/tempest-framework/commit/b3acd5f4cf6195ab9047a1b8ca21b8b50d4cddb1))
21+
- **view**: handle boolean attribute followed by non space whitespace or self-closing tags (#1632) ([cd226a3](https://github.com/tempestphp/tempest-framework/commit/cd226a3d9ad99875cf2bc707b2e8e5820f739c0a))
22+
23+
24+
## [2.3.3](https://github.com/tempestphp/tempest-framework/compare/v2.3.2..v2.3.3) — 2025-10-09
625

726
### 🚀 Features
827

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
"nette/php-generator": "^4.1.6",
2626
"nikic/php-parser": "^5.3",
2727
"php": "^8.4",
28-
"psr-discovery/http-client-implementations": "^1.2",
29-
"psr-discovery/http-factory-implementations": "^1.4",
28+
"psr-discovery/http-client-implementations": "^1.4",
29+
"psr-discovery/http-factory-implementations": "^1.2",
3030
"psr/cache": "^3.0",
3131
"psr/clock": "^1.0.0",
3232
"psr/http-client": "^1.0.0",

docs/2-features/13-static-pages.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,20 @@ The only thing left to do is to generate the static pages:
111111
<comment>…</comment>
112112
```
113113

114+
## Crawling for dead links
115+
116+
Optionally, you can instruct the static generate to crawl your pages to scan for dead links. This is done by passing the `--crawl` option to the `static:generate` command:
117+
118+
```console
119+
<dim>./tempest static:generate --crawl</dim>
120+
```
121+
122+
By default, the crawler will only check for internal dead links. If you want to check for external links as well, you can pass the `--external` option:
123+
124+
```console
125+
<dim>./tempest static:generate --crawl --external</dim>
126+
```
127+
114128
## Production
115129

116130
Static pages are generated in the `/public` directory, as `index.html` files. Most web servers will automatically serve these static pages for you without any additional setup.

packages/core/src/Kernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
interface Kernel
1010
{
11-
public const string VERSION = '2.3.3';
11+
public const string VERSION = '2.4.0';
1212

1313
public string $root {
1414
get;

packages/datetime/src/DateTimeConvenienceMethods.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,7 @@ public function isEndOfWeek(): bool
922922
*
923923
* @param null|FormatPattern|string $pattern Optional custom format pattern for the date and time. If null, uses a default pattern.
924924
* @param null|Timezone $timezone Optional timezone for formatting. If null, uses the current timezone.
925-
* @param null|Locale $locale Optional locale for formatting. If null, uses the system's default locale.
925+
* @param null|Locale $locale Optional locale for formatting. If null, uses the configured locale or system default as fallback.
926926
*
927927
* @return string The formatted date and time string, according to the specified pattern, timezone, and locale.
928928
*
@@ -992,7 +992,7 @@ public function toRfc3339(?SecondsStyle $secondsStyle = null, bool $useZ = false
992992
* @param null|DateStyle $dateStyle Optional style for the date portion of the output. If null, a default style is used.
993993
* @param null|TimeStyle $timeStyle Optional style for the time portion of the output. If null, a default style is used.
994994
* @param null|Timezone $timezone Optional timezone for formatting. If null, uses the current timezone.
995-
* @param null|Locale $locale Optional locale for formatting. If null, uses the system's default locale.
995+
* @param null|Locale $locale Optional locale for formatting. If null, uses the configured locale or system default as fallback.
996996
*
997997
* @return string The string representation of the date and time, formatted according to the specified styles, timezone, and locale.
998998
*

packages/datetime/src/functions.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
use function hrtime;
1818
use function microtime;
19+
use function Tempest\Intl\current_locale;
1920

2021
use const Tempest\DateTime\NANOSECONDS_PER_SECOND;
2122

@@ -94,7 +95,7 @@ function create_intl_date_formatter(
9495

9596
$dateStyle ??= DateStyle::default();
9697
$timeStyle ??= TimeStyle::default();
97-
$locale ??= Locale::default();
98+
$locale ??= current_locale();
9899
$timezone ??= Timezone::default();
99100

100101
return new IntlDateFormatter(

packages/http/src/IsRequest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
use Tempest\Validation\SkipValidation;
1010

1111
use function Tempest\get;
12-
use function Tempest\Support\Arr\every;
1312
use function Tempest\Support\Arr\get_by_key;
1413
use function Tempest\Support\Arr\has_key;
1514
use function Tempest\Support\str;

packages/http/src/Session/VerifyCsrfMiddleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#[Priority(Priority::FRAMEWORK)]
2424
final readonly class VerifyCsrfMiddleware implements HttpMiddleware
2525
{
26-
public const string CSRF_COOKIE_KEY = 'xsrf-token';
26+
public const string CSRF_COOKIE_KEY = 'XSRF-TOKEN';
2727
public const string CSRF_HEADER_KEY = 'x-xsrf-token';
2828

2929
public function __construct(

packages/intl/src/functions.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Countable;
66
use Stringable;
7+
use Tempest\Container\GenericContainer;
78
use Tempest\Intl\Locale;
89
use Tempest\Intl\Pluralizer\Pluralizer;
910
use Tempest\Intl\Translator;
@@ -57,3 +58,13 @@ function pluralize_last_word(Stringable|string $value, int|array|Countable $coun
5758
{
5859
return get(Pluralizer::class)->pluralizeLastWord($value, $count);
5960
}
61+
62+
/**
63+
* Returns the configured locale from the container, or the system default if not configured.
64+
*/
65+
function current_locale(): Locale
66+
{
67+
return GenericContainer::instance()?->has(IntlConfig::class)
68+
? GenericContainer::instance()->get(IntlConfig::class)->currentLocale
69+
: Locale::default();
70+
}

packages/intl/tests/FormatterTest.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function test_format_datetime_function_and_parameters(): void
5656
$this->markTestSkipped('`tempest/datetime` is needed for this test.');
5757
}
5858

59-
$formatter = new MessageFormatter([new DateTimeFunction()]);
59+
$formatter = new MessageFormatter([$this->createDateTimeFunction()]);
6060

6161
$value = $formatter->format(<<<'TXT'
6262
Today is {$today :datetime pattern=|yyyy/MM/dd|}.
@@ -367,7 +367,7 @@ public function test_multiple_selectors(): void
367367
{
368368
$formatter = new MessageFormatter([
369369
$this->createNumberFunction(),
370-
new DateTimeFunction(),
370+
$this->createDateTimeFunction(),
371371
]);
372372

373373
$value = $formatter->format(<<<'TXT'
@@ -417,4 +417,11 @@ private function createNumberFunction(): NumberFunction
417417
new IntlConfig(Locale::default(), Locale::default()),
418418
);
419419
}
420+
421+
private function createDateTimeFunction(): DateTimeFunction
422+
{
423+
return new DateTimeFunction(
424+
new IntlConfig(Locale::default(), Locale::default()),
425+
);
426+
}
420427
}

0 commit comments

Comments
 (0)