Skip to content

Commit a6a0b1b

Browse files
authored
Merge pull request #296 from thecodingmachine/newFalsy
FIX: updated the regexp to detect class_implements
2 parents 2b152d8 + 3cc28e5 commit a6a0b1b

36 files changed

+2235
-2192
lines changed

generated/array.php

-21
Original file line numberDiff line numberDiff line change
@@ -169,27 +169,6 @@ function array_walk_recursive(&$array, callable $callback, $arg = null): void
169169
}
170170

171171

172-
/**
173-
* This function implements a sort algorithm that orders alphanumeric strings
174-
* in the way a human being would while maintaining key/value associations.
175-
* This is described as a "natural ordering". An example of the difference
176-
* between this algorithm and the regular computer string sorting algorithms
177-
* (used in sort) can be seen in the example below.
178-
*
179-
* @param array $array The input array.
180-
* @throws ArrayException
181-
*
182-
*/
183-
function natsort(array &$array): void
184-
{
185-
error_clear_last();
186-
$result = \natsort($array);
187-
if ($result === false) {
188-
throw ArrayException::createFromPhpError();
189-
}
190-
}
191-
192-
193172
/**
194173
* This function shuffles (randomizes the order of the elements in) an array.
195174
* It uses a pseudo random number generator that is not suitable for

generated/curl.php

+151-4
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,151 @@ function curl_multi_init()
671671
}
672672

673673

674+
/**
675+
*
676+
*
677+
* @param resource $multi_handle
678+
* @param int $option One of the CURLMOPT_* constants.
679+
* @param mixed $value The value to be set on option.
680+
*
681+
* value should be an int for the
682+
* following values of the option parameter:
683+
*
684+
*
685+
*
686+
*
687+
* Option
688+
* Set value to
689+
*
690+
*
691+
*
692+
*
693+
* CURLMOPT_PIPELINING
694+
*
695+
* Pass 1 to enable or 0 to disable. Enabling pipelining on a multi
696+
* handle will make it attempt to perform HTTP Pipelining as far as
697+
* possible for transfers using this handle. This means that if you add
698+
* a second request that can use an already existing connection, the
699+
* second request will be "piped" on the same connection.
700+
* As of cURL 7.43.0, the value is a bitmask, and you can also pass 2 to try to multiplex the new
701+
* transfer over an existing HTTP/2 connection if possible.
702+
* Passing 3 instructs cURL to ask for pipelining and multiplexing
703+
* independently of each other.
704+
* As of cURL 7.62.0, setting the pipelining bit has no effect.
705+
* Instead of integer literals, you can also use the CURLPIPE_*
706+
* constants if available.
707+
*
708+
*
709+
*
710+
* CURLMOPT_MAXCONNECTS
711+
*
712+
* Pass a number that will be used as the maximum amount of
713+
* simultaneously open connections that libcurl may cache.
714+
* By default the size will be enlarged to fit four times the number
715+
* of handles added via curl_multi_add_handle.
716+
* When the cache is full, curl closes the oldest one in the cache
717+
* to prevent the number of open connections from increasing.
718+
*
719+
*
720+
*
721+
* CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE
722+
*
723+
* Pass a number that specifies the chunk length threshold for pipelining
724+
* in bytes.
725+
*
726+
*
727+
*
728+
* CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE
729+
*
730+
* Pass a number that specifies the size threshold for pipelining
731+
* penalty in bytes.
732+
*
733+
*
734+
*
735+
* CURLMOPT_MAX_HOST_CONNECTIONS
736+
*
737+
* Pass a number that specifies the maximum number of connections to a
738+
* single host.
739+
*
740+
*
741+
*
742+
* CURLMOPT_MAX_PIPELINE_LENGTH
743+
*
744+
* Pass a number that specifies the maximum number of requests in a
745+
* pipeline.
746+
*
747+
*
748+
*
749+
* CURLMOPT_MAX_TOTAL_CONNECTIONS
750+
*
751+
* Pass a number that specifies the maximum number of simultaneously
752+
* open connections.
753+
*
754+
*
755+
*
756+
* CURLMOPT_PUSHFUNCTION
757+
*
758+
* Pass a callable that will be registered to handle server
759+
* pushes and should have the following signature:
760+
*
761+
* intpushfunction
762+
* resourceparent_ch
763+
* resourcepushed_ch
764+
* arrayheaders
765+
*
766+
*
767+
*
768+
* parent_ch
769+
*
770+
*
771+
* The parent cURL handle (the request the client made).
772+
*
773+
*
774+
*
775+
*
776+
* pushed_ch
777+
*
778+
*
779+
* A new cURL handle for the pushed request.
780+
*
781+
*
782+
*
783+
*
784+
* headers
785+
*
786+
*
787+
* The push promise headers.
788+
*
789+
*
790+
*
791+
*
792+
* The push function is supposed to return either
793+
* CURL_PUSH_OK if it can handle the push, or
794+
* CURL_PUSH_DENY to reject it.
795+
*
796+
*
797+
*
798+
*
799+
*
800+
*
801+
* The parent cURL handle (the request the client made).
802+
*
803+
* A new cURL handle for the pushed request.
804+
*
805+
* The push promise headers.
806+
* @throws CurlException
807+
*
808+
*/
809+
function curl_multi_setopt($multi_handle, int $option, $value): void
810+
{
811+
error_clear_last();
812+
$result = \curl_multi_setopt($multi_handle, $option, $value);
813+
if ($result === false) {
814+
throw CurlException::createFromPhpError();
815+
}
816+
}
817+
818+
674819
/**
675820
* Sets an option on the given cURL session handle.
676821
*
@@ -1780,10 +1925,13 @@ function curl_multi_init()
17801925
* a "304 Not Modified" header will be returned
17811926
* assuming CURLOPT_HEADER is TRUE.
17821927
* Use CURL_TIMECOND_IFUNMODSINCE for the reverse
1783-
* effect. CURL_TIMECOND_IFMODSINCE is the
1784-
* default.
1928+
* effect. Use CURL_TIMECOND_NONE to ignore
1929+
* CURLOPT_TIMEVALUE and always return the page.
1930+
* CURL_TIMECOND_NONE is the default.
17851931
*
17861932
*
1933+
* Before cURL 7.46.0 the default was
1934+
* CURL_TIMECOND_IFMODSINCE.
17871935
*
17881936
*
17891937
*
@@ -1812,8 +1960,7 @@ function curl_multi_init()
18121960
* CURLOPT_TIMEVALUE
18131961
*
18141962
* The time in seconds since January 1st, 1970. The time will be used
1815-
* by CURLOPT_TIMECONDITION. By default,
1816-
* CURL_TIMECOND_IFMODSINCE is used.
1963+
* by CURLOPT_TIMECONDITION.
18171964
*
18181965
*
18191966
*

generated/dir.php

+4-32
Original file line numberDiff line numberDiff line change
@@ -77,49 +77,21 @@ function getcwd(): string
7777
* closedir, readdir, and
7878
* rewinddir calls.
7979
*
80-
* @param string $path The directory path that is to be opened
80+
* @param string $directory The directory path that is to be opened
8181
* @param resource $context For a description of the context parameter,
8282
* refer to the streams section of
8383
* the manual.
8484
* @return resource Returns a directory handle resource on success
8585
* @throws DirException
8686
*
8787
*/
88-
function opendir(string $path, $context = null)
88+
function opendir(string $directory, $context = null)
8989
{
9090
error_clear_last();
9191
if ($context !== null) {
92-
$result = \opendir($path, $context);
92+
$result = \opendir($directory, $context);
9393
} else {
94-
$result = \opendir($path);
95-
}
96-
if ($result === false) {
97-
throw DirException::createFromPhpError();
98-
}
99-
return $result;
100-
}
101-
102-
103-
/**
104-
* Resets the directory stream indicated by
105-
* dir_handle to the beginning of the
106-
* directory.
107-
*
108-
* @param resource $dir_handle The directory handle resource previously opened
109-
* with opendir. If the directory handle is
110-
* not specified, the last link opened by opendir
111-
* is assumed.
112-
* @return null Returns NULL on success.
113-
* @throws DirException
114-
*
115-
*/
116-
function rewinddir($dir_handle = null)
117-
{
118-
error_clear_last();
119-
if ($dir_handle !== null) {
120-
$result = \rewinddir($dir_handle);
121-
} else {
122-
$result = \rewinddir();
94+
$result = \opendir($directory);
12395
}
12496
if ($result === false) {
12597
throw DirException::createFromPhpError();

generated/dom.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* as a native DOMElement node.
1212
*
1313
* @param \SimpleXMLElement $node The SimpleXMLElement node.
14-
* @return \DOMElement The DOMElement node added.
14+
* @return \DOMElement|false The DOMElement node added.
1515
* @throws DomException
1616
*
1717
*/

generated/exec.php

+3-96
Original file line numberDiff line numberDiff line change
@@ -43,99 +43,6 @@ function exec(string $command, ?array &$output = null, ?int &$result_code = null
4343
}
4444

4545

46-
/**
47-
* proc_get_status fetches data about a
48-
* process opened using proc_open.
49-
*
50-
* @param resource $process The proc_open resource that will
51-
* be evaluated.
52-
* @return array{command: string, pid: int, running: bool, signaled: bool, stopped: bool, exitcode: int, termsig: int, stopsig: int} An array of collected information on success. The returned array contains the following elements:
53-
*
54-
*
55-
*
56-
*
57-
* elementtypedescription
58-
*
59-
*
60-
*
61-
* command
62-
* string
63-
*
64-
* The command string that was passed to proc_open.
65-
*
66-
*
67-
*
68-
* pid
69-
* int
70-
* process id
71-
*
72-
*
73-
* running
74-
* bool
75-
*
76-
* TRUE if the process is still running, FALSE if it has
77-
* terminated.
78-
*
79-
*
80-
*
81-
* signaled
82-
* bool
83-
*
84-
* TRUE if the child process has been terminated by
85-
* an uncaught signal. Always set to FALSE on Windows.
86-
*
87-
*
88-
*
89-
* stopped
90-
* bool
91-
*
92-
* TRUE if the child process has been stopped by a
93-
* signal. Always set to FALSE on Windows.
94-
*
95-
*
96-
*
97-
* exitcode
98-
* int
99-
*
100-
* The exit code returned by the process (which is only
101-
* meaningful if running is FALSE).
102-
* Only first call of this function return real value, next calls return
103-
* -1.
104-
*
105-
*
106-
*
107-
* termsig
108-
* int
109-
*
110-
* The number of the signal that caused the child process to terminate
111-
* its execution (only meaningful if signaled is TRUE).
112-
*
113-
*
114-
*
115-
* stopsig
116-
* int
117-
*
118-
* The number of the signal that caused the child process to stop its
119-
* execution (only meaningful if stopped is TRUE).
120-
*
121-
*
122-
*
123-
*
124-
*
125-
* @throws ExecException
126-
*
127-
*/
128-
function proc_get_status($process): array
129-
{
130-
error_clear_last();
131-
$result = \proc_get_status($process);
132-
if ($result === false) {
133-
throw ExecException::createFromPhpError();
134-
}
135-
return $result;
136-
}
137-
138-
13946
/**
14047
* proc_nice changes the priority of the current
14148
* process by the amount specified in priority. A
@@ -169,16 +76,16 @@ function proc_nice(int $priority): void
16976
/**
17077
* This function is identical to the backtick operator.
17178
*
172-
* @param string $cmd The command that will be executed.
79+
* @param string $command The command that will be executed.
17380
* @return string A string containing the output from the executed command, FALSE if the pipe
17481
* cannot be established or NULL if an error occurs or the command produces no output.
17582
* @throws ExecException
17683
*
17784
*/
178-
function shell_exec(string $cmd): string
85+
function shell_exec(string $command): string
17986
{
18087
error_clear_last();
181-
$result = \shell_exec($cmd);
88+
$result = \shell_exec($command);
18289
if ($result === null) {
18390
throw ExecException::createFromPhpError();
18491
}

0 commit comments

Comments
 (0)