@@ -14,7 +14,7 @@ A set of core PHP functions rewritten to throw exceptions instead of returning `
14
14
15
15
## The problem
16
16
17
- Most PHP core functions have been written before exception handling was added to the language. Therefore, most PHP functions
17
+ Most PHP core functions were written before exception handling was added to the language. Therefore, most PHP functions
18
18
do not throw exceptions. Instead, they return ` false ` in case of error.
19
19
20
20
But most of us are too lazy to check explicitly for every single return of every core PHP function.
@@ -44,10 +44,10 @@ Obviously, while this snippet is correct, it is less easy to read.
44
44
45
45
## The solution
46
46
47
- Enters * thecodingmachine/safe* aka Safe-PHP.
47
+ Enter * thecodingmachine/safe* aka Safe-PHP.
48
48
49
- Safe-PHP redeclares all core PHP functions. The new PHP functions are acting exactly as the old ones, except they are
50
- throwing exceptions properly when an error is encountered. The "safe" functions have the same name as the core PHP
49
+ Safe-PHP redeclares all core PHP functions. The new PHP functions act exactly as the old ones, except they
50
+ throw exceptions properly when an error is encountered. The "safe" functions have the same name as the core PHP
51
51
functions, except they are in the ` Safe ` namespace.
52
52
53
53
``` php
@@ -102,10 +102,10 @@ includes:
102
102
103
103
## Automated refactoring
104
104
105
- You have a large legacy codebase and want to use "Safe-PHP" functions through all you project? PHPStan will help you
106
- finding these functions but changing the namespace of the functions one function at a time might be a tedious work .
105
+ You have a large legacy codebase and want to use "Safe-PHP" functions throughout your project? PHPStan will help you
106
+ find these functions but changing the namespace of the functions one function at a time might be a tedious task .
107
107
108
- Hopefully , Safe comes bundled with a "Rector" configuration file. [Rector](https://github.com/rectorphp/rector) is a command-line
108
+ Fortunately , Safe comes bundled with a "Rector" configuration file. [Rector](https://github.com/rectorphp/rector) is a command-line
109
109
tool that performs instant refactoring of your application.
110
110
111
111
First, you need to install Rector:
@@ -122,7 +122,7 @@ vendor/bin/rector process src/ --config vendor/thecodingmachine/safe/rector-migr
122
122
123
123
* Note:* do not forget to replace "src/" with the path to your source directory.
124
124
125
- ** Important:** the refactoring is only performing a "dumb" replacement of functions. It will not modify the way
125
+ ** Important:** the refactoring only performs a "dumb" replacement of functions. It will not modify the way
126
126
"false" return values are handled. So if your code was already performing error handling, you will have to deal
127
127
with it manually.
128
128
@@ -154,14 +154,14 @@ try {
154
154
155
155
## Work in progress
156
156
157
- There are a number of issues withstanding [ before releasing 1.0] ( https://github.com/thecodingmachine/safe/milestone/1 )
157
+ There are a number of pending issues [ before releasing 1.0] ( https://github.com/thecodingmachine/safe/milestone/1 )
158
158
159
159
## Learn more
160
160
161
- Read [ the release article on TheCodingMachine's blog] ( https://thecodingmachine.io/introducing-safe-php ) if you want to
161
+ Read [ the release article on TheCodingMachine's blog] ( https://thecodingmachine.io/introducing-safe-php ) if you want to
162
162
learn more about what triggered the development of Safe-PHP.
163
163
164
164
## Contributing
165
165
166
- The files that contains all the functions are auto-generated from the PHP doc.
166
+ The files that contain all the functions are auto-generated from the PHP doc.
167
167
Read the [ CONTRIBUTING.md] ( CONTRIBUTING.md ) file to learn how to regenerate these files and to contribute to this library.
0 commit comments