Make all links relative
Now the abs_to_rel module is enabled, links can be made relative so they work on the current environment.
This commit is contained in:
parent
0d359f81d6
commit
7a7dc297ca
349 changed files with 698 additions and 698 deletions
|
@ -82,9 +82,9 @@
|
|||
],
|
||||
"body": [
|
||||
{
|
||||
"value": "\n <p>Since PHP 8.1, properties on PHP classes have been able to be marked as <code>readonly<\/code>.<\/p>\n\n<p>Once they've been set, they can't be changed or overwritten.<\/p>\n\n<p>This is great for data transfer objects (DTOs) that you want to be immutable and know the values are the same as when they were set.<\/p>\n\n<p>Here's an example:<\/p>\n\n<pre><code class=\"php\">class MyDto {\n\n public function __construct(\n public readonly string $name,\n public readonly int $age,\n ) {\n }\n\n}\n<\/code><\/pre>\n\n<p>I don't need to make the properties private or protected and write getter methods for them.<\/p>\n\n<p>I can make them public, knowing the values can't be changed.<\/p>\n\n<h2 id=\"readonly-classes\">readonly classes<\/h2>\n\n<p>Since PHP 8.2, the entire class can be <code>readonly<\/code>, making the code cleaner and easier to read.<\/p>\n\n<p>This class does the same as the previous example:<\/p>\n\n<pre><code class=\"php\">readonly class MyDto {\n\n public function __construct(\n public string $name,\n public int $age,\n ) {\n }\n\n}\n<\/code><\/pre>\n\n<h2 id=\"here%27s-the-thing\">Here's the thing<\/h2>\n\n<p>This is a great example of how the PHP language continues to evolve and improve, and it's been a great way to make it easier to keep my code clean and with fewer bugs.<\/p>\n\n<p>If you want a way to easily add <code>readonly<\/code> to properties or classes, <a href=\"https:\/\/www.oliverdavies.uk\/daily\/2025\/01\/31\/rector\">take a look at Rector<\/a> which can automate it for you.<\/p>\n\n ",
|
||||
"value": "\n <p>Since PHP 8.1, properties on PHP classes have been able to be marked as <code>readonly<\/code>.<\/p>\n\n<p>Once they've been set, they can't be changed or overwritten.<\/p>\n\n<p>This is great for data transfer objects (DTOs) that you want to be immutable and know the values are the same as when they were set.<\/p>\n\n<p>Here's an example:<\/p>\n\n<pre><code class=\"php\">class MyDto {\n\n public function __construct(\n public readonly string $name,\n public readonly int $age,\n ) {\n }\n\n}\n<\/code><\/pre>\n\n<p>I don't need to make the properties private or protected and write getter methods for them.<\/p>\n\n<p>I can make them public, knowing the values can't be changed.<\/p>\n\n<h2 id=\"readonly-classes\">readonly classes<\/h2>\n\n<p>Since PHP 8.2, the entire class can be <code>readonly<\/code>, making the code cleaner and easier to read.<\/p>\n\n<p>This class does the same as the previous example:<\/p>\n\n<pre><code class=\"php\">readonly class MyDto {\n\n public function __construct(\n public string $name,\n public int $age,\n ) {\n }\n\n}\n<\/code><\/pre>\n\n<h2 id=\"here%27s-the-thing\">Here's the thing<\/h2>\n\n<p>This is a great example of how the PHP language continues to evolve and improve, and it's been a great way to make it easier to keep my code clean and with fewer bugs.<\/p>\n\n<p>If you want a way to easily add <code>readonly<\/code> to properties or classes, <a href=\"/daily\/2025\/01\/31\/rector\">take a look at Rector<\/a> which can automate it for you.<\/p>\n\n ",
|
||||
"format": "full_html",
|
||||
"processed": "\n <p>Since PHP 8.1, properties on PHP classes have been able to be marked as <code>readonly<\/code>.<\/p>\n\n<p>Once they've been set, they can't be changed or overwritten.<\/p>\n\n<p>This is great for data transfer objects (DTOs) that you want to be immutable and know the values are the same as when they were set.<\/p>\n\n<p>Here's an example:<\/p>\n\n<pre><code class=\"php\">class MyDto {\n\n public function __construct(\n public readonly string $name,\n public readonly int $age,\n ) {\n }\n\n}\n<\/code><\/pre>\n\n<p>I don't need to make the properties private or protected and write getter methods for them.<\/p>\n\n<p>I can make them public, knowing the values can't be changed.<\/p>\n\n<h2 id=\"readonly-classes\">readonly classes<\/h2>\n\n<p>Since PHP 8.2, the entire class can be <code>readonly<\/code>, making the code cleaner and easier to read.<\/p>\n\n<p>This class does the same as the previous example:<\/p>\n\n<pre><code class=\"php\">readonly class MyDto {\n\n public function __construct(\n public string $name,\n public int $age,\n ) {\n }\n\n}\n<\/code><\/pre>\n\n<h2 id=\"here%27s-the-thing\">Here's the thing<\/h2>\n\n<p>This is a great example of how the PHP language continues to evolve and improve, and it's been a great way to make it easier to keep my code clean and with fewer bugs.<\/p>\n\n<p>If you want a way to easily add <code>readonly<\/code> to properties or classes, <a href=\"https:\/\/www.oliverdavies.uk\/daily\/2025\/01\/31\/rector\">take a look at Rector<\/a> which can automate it for you.<\/p>\n\n ",
|
||||
"processed": "\n <p>Since PHP 8.1, properties on PHP classes have been able to be marked as <code>readonly<\/code>.<\/p>\n\n<p>Once they've been set, they can't be changed or overwritten.<\/p>\n\n<p>This is great for data transfer objects (DTOs) that you want to be immutable and know the values are the same as when they were set.<\/p>\n\n<p>Here's an example:<\/p>\n\n<pre><code class=\"php\">class MyDto {\n\n public function __construct(\n public readonly string $name,\n public readonly int $age,\n ) {\n }\n\n}\n<\/code><\/pre>\n\n<p>I don't need to make the properties private or protected and write getter methods for them.<\/p>\n\n<p>I can make them public, knowing the values can't be changed.<\/p>\n\n<h2 id=\"readonly-classes\">readonly classes<\/h2>\n\n<p>Since PHP 8.2, the entire class can be <code>readonly<\/code>, making the code cleaner and easier to read.<\/p>\n\n<p>This class does the same as the previous example:<\/p>\n\n<pre><code class=\"php\">readonly class MyDto {\n\n public function __construct(\n public string $name,\n public int $age,\n ) {\n }\n\n}\n<\/code><\/pre>\n\n<h2 id=\"here%27s-the-thing\">Here's the thing<\/h2>\n\n<p>This is a great example of how the PHP language continues to evolve and improve, and it's been a great way to make it easier to keep my code clean and with fewer bugs.<\/p>\n\n<p>If you want a way to easily add <code>readonly<\/code> to properties or classes, <a href=\"/daily\/2025\/01\/31\/rector\">take a look at Rector<\/a> which can automate it for you.<\/p>\n\n ",
|
||||
"summary": null
|
||||
}
|
||||
],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue