From d16416cac1f79bd3336548da14fbc3d850308603 Mon Sep 17 00:00:00 2001 From: fridde Date: Tue, 27 Apr 2021 22:46:55 +0200 Subject: [PATCH 1/4] Removed outdated summary The guide is for version 5.6 and while not completely outdated, still too much outdated information to be of use. --- _posts/16-08-01-Sites.md | 1 - 1 file changed, 1 deletion(-) diff --git a/_posts/16-08-01-Sites.md b/_posts/16-08-01-Sites.md index 16ab8b4..fe03257 100644 --- a/_posts/16-08-01-Sites.md +++ b/_posts/16-08-01-Sites.md @@ -15,7 +15,6 @@ PHP versions ### More best practices * [PHP Best Practices](https://phpbestpractices.org/) -* [Best practices for Modern PHP Development](https://www.airpair.com/php/posts/best-practices-for-modern-php-development) * [Why You Should Be Using Supported PHP Versions](https://kinsta.com/blog/php-versions/) ### News around the PHP and web development communities From 4c15e0abc581c4ed01183e32baa559aa895bbd97 Mon Sep 17 00:00:00 2001 From: fridde Date: Tue, 27 Apr 2021 22:48:32 +0200 Subject: [PATCH 2/4] The site no longer exists (but the domain) --- _posts/16-04-01-Mentoring.md | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 _posts/16-04-01-Mentoring.md diff --git a/_posts/16-04-01-Mentoring.md b/_posts/16-04-01-Mentoring.md deleted file mode 100644 index 09172e6..0000000 --- a/_posts/16-04-01-Mentoring.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -isChild: true -anchor: mentoring ---- - -## Mentoring {#mentoring_title} - -* [php-mentoring.org](https://php-mentoring.org/) - Formal, peer to peer mentoring in the PHP community. From 74caf083baf85c2143bcf243f12fcfd197d26677 Mon Sep 17 00:00:00 2001 From: tacodes <64085493+tim-andes@users.noreply.github.com> Date: Fri, 30 Apr 2021 13:44:00 -0600 Subject: [PATCH 3/4] Add/remove commas for readability --- 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 7bf4f5e..6121dd0 100644 --- a/pages/Design-Patterns.md +++ b/pages/Design-Patterns.md @@ -54,8 +54,8 @@ print_r($veyron->getMakeAndModel()); // outputs "Bugatti Veyron" This code uses a factory to create the Automobile object. There are two possible benefits to building your code this way; the first is that if you need to change, rename, or replace the Automobile class later on you can do so and you will only have to modify the code in the factory, instead of every place in your project that uses the Automobile class. -The second possible benefit is that if creating the object is a complicated job you can do all of the work in the -factory, instead of repeating it every time you want to create a new instance. +The second possible benefit is that, if creating the object is a complicated job, you can do all of the work in the +factory instead of repeating it every time you want to create a new instance. Using the factory pattern isn't always necessary (or wise). The example code used here is so simple that a factory would simply be adding unneeded complexity. However if you are making a fairly large or complex project you may save From 81c7c624144512e3cf2ccfe85efa2827ee0831d2 Mon Sep 17 00:00:00 2001 From: Pen-y-Fan <40126936+Pen-y-Fan@users.noreply.github.com> Date: Sun, 2 May 2021 12:15:44 +0100 Subject: [PATCH 4/4] End of Line (#888) End of line changed from `\n` to `PHP_EOL` --- _posts/03-05-01-Command-Line-Interface.md | 4 ++-- _posts/05-03-01-Date-and-Time.md | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/_posts/03-05-01-Command-Line-Interface.md b/_posts/03-05-01-Command-Line-Interface.md index a9c7de5..846ab34 100644 --- a/_posts/03-05-01-Command-Line-Interface.md +++ b/_posts/03-05-01-Command-Line-Interface.md @@ -27,11 +27,11 @@ Let's write a simple "Hello, $name" CLI program. To try it out, create a file na {% highlight php %} .\n"; + echo "Usage: php hello.php " . PHP_EOL; exit(1); } $name = $argv[1]; -echo "Hello, $name\n"; +echo "Hello, $name" . PHP_EOL; {% endhighlight %} PHP sets up two special variables based on the arguments your script is run with. [`$argc`][argc] is an integer diff --git a/_posts/05-03-01-Date-and-Time.md b/_posts/05-03-01-Date-and-Time.md index a6a1cef..2837c8e 100644 --- a/_posts/05-03-01-Date-and-Time.md +++ b/_posts/05-03-01-Date-and-Time.md @@ -19,7 +19,7 @@ output. $raw = '22. 11. 1968'; $start = DateTime::createFromFormat('d. m. Y', $raw); -echo 'Start date: ' . $start->format('Y-m-d') . "\n"; +echo 'Start date: ' . $start->format('Y-m-d') . PHP_EOL; {% endhighlight %} Calculating with DateTime is possible with the DateInterval class. DateTime has methods like `add()` and `sub()` that @@ -34,7 +34,7 @@ $end = clone $start; $end->add(new DateInterval('P1M6D')); $diff = $end->diff($start); -echo 'Difference: ' . $diff->format('%m month, %d days (total: %a days)') . "\n"; +echo 'Difference: ' . $diff->format('%m month, %d days (total: %a days)') . PHP_EOL; // Difference: 1 month, 6 days (total: 37 days) {% endhighlight %} @@ -43,8 +43,7 @@ You can use standard comparisons on DateTime objects: {% highlight php %}