Function __global->remove_code
Definitions
sources/override_api.php
- Remove some code from a function in the given code snippet.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: bool
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| &$code | string | Yes | No | required parameter | N/A | N/A | The code |
| $function | string | No | No | required parameter | N/A | N/A | Name of the function |
| $command | string | No | No | required parameter | N/A | N/A | The command we're searching to insert by |
| $instance_of_command | integer | No | No | 1 | N/A | N/A | We remove the nth instance of this command |
| $fail_ok | boolean | No | No | False | N/A | N/A | Whether a failure should attach a message (false: a failure should cause a critical error) |
Returns
- Success status
- Type: boolean
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Remove some code from a function in the given code snippet.
*
* @param string $code The code
* @param string $function Name of the function
* @param string $command The command we're searching to insert by
* @param integer $instance_of_command We remove the nth instance of this command
* @param boolean $fail_ok Whether a failure should attach a message (false: a failure should cause a critical error)
* @return boolean Success status
*/
function remove_code(string &$code, string $function, string $command, int $instance_of_command = 1, bool $fail_ok = false) : bool
* Remove some code from a function in the given code snippet.
*
* @param string $code The code
* @param string $function Name of the function
* @param string $command The command we're searching to insert by
* @param integer $instance_of_command We remove the nth instance of this command
* @param boolean $fail_ok Whether a failure should attach a message (false: a failure should cause a critical error)
* @return boolean Success status
*/
function remove_code(string &$code, string $function, string $command, int $instance_of_command = 1, bool $fail_ok = false) : bool

