Skip to content

Commit d236c35

Browse files
committed
docs: fix docs
1 parent de06231 commit d236c35

1 file changed

Lines changed: 6 additions & 13 deletions

File tree

README.md

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -115,20 +115,13 @@ You could change return value of patched function using PHP closure:
115115
MonkeyPatch::patchFunction(
116116
'function_exists',
117117
function ($function) {
118-
if ($function === 'random_bytes')
119-
{
118+
if ($function === 'random_bytes') {
120119
return true;
121-
}
122-
elseif ($function === 'openssl_random_pseudo_bytes')
123-
{
120+
} elseif ($function === 'openssl_random_pseudo_bytes') {
124121
return false;
125-
}
126-
elseif ($function === 'mcrypt_create_iv')
127-
{
122+
} elseif ($function === 'mcrypt_create_iv') {
128123
return false;
129-
}
130-
else
131-
{
124+
} else {
132125
return __GO_TO_ORIG__;
133126
}
134127
},
@@ -138,7 +131,7 @@ You could change return value of patched function using PHP closure:
138131

139132
#### Patch Other Functions
140133

141-
If you want to patch other functions, you can add them to [functions_to_patch](hhttps://github.com/kenjis/monkey-patch/blob/a11e1f227234dadeae2460d29b9c8ca6e91c88de/src/bootstrap.php#L56-L59) in `MonkeyPatchManager::init()`.
134+
If you want to patch other functions, you can add them to [functions_to_patch](https://github.com/kenjis/monkey-patch/blob/a11e1f227234dadeae2460d29b9c8ca6e91c88de/src/bootstrap.php#L56-L59) in `MonkeyPatchManager::init()`.
142135

143136
But there are a few known limitations:
144137

@@ -163,7 +156,7 @@ This patcher allows replacement of methods in user-defined classes.
163156
}
164157
~~~
165158

166-
[MonkeyPatch::patchMethod()]() replaces `get_category_list()` method in `Category_model`, and it will return `[(object) ['name' => 'Nothing']]` in the test method.
159+
`MonkeyPatch::patchMethod()` replaces `get_category_list()` method in `Category_model`, and it will return `[(object) ['name' => 'Nothing']]` in the test method.
167160

168161
### Patch Constants
169162

0 commit comments

Comments
 (0)