OSDN Git Service

Regular updates
authorErik <erikgronwal@users.osdn.me>
Thu, 26 Nov 2020 14:55:05 +0000 (23:55 +0900)
committerErik <erikgronwal@users.osdn.me>
Thu, 26 Nov 2020 14:55:05 +0000 (23:55 +0900)
.github/workflows/build.yml
.github/workflows/deploy.yml
wip/php.md

index f18b604..7cc7ae4 100644 (file)
@@ -37,7 +37,7 @@ jobs:
 
       - name: Use Ruby
         uses: actions/setup-ruby@v1
-        with: { ruby-version: '2.7.1' }
+        with: { ruby-version: '2.7' }
 
       - name: Setup dependencies
         run: |
index 74a3c06..8f2ac72 100644 (file)
@@ -52,7 +52,7 @@ jobs:
 
       - name: Use Ruby
         uses: actions/setup-ruby@v1
-        with: { ruby-version: '2.7.1' }
+        with: { ruby-version: '2.7' }
 
       - name: Setup dependencies
         run: |
index 3ba62cb..c921893 100644 (file)
@@ -11,8 +11,9 @@ prism_languages: [php]
 
 ```php
 <?php
-function greetMe($name) {
-  return "Hello, " . $name . "!";
+function greetMe($name): string
+{
+    return "Hello, " . $name . "!";
 }
 
 $message = greetMe($name);
@@ -21,7 +22,7 @@ echo $message;
 
 All PHP files start with `<?php`.
 
-See: [PHP tags](http://php.net/manual/en/language.basic-syntax.phptags.php)
+See: [PHP tags](https://php.net/manual/en/language.basic-syntax.phptags.php)
 
 ### Objects
 
@@ -29,8 +30,8 @@ See: [PHP tags](http://php.net/manual/en/language.basic-syntax.phptags.php)
 <?php
 
 $fruitsArray = array(
-  "apple" => 20,
-  "banana" => 30
+    "apple" => 20,
+    "banana" => 30
 );
 echo $fruitsArray['banana'];
 ```
@@ -53,12 +54,13 @@ var_dump($object)
 
 Prints the contents of a variable for inspection.
 
-See: [var_dump](http://php.net/var_dump)
+See: [var_dump](https://php.net/var_dump)
 
 ### Classes
 
 ```php
-class Person {
+class Person
+{
     public $name = '';
 }
 
@@ -73,14 +75,14 @@ echo $person->name;
 ```php
 class Person 
 {
-    public $name = '';
+    private $name = '';
 
-    public function getName()
+    public function getName(): string
     {
         return $this->name;
     }
 
-    public function setName($name)
+    public function setName(string $name)
     {
         $this->name = $name;
         return $this;
@@ -97,13 +99,12 @@ echo $person->getName();
 ```php
 
 $options = [
-  'key' => 'value',
-  'blank' => '',
-  'nothing' => null,
+    'key' => 'value',
+    'blank' => '',
+    'nothing' => null,
 ];
 
 var_dump(isset($options['key']), empty($options['key'])); // true, false
 var_dump(isset($options['blank']), empty($options['blank'])); // true, true
 var_dump(isset($options['nothing']), empty($options['nothing'])); // false, true
-
 ```