From 094d510a1b167c51961101b855f468d842986389 Mon Sep 17 00:00:00 2001 From: Andrew Davis Date: Thu, 22 Nov 2018 21:51:39 -0600 Subject: [PATCH 1/5] Fixed broken link on abstract page --- config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.php b/config.php index e1b41b8..eeabd3d 100644 --- a/config.php +++ b/config.php @@ -146,7 +146,7 @@ return [ Page::create('abstract', null, 'abstract.php', [ 'title' => 'Abstract Classes', 'subtitle' => 'Inheriting an interface', - 'previous' => 'interface', + 'previous' => 'interfaces', 'next' => 'exceptions', ]), Page::create('exceptions', null, 'exceptions.php', [ From 3e2f24c0c6e033d1942fe27667ad7c8f8cb82998 Mon Sep 17 00:00:00 2001 From: Andrew Davis Date: Wed, 26 Dec 2018 18:59:18 -0600 Subject: [PATCH 2/5] Removed meta viewport tag --- assets/templates/_header.phtml | 1 - 1 file changed, 1 deletion(-) diff --git a/assets/templates/_header.phtml b/assets/templates/_header.phtml index c8a716d..0602f31 100644 --- a/assets/templates/_header.phtml +++ b/assets/templates/_header.phtml @@ -6,7 +6,6 @@ <?= $title ?? 'PHP Apprentice' ?> - From dc296aef34816787fdf779a7daefbc8a5ddb5371 Mon Sep 17 00:00:00 2001 From: Andrew Davis Date: Wed, 26 Dec 2018 19:01:06 -0600 Subject: [PATCH 3/5] Proofreading edits --- code/arithmetic.php | 8 ++++---- code/variables.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/code/arithmetic.php b/code/arithmetic.php index d770ca7..57fb4da 100644 --- a/code/arithmetic.php +++ b/code/arithmetic.php @@ -5,10 +5,10 @@ $a = 1; $b = 2; // To add two values, use the plus symbol. -$c = $a + $b; +echo $a + $b; // To subtract, use the minus symbol. -$c = $b - $a; +echo $b - $a; // To multiply two values, use an asterisk. echo $a * $b; @@ -18,8 +18,8 @@ echo $b / $a; // PHP uses the percent symbol for calculating the modulus of two numbers. // The modulus is calculated by dividing two numbers and returning the remainder of the result. -// So, in this example, the value of $modulo will be 0. -$modulo = 10 % 5; +// In this example, the value of $mod will be 0. +$mod = 10 % 5; // You can also use double asterisks to calculate a number to the power of another number. // The following statement will print 25. diff --git a/code/variables.php b/code/variables.php index 13c2f8d..53c8a9c 100644 --- a/code/variables.php +++ b/code/variables.php @@ -19,7 +19,7 @@ $var = 'I am a new variable'; // An int is a number without a decimal place. // A float is a number with a decimal place. // A boolean can be two values: true or false. -// Last, there is a string, a collection of characters. +// Last, there is a string: a collection of characters. $int = 1; $float = 100.10; $bool = true; From 8970e4a0ced2350899eaba124b40c22effea394b Mon Sep 17 00:00:00 2001 From: Andrew Davis Date: Wed, 26 Dec 2018 19:10:58 -0600 Subject: [PATCH 4/5] More proofreading --- code/boolean-logic.php | 2 +- code/comparisons.php | 8 +++++++- code/conditionals.php | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/code/boolean-logic.php b/code/boolean-logic.php index 2fc1c28..f297c94 100644 --- a/code/boolean-logic.php +++ b/code/boolean-logic.php @@ -14,7 +14,7 @@ $a && $b; $a && $c; // Using two pipe characters checks if either value is true. -// Then, it will return true. If both values are false, the PHP +// Then, it will return true. If both values are false, then PHP // returns false. $a = true; $b = false; diff --git a/code/comparisons.php b/code/comparisons.php index 54f8584..444c853 100644 --- a/code/comparisons.php +++ b/code/comparisons.php @@ -2,7 +2,7 @@ // A boolean is a value that is always 0 or 1, yes or no, on or off. // In PHP, a boolean is represented by the words true and false. -// While programming, you will often want to know if something is true or false. +// While programming, you will often want to know if something is positive or negative. $a = true; $b = false; @@ -35,7 +35,13 @@ $one >= $two; // by using three equal signs. // This returns true. +1 == 1; 1 == '1'; +1 == true; +1 == 1.0; +1 === 1; // This returns false. 1 === '1'; +1 === true; +1 === 1.0; diff --git a/code/conditionals.php b/code/conditionals.php index 3187762..d2b8d17 100644 --- a/code/conditionals.php +++ b/code/conditionals.php @@ -62,7 +62,7 @@ switch ($drink) { $language = 'english'; echo $language == 'spanish' ? "hola\n" : "hello\n"; -// Lastly, there is another form of a ternary that checks if a value is set and then returns the value to the right of two question marks if value is null. +// Lastly, there is another form of a ternary that checks if a value is set and then returns the value to the right of the two question marks if the value is null. echo $IDoNotExist ?? "Variable not set\n"; // You can also chain multiple checks in a row. From c1e24ab33ee767fc34420781ef7199ab7569fffe Mon Sep 17 00:00:00 2001 From: Andrew Davis Date: Wed, 26 Dec 2018 19:12:36 -0600 Subject: [PATCH 5/5] Edited home page text --- assets/templates/index.phtml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/templates/index.phtml b/assets/templates/index.phtml index eccd859..0fa74e5 100644 --- a/assets/templates/index.phtml +++ b/assets/templates/index.phtml @@ -5,7 +5,7 @@
-

PHP Apprentice (beta)

+

PHP Apprentice

A site for learning how to use PHP

@@ -15,10 +15,10 @@ The site currently has content for learning the basics of PHP. In the future, more pages will be added for more advanced topics like building websites, database integration and security.

- PHP Apprentice is currently a work in progress (hence "beta" is included in the title). If you would like to contribute or request a certain discussion topic, checkout the GitHub repository. + PHP Apprentice is currently a work in progress. If you would like to contribute or request a certain discussion topic, checkout the GitHub repository.

- To get started, you will need to install PHP 7.1, have a text editor and open your terminal. + To get started, you will need to install PHP, have a text editor and open your terminal. Each example in PHP Apprentice can by typed into a PHP file and executed in the terminal. Let's get started! 😃