From 6e0076e2c2a973d13dd674dabaa08c1e4e57f12e Mon Sep 17 00:00:00 2001 From: Xymph Date: Tue, 23 Aug 2022 22:15:28 +0200 Subject: [PATCH 1/7] Add missing punctuation --- README.md | 2 +- _posts/05-06-01-Internationalization-and-Localization.md | 2 +- _posts/11-02-01-Test-Driven-Development.md | 2 +- _posts/16-08-01-Sites.md | 2 +- pages/Design-Patterns.md | 4 ++-- pages/The-Basics.md | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 17bcd29..0efa7ec 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ You should read the `CONTRIBUTING.md` file for precise instructions and tips. Bu ### 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. 3. Wrap all text to 120 characters. 4. Code samples should adhere to PSR-1 or higher. diff --git a/_posts/05-06-01-Internationalization-and-Localization.md b/_posts/05-06-01-Internationalization-and-Localization.md index 1fe2f02..b44ff34 100644 --- a/_posts/05-06-01-Internationalization-and-Localization.md +++ b/_posts/05-06-01-Internationalization-and-Localization.md @@ -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 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 -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 diff --git a/_posts/11-02-01-Test-Driven-Development.md b/_posts/11-02-01-Test-Driven-Development.md index 745f7f1..b4715ce 100644 --- a/_posts/11-02-01-Test-Driven-Development.md +++ b/_posts/11-02-01-Test-Driven-Development.md @@ -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. [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) * [Kahlan](https://github.com/crysalead/kahlan) diff --git a/_posts/16-08-01-Sites.md b/_posts/16-08-01-Sites.md index 6802431..80434df 100644 --- a/_posts/16-08-01-Sites.md +++ b/_posts/16-08-01-Sites.md @@ -9,7 +9,7 @@ title: Other Useful Resources ### Cheatsheets * [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. ### More best practices diff --git a/pages/Design-Patterns.md b/pages/Design-Patterns.md index 6121dd0..5893555 100644 --- a/pages/Design-Patterns.md +++ b/pages/Design-Patterns.md @@ -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 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 -this case 'OutputInterface'. +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 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 behaviour required at runtime: diff --git a/pages/The-Basics.md b/pages/The-Basics.md index 11ae952..118e0c1 100644 --- a/pages/The-Basics.md +++ b/pages/The-Basics.md @@ -362,7 +362,7 @@ return ($a == 5) ? 'yay' : 'nope'; // this example will return 'yay' {% endhighlight %} 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 %} Date: Tue, 23 Aug 2022 22:17:07 +0200 Subject: [PATCH 2/7] Fix incorrect case of a few words --- _posts/03-04-01-Standard-PHP-Library.md | 2 +- _posts/16-10-01-Books.md | 2 +- pages/The-Basics.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/_posts/03-04-01-Standard-PHP-Library.md b/_posts/03-04-01-Standard-PHP-Library.md index 57e845b..7b47a7e 100644 --- a/_posts/03-04-01-Standard-PHP-Library.md +++ b/_posts/03-04-01-Standard-PHP-Library.md @@ -11,7 +11,7 @@ primarily of commonly needed datastructure classes (stack, queue, heap, and so o over these datastructures or your own classes which implement SPL interfaces. * [Read about the SPL][spl] -* [SPL video course on Lynda.com(Paid)][spllynda] +* [SPL video course on Lynda.com (paid)][spllynda] [spl]: https://secure.php.net/book.spl diff --git a/_posts/16-10-01-Books.md b/_posts/16-10-01-Books.md index d798f4c..dba9c63 100644 --- a/_posts/16-10-01-Books.md +++ b/_posts/16-10-01-Books.md @@ -21,7 +21,7 @@ for modern, secure, and fast cryptography. * [Build APIs You Won't Hate](https://apisyouwonthate.com/) - Everyone and their dog wants an API, so you should probably learn how to build them. -* [Modern PHP](http://shop.oreilly.com/product/0636920033868.do) - covers modern PHP features, best practices, testing, tuning, deployment and setting up a dev environment. +* [Modern PHP](http://shop.oreilly.com/product/0636920033868.do) - Covers modern PHP features, best practices, testing, tuning, deployment and setting up a dev environment. * [Building Secure PHP Apps](https://leanpub.com/buildingsecurephpapps) - Learn the security basics that a senior developer usually acquires over years of experience, all condensed down into one quick and easy handbook * [Modernizing Legacy Applications In PHP](https://leanpub.com/mlaphp) - Get your code under control in a series of diff --git a/pages/The-Basics.md b/pages/The-Basics.md index 118e0c1..f2e6d5e 100644 --- a/pages/The-Basics.md +++ b/pages/The-Basics.md @@ -80,7 +80,7 @@ function test($a) Switch statements are a great way to avoid typing endless if's and elseif's, but there are a few things to be aware of: - Switch statements only compare values, and not the type (equivalent to '==') -- They Iterate case by case until a match is found. If no match is found, then the default is used (if defined) +- They iterate case by case until a match is found. If no match is found, then the default is used (if defined) - Without a 'break', they will continue to implement each case until reaching a break/return - Within a function, using 'return' alleviates the need for 'break' as it ends the function From ca0f073a4c8bdb2ffd1ec904a77ac8cbe9de43e2 Mon Sep 17 00:00:00 2001 From: Xymph Date: Tue, 23 Aug 2022 22:18:11 +0200 Subject: [PATCH 3/7] Remove space inside 2 hyphenated words --- _posts/06-04-01-Containers.md | 4 ++-- pages/The-Basics.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/_posts/06-04-01-Containers.md b/_posts/06-04-01-Containers.md index 46051bc..4e115a4 100644 --- a/_posts/06-04-01-Containers.md +++ b/_posts/06-04-01-Containers.md @@ -12,5 +12,5 @@ Locator in to your classes arguably creates a harder dependency on the container It also makes your code much less transparent and ultimately harder to test. Most modern frameworks have their own Dependency Injection Container that allows you to wire your dependencies together -through configuration. What this means in practice is that you can write application code that is as clean and de- -coupled as the framework it is built on. +through configuration. What this means in practice is that you can write application code that is as clean and +de-coupled as the framework it is built on. diff --git a/pages/The-Basics.md b/pages/The-Basics.md index f2e6d5e..711d7c8 100644 --- a/pages/The-Basics.md +++ b/pages/The-Basics.md @@ -323,8 +323,8 @@ results can vary. If you are working with a small number of values, concatenatio values, interpolating is minutely faster. Regardless of what you are doing with strings, none of the types will ever have any noticeable impact on your -application. Trying to rewrite code to use one or the other is always an exercise in futility, so avoid this micro- -optimization unless you really understand the meaning and impact of the differences. +application. Trying to rewrite code to use one or the other is always an exercise in futility, so avoid this +micro-optimization unless you really understand the meaning and impact of the differences. * [Disproving the Single Quotes Performance Myth](http://nikic.github.io/2012/01/09/Disproving-the-Single-Quotes-Performance-Myth.html) From a85d35345dfea7810f56d5d3d69b97e19de6a1c9 Mon Sep 17 00:00:00 2001 From: Xymph Date: Tue, 23 Aug 2022 22:19:23 +0200 Subject: [PATCH 4/7] Remove inappropriate apostrophes --- _posts/13-03-01-Docker.md | 2 +- pages/The-Basics.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/_posts/13-03-01-Docker.md b/_posts/13-03-01-Docker.md index baf5881..2a9bd25 100644 --- a/_posts/13-03-01-Docker.md +++ b/_posts/13-03-01-Docker.md @@ -11,7 +11,7 @@ A typical LAMP application might have three containers: a web server, a PHP-FPM You can generate containers from the command line (see example below) or, for ease of maintenance, build a `docker-compose.yml` file for your project specifying which to create and how they communicate with one another. -Docker may help if you're developing multiple websites and want the separation that comes from installing each on it's own virtual machine, but don't have the necessary disk space or the time to keep everything up to date. It's efficient: the installation and downloads are quicker, you only need to store one copy of each image however often it's used, containers need less RAM and share the same OS kernel, so you can have more servers running simultaneously, and it takes a matter of seconds to stop and start them, no need to wait for a full server boot. +Docker may help if you're developing multiple websites and want the separation that comes from installing each on its own virtual machine, but don't have the necessary disk space or the time to keep everything up to date. It's efficient: the installation and downloads are quicker, you only need to store one copy of each image however often it's used, containers need less RAM and share the same OS kernel, so you can have more servers running simultaneously, and it takes a matter of seconds to stop and start them, no need to wait for a full server boot. ### Example: Running your PHP Applications in Docker diff --git a/pages/The-Basics.md b/pages/The-Basics.md index 711d7c8..b88e3f0 100644 --- a/pages/The-Basics.md +++ b/pages/The-Basics.md @@ -248,7 +248,7 @@ Example of string spanning multiple lines using nowdoc syntax. $a does not parse. -EOD; // closing 'EOD' must be on it's own line, and to the left most point +EOD; // closing 'EOD' must be on its own line, and to the left most point /** * Output: @@ -276,7 +276,7 @@ Example of string spanning multiple lines using heredoc syntax. $a are parsed. -EOD; // closing 'EOD' must be on it's own line, and to the left most point +EOD; // closing 'EOD' must be on its own line, and to the left most point /** * Output: From 8c0b2376675a29775e0120c822517ec8630158c6 Mon Sep 17 00:00:00 2001 From: Xymph Date: Tue, 23 Aug 2022 22:20:46 +0200 Subject: [PATCH 5/7] Use plural grammar/spelling where intended --- _posts/05-06-01-Internationalization-and-Localization.md | 4 ++-- _posts/12-05-01-Building-your-Application.md | 2 +- _posts/13-03-01-Docker.md | 2 +- pages/Design-Patterns.md | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/_posts/05-06-01-Internationalization-and-Localization.md b/_posts/05-06-01-Internationalization-and-Localization.md index b44ff34..8ed02dd 100644 --- a/_posts/05-06-01-Internationalization-and-Localization.md +++ b/_posts/05-06-01-Internationalization-and-Localization.md @@ -41,7 +41,7 @@ install or sport additional features or i18n file formats. In this document, we PHP core, but here we list others for completion: - [aura/intl][aura-intl]: Provides internationalization (I18N) tools, specifically package-oriented per-locale message -translation. It uses array formats for message. Does not provide a message extractor, but does provide advanced +translation. It uses array formats for messages. Does not provide a message extractor, but does provide advanced message formatting via the `intl` extension (including pluralized messages). - [oscarotero/Gettext][oscarotero]: Gettext support with an OO interface; includes improved helper functions, powerful extractors for several file formats (some of them not supported natively by the `gettext` command), and can also export @@ -248,7 +248,7 @@ the actual interface. Given that, let's tie together what we have discussed so f - [`gettext()`][func] simply translates a `msgid` into its corresponding `msgstr` for a given language. There's also the shorthand function `_()` that works the same way; - [`ngettext()`][n_func] does the same but with plural rules; -- there's also [`dgettext()`][d_func] and [`dngettext()`][dn_func], that allows you to override the domain for a single +- There are also [`dgettext()`][d_func] and [`dngettext()`][dn_func], that allow you to override the domain for a single call. More on domain configuration in the next example. #### 2. A sample setup file (`i18n_setup.php` as used above), selecting the correct locale and configuring Gettext diff --git a/_posts/12-05-01-Building-your-Application.md b/_posts/12-05-01-Building-your-Application.md index 7dfa6aa..ca64d8c 100644 --- a/_posts/12-05-01-Building-your-Application.md +++ b/_posts/12-05-01-Building-your-Application.md @@ -49,7 +49,7 @@ Managing and configuring servers can be a daunting task when faced with many ser [Ansible] is a tool that manages your infrastructure through YAML files. It's simple to get started with and can manage complex and large scale applications. There is an API for managing cloud instances and it can manage them through a dynamic inventory using certain tools. -[Puppet] is a tool that has its own language and file types for managing servers and configurations. It can be used in a master/client setup or it can be used in a "master-less" mode. In the master/client mode the clients will poll the central master(s) for new configuration on set intervals and update itself if necessary. In the master-less mode you can push changes to your nodes. +[Puppet] is a tool that has its own language and file types for managing servers and configurations. It can be used in a master/client setup or it can be used in a "master-less" mode. In the master/client mode the clients will poll the central master(s) for new configuration on set intervals and update themselves if necessary. In the master-less mode you can push changes to your nodes. [Chef] is a powerful Ruby based system integration framework that you can build your whole server environment or virtual boxes with. It integrates well with Amazon Web Services through their service called OpsWorks. diff --git a/_posts/13-03-01-Docker.md b/_posts/13-03-01-Docker.md index 2a9bd25..746a78c 100644 --- a/_posts/13-03-01-Docker.md +++ b/_posts/13-03-01-Docker.md @@ -22,7 +22,7 @@ The following will download a fully functional Apache installation with the late docker run -d --name my-php-webserver -p 8080:80 -v /path/to/your/php/files:/var/www/html/ php:apache {% endhighlight %} -This will initialize and launch your container. `-d` makes it runs in the background. To stop and start it, simply run `docker stop my-php-webserver` and `docker start my-php-webserver` (the other parameters are not needed again). +This will initialize and launch your container. `-d` makes it run in the background. To stop and start it, simply run `docker stop my-php-webserver` and `docker start my-php-webserver` (the other parameters are not needed again). ### Learn more about Docker diff --git a/pages/Design-Patterns.md b/pages/Design-Patterns.md index 5893555..593c9b5 100644 --- a/pages/Design-Patterns.md +++ b/pages/Design-Patterns.md @@ -197,7 +197,7 @@ and gives you a central place to hook in code that should be run for every reque ## Model-View-Controller -The model-view-controller (MVC) pattern and its relatives HMVC and MVVM lets you break up code into logical objects +The model-view-controller (MVC) pattern and its relatives HMVC and MVVM let you break up code into logical objects that serve very specific purposes. Models serve as a data access layer where data is fetched and returned in formats usable throughout your application. Controllers handle the request, process the data returned from models and load views to send in the response. And views are display templates (markup, xml, etc) that are sent in the response to the From 98942ccc3ba1d8c4dd5e4162778f1ef415d4381c Mon Sep 17 00:00:00 2001 From: Xymph Date: Tue, 23 Aug 2022 22:22:18 +0200 Subject: [PATCH 6/7] Split run-on sentence into 2 sentences --- pages/Design-Patterns.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/Design-Patterns.md b/pages/Design-Patterns.md index 593c9b5..7b80ea9 100644 --- a/pages/Design-Patterns.md +++ b/pages/Design-Patterns.md @@ -166,8 +166,8 @@ class SomeClient } {% endhighlight %} -The calling client class above has a private property which must be set at runtime and be of type 'OutputInterface' -once this property is set a call to loadOutput() will call the load() method in the concrete class of the output type +The calling client class above has a private property which must be set at runtime and be of type 'OutputInterface'. +Once this property is set a call to loadOutput() will call the load() method in the concrete class of the output type that has been set. {% highlight php %} From 005ba520403a9ec6836795c553c2b32893d901ee Mon Sep 17 00:00:00 2001 From: Xymph Date: Tue, 23 Aug 2022 22:23:31 +0200 Subject: [PATCH 7/7] Improve grammar of ElePHPants paragraph --- _posts/17-04-01-Elephpants.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_posts/17-04-01-Elephpants.md b/_posts/17-04-01-Elephpants.md index ed2f0d1..47c7aae 100644 --- a/_posts/17-04-01-Elephpants.md +++ b/_posts/17-04-01-Elephpants.md @@ -5,7 +5,7 @@ anchor: elephpants ## ElePHPants {#elephpants_title} -[ElePHPant][elephpant] is that beautiful mascot of the PHP project with elephant in their design. It was originally designed for the PHP project in 1998 by [Vincent Pontier][vincent-pontier] - spiritual father of thousands of elePHPants around the world and 10 years later adorable plush elephant toy came to birth as well. Now elePHPants are present at many PHP conferences and with many PHP developers at their computers for fun and inspiration. +[ElePHPant][elephpant] is that beautiful mascot of the PHP project with an elephant in its design. It was originally designed for the PHP project in 1998 by [Vincent Pontier][vincent-pontier] - spiritual father of thousands of elePHPants around the world - and ten years later adorable plush elephant toys came to birth as well. Now elePHPants are present at many PHP conferences and with many PHP developers at their computers for fun and inspiration. [Interview with Vincent Pontier][vincent-pontier-interview]