Skip to content

Commit 7301dd8

Browse files
saundefinedTimWolla
andcommitted
Apply suggestions from code review
Co-authored-by: Tim Düsterhus <tim@bastelstu.be>
1 parent b655856 commit 7301dd8

2 files changed

Lines changed: 10 additions & 9 deletions

File tree

releases/8.5/languages/en.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
'fcc_in_const_expr_title' => 'First Class Callables in constant expressions',
1717
'curl_share_persistence_improvement_title' => 'Persistent cURL share handle improvement',
1818
'array_first_last_title' => 'New <code>array_first()</code> and <code>array_last()</code> functions',
19-
'deprecated_traits_title' => '',
2019

2120
'new_classes_title' => 'New Classes, Interfaces, and Functions',
2221

releases/8.5/release.inc

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,14 @@ PHP
8888
<div class="php8-code phpcode">
8989
<?php highlight_php_trimmed(
9090
<<<'PHP'
91-
final readonly class PhpVersion {
91+
final readonly class PhpVersion
92+
{
9293
public function __construct(
9394
public string $version = 'PHP 8.4',
9495
) {}
9596
96-
public function withVersion(string $version) {
97+
public function withVersion(string $version): self
98+
{
9799
$newObject = clone $this;
98100
$newObject->version = $version;
99101
@@ -119,12 +121,14 @@ PHP
119121
<div class="php8-code phpcode" style="display: table-cell;">
120122
<?php highlight_php_trimmed(
121123
<<<'PHP'
122-
final readonly class PhpVersion {
124+
final readonly class PhpVersion
125+
{
123126
public function __construct(
124127
public string $version = 'PHP 8.4',
125128
) {}
126129
127-
public function withVersion(string $version) {
130+
public function withVersion(string $version): self
131+
{
128132
return clone($this, [
129133
'version' => $version,
130134
]);
@@ -186,8 +190,8 @@ $input = ' Some kind of string. ';
186190
187191
$output = $input
188192
|> trim(...)
189-
|> (fn (string $string) => str_replace(' ', '-', $string))
190-
|> (fn (string $string) => str_replace(['.', '/', '…'], '', $string))
193+
|> (fn($string) => str_replace(' ', '-', $string))
194+
|> (fn($string) => str_replace(['.', '/', '…'], '', $string))
191195
|> strtolower(...);
192196
193197
var_dump($output);
@@ -339,8 +343,6 @@ curl_exec($ch1);
339343
$ch2 = curl_init('https://thephp.foundation/');
340344
curl_setopt($ch2, CURLOPT_SHARE, $sh);
341345
curl_exec($ch2);
342-
343-
curl_share_close($sh);
344346
PHP
345347

346348
); ?>

0 commit comments

Comments
 (0)