Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22

- uses: pnpm/action-setup@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v22.13.1
v22.22.3
15 changes: 15 additions & 0 deletions blog/2026-03-26-rad-method-sections.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: "RAD Docs: Method-Level API and Doctrine Sections"
authors: [jannik]
tags: [rad, symfony]
---

The RAD bundle docs were expanded with explicit method-level sections for `ApiResponse` and `DoctrineChangeChecker`.

## Updated Pages

- [API Response][1]: added dedicated sections for `withError()`, `isOk()`, `error()`, and deprecation guidance for `withStatusCode()`.
- [Doctrine][2]: added `getEntityChanges()` usage, return structure examples, and field redaction examples.

[1]: /docs/php/symfony/rad/api-response
[2]: /docs/php/symfony/rad/doctrine
10 changes: 10 additions & 0 deletions blog/2026-05-27-rad-translation-helper.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: "RAD: Translation Helper"
authors: [jannik]
tags: [rad, symfony]
---

The RAD bundle now has a `TranslationHelper`, that is [already documented].


[already documented]: /docs/php/symfony/rad/translations
32 changes: 31 additions & 1 deletion docs/php/symfony/rad/api-response.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,41 @@ Returning an error can look like this:
return (new ApiResponse(422, [
"formErrors" => ...,
]))
->withStatusCode("invalid-request");
->withError("invalid-request", "user readable error message");
```

An error response can also return `data`, like proper error messages, form errors, etc

:::tip
The `ok` parameter will be automatically determined by whether the status code is a 2xx success code.
:::

## Methods

### `withError()`

Sets the machine-readable error key (`error`) and an optional user-readable message (`errorMessage`).

```php
return (new ApiResponse(422, [
"formErrors" => $this->normalizeFormErrors($form),
]))
->withError("invalid-form", "Please check the form fields.");
```

### `isOk()`

Returns whether the response status code is in the `2xx` range.

```php
$response = new ApiResponse(204);
$isSuccess = $response->isOk(); // true
```

### `error()`

Static shortcut to create an error response with an error key and optional status code.

```php
return ApiResponse::error("not-found", 404);
```
21 changes: 21 additions & 0 deletions docs/php/symfony/rad/translations.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Translations

## TranslationHelper

The `TranslationHelper` helps to resolve typical configurable translation use cases. In these cases you normally want to

- pass a `string` to use as-is
- pass a `TranslatableInterface` to automatically translate the value

This can be done with the translation helper:

```php
function example (TranslationHelper $helper)
{
// resolve the value as described above
$helper->resolve($value, $locale);

// same method as TranslatorInterface
$helper->trans($key, $parameter, $domain, $locale);
}
```
9 changes: 7 additions & 2 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,18 @@ const config = {
url: 'https://21torr-docs.pages.dev/',
baseUrl: '/',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'throw',
favicon: 'img/favicon.ico',

plugins: [
'docusaurus-plugin-sass',
],

markdown: {
hooks: {
onBrokenMarkdownLinks: 'throw',
},
},

// Even if you don't use internalization, you can use this field to set useful
// metadata like html lang. For example, if your site is Chinese, you may want
// to replace "en" with "zh-Hans".
Expand All @@ -31,7 +36,7 @@ const config = {
// disable for now, as it breaks the build
useCssCascadeLayers: false,
},
experimental_faster: true,
faster: true,
},

presets: [
Expand Down
19 changes: 7 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
"write-translations": "docusaurus write-translations"
},
"dependencies": {
"@docusaurus/core": "^3.8.1",
"@docusaurus/faster": "^3.8.1",
"@docusaurus/preset-classic": "^3.8.1",
"@docusaurus/theme-classic": "^3.8.1",
"@docusaurus/core": "^3.10.1",
"@docusaurus/faster": "^3.10.1",
"@docusaurus/preset-classic": "^3.10.1",
"@docusaurus/theme-classic": "^3.10.1",
"@iconify/react": "^6.0.0",
"@mdx-js/react": "^3.1.0",
"clsx": "^2.1.1",
Expand All @@ -24,8 +24,8 @@
"react-dom": "^19.1.0"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "3.8.1",
"@docusaurus/types": "^3.8.1",
"@docusaurus/module-type-aliases": "3.10.1",
"@docusaurus/types": "^3.10.1",
"@tsconfig/docusaurus": "^2.0.3",
"@types/node": "^22.15.29",
"@types/react": "^19.1.6",
Expand All @@ -39,7 +39,7 @@
"typescript-plugin-css-modules": "^5.1.0"
},
"engines": {
"node": ">= 20"
"node": ">= 22"
},
"browserslist": {
"production": [
Expand All @@ -52,10 +52,5 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"pnpm": {
"onlyBuiltDependencies": [
"@swc/core"
]
}
}
Loading
Loading