mirror of
https://github.com/codeguy/php-the-right-way.git
synced 2025-08-13 17:23:58 +02:00
Add missing punctuation
This commit is contained in:
@@ -26,7 +26,7 @@ You should read the `CONTRIBUTING.md` file for precise instructions and tips. Bu
|
|||||||
|
|
||||||
### Contributor Style Guide
|
### Contributor Style Guide
|
||||||
|
|
||||||
1. Use American English spelling (*primary English repo only*)
|
1. Use American English spelling (*primary English repo only*).
|
||||||
2. Use four (4) spaces to indent text; do not use tabs.
|
2. Use four (4) spaces to indent text; do not use tabs.
|
||||||
3. Wrap all text to 120 characters.
|
3. Wrap all text to 120 characters.
|
||||||
4. Code samples should adhere to PSR-1 or higher.
|
4. Code samples should adhere to PSR-1 or higher.
|
||||||
|
@@ -32,7 +32,7 @@ don't try this if your project will contain more than a couple of pages.
|
|||||||
The most classic way and often taken as reference for i18n and l10n is a [Unix tool called `gettext`][gettext]. It dates
|
The most classic way and often taken as reference for i18n and l10n is a [Unix tool called `gettext`][gettext]. It dates
|
||||||
back to 1995 and is still a complete implementation for translating software. It is easy enough to get running, while
|
back to 1995 and is still a complete implementation for translating software. It is easy enough to get running, while
|
||||||
still sporting powerful supporting tools. It is about Gettext we will be talking here. Also, to help you not get messy
|
still sporting powerful supporting tools. It is about Gettext we will be talking here. Also, to help you not get messy
|
||||||
over the command-line, we will be presenting a great GUI application that can be used to easily update your l10n source
|
over the command-line, we will be presenting a great GUI application that can be used to easily update your l10n source.
|
||||||
|
|
||||||
### Other tools
|
### Other tools
|
||||||
|
|
||||||
|
@@ -33,7 +33,7 @@ The other use for unit tests is contributing to open source. If you can write a
|
|||||||
which accepts pull requests then you should suggest this as a requirement.
|
which accepts pull requests then you should suggest this as a requirement.
|
||||||
|
|
||||||
[PHPUnit](https://phpunit.de/) is the de-facto testing framework for writing unit tests for PHP applications, but there
|
[PHPUnit](https://phpunit.de/) is the de-facto testing framework for writing unit tests for PHP applications, but there
|
||||||
are several alternatives
|
are several alternatives:
|
||||||
|
|
||||||
* [atoum](https://github.com/atoum/atoum)
|
* [atoum](https://github.com/atoum/atoum)
|
||||||
* [Kahlan](https://github.com/crysalead/kahlan)
|
* [Kahlan](https://github.com/crysalead/kahlan)
|
||||||
|
@@ -9,7 +9,7 @@ title: Other Useful Resources
|
|||||||
### Cheatsheets
|
### Cheatsheets
|
||||||
|
|
||||||
* [PHP Cheatsheets](http://phpcheatsheets.com/) - for variable comparisons, arithmetics and variable testing in various PHP versions.
|
* [PHP Cheatsheets](http://phpcheatsheets.com/) - for variable comparisons, arithmetics and variable testing in various PHP versions.
|
||||||
* [Modern PHP Cheatsheet](https://github.com/smknstd/modern-php-cheatsheet) documents modern (PHP 7.0+) idioms in a unified document.
|
* [Modern PHP Cheatsheet](https://github.com/smknstd/modern-php-cheatsheet) - documents modern (PHP 7.0+) idioms in a unified document.
|
||||||
* [OWASP Security Cheatsheets](https://www.owasp.org/index.php/OWASP_Cheat_Sheet_Series) - provides a concise collection of high value information on specific application security topics.
|
* [OWASP Security Cheatsheets](https://www.owasp.org/index.php/OWASP_Cheat_Sheet_Series) - provides a concise collection of high value information on specific application security topics.
|
||||||
|
|
||||||
### More best practices
|
### More best practices
|
||||||
|
@@ -142,8 +142,8 @@ add new output types without affecting the client code.
|
|||||||
|
|
||||||
You will see how each concrete 'output' class implements an OutputInterface - this serves two purposes, primarily it
|
You will see how each concrete 'output' class implements an OutputInterface - this serves two purposes, primarily it
|
||||||
provides a simple contract which must be obeyed by any new concrete implementations. Secondly by implementing a common
|
provides a simple contract which must be obeyed by any new concrete implementations. Secondly by implementing a common
|
||||||
interface you will see in the next section that you can now utilise [Type Hinting](http://php.net/language.oop5.typehinting) to ensure that the client which is utilising these behaviours is of the correct type in
|
interface you will see in the next section that you can now utilise [Type Hinting](http://php.net/language.oop5.typehinting) to ensure that the client which is utilising these behaviours is of the correct type,
|
||||||
this case 'OutputInterface'.
|
in this case 'OutputInterface'.
|
||||||
|
|
||||||
The next snippet of code outlines how a calling client class might use one of these algorithms and even better set the
|
The next snippet of code outlines how a calling client class might use one of these algorithms and even better set the
|
||||||
behaviour required at runtime:
|
behaviour required at runtime:
|
||||||
|
@@ -362,7 +362,7 @@ return ($a == 5) ? 'yay' : 'nope'; // this example will return 'yay'
|
|||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
It should be noted that you do not need to use a ternary operator for returning a boolean value. An example of this
|
It should be noted that you do not need to use a ternary operator for returning a boolean value. An example of this
|
||||||
would be.
|
would be:
|
||||||
|
|
||||||
{% highlight php %}
|
{% highlight php %}
|
||||||
<?php
|
<?php
|
||||||
|
Reference in New Issue
Block a user