[DOC-CVS] [doc-en] master: accept.xml Fix typo, unbreak tag, CS

[email protected] (Mikhail Alferov via Jakub Vrána)
Newsgroups php.doc.cvs
Message-ID <[email protected]>
Author: Mikhail Alferov (mmalferov)
Committer: Jakub Vrána (vrana)
Date: 2025-04-28T14:54:51+02:00

Commit: https://github.com/php/doc-en/commit/85d72c5380a0b292f85236fec0d5e6d690a46c30
Raw diff: https://github.com/php/doc-en/commit/85d72c5380a0b292f85236fec0d5e6d690a46c30.diff

accept.xml Fix typo, unbreak tag, CS

Changed paths:
  M  reference/event/eventhttp/accept.xml


Diff:

diff --git a/reference/event/eventhttp/accept.xml b/reference/event/eventhttp/accept.xml
index 3d3c01776515..2662c5bbb11e 100644
--- a/reference/event/eventhttp/accept.xml
+++ b/reference/event/eventhttp/accept.xml
@@ -28,9 +28,8 @@
     To bind a socket,
     <literal>listen</literal>,
     and
-    <literal>
-     accept</literal>
-    connections on the socket in s single call use
+    <literal>accept</literal>
+    connections on the socket in a single call use
     <methodname>EventHttp::bind</methodname>.
     <methodname>EventHttp::accept</methodname>
     is needed only if one already has a socket ready to accept connections.
@@ -67,13 +66,14 @@
    <programlisting role="php">
 <![CDATA[
 <?php
+
 $base = new EventBase();
 $http = new EventHttp($base);
 
-$addresses = array (
-     8091 => "127.0.0.1",
-     8092 => "127.0.0.2",
-);
+$addresses = [
+    8091 => "127.0.0.1",
+    8092 => "127.0.0.2",
+];
 $i = 0;
 
 $socket = array();
@@ -81,9 +81,11 @@ $socket = array();
 foreach ($addresses as $port => $ip) {
     echo $ip, " ", $port, PHP_EOL;
     $socket[$i] = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
+
     if (!socket_bind($socket[$i], $ip, $port)) {
         exit("socket_bind failed\n");
     }
+
     socket_listen($socket[$i], 0);
     socket_set_nonblock($socket[$i]);
 
@@ -95,14 +97,14 @@ foreach ($addresses as $port => $ip) {
     ++$i;
 }
 
-$http->setCallback("/some-page", function() {
- echo "(some-page)\n";
+$http->setCallback("/some-page", function () {
+    echo "(some-page)\n";
     echo "URI: ", $req->getUri(), PHP_EOL;
     $req->sendReply(200, "OK");
     echo "OK\n";
 });
 
-$http->setDefaultCallback(function($req) {
+$http->setDefaultCallback(function ($req) {
     echo "URI: ", $req->getUri(), PHP_EOL;
     $req->sendReply(200, "OK");
     echo "OK\n";
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.