コード例 #1
0
ファイル: HelloGen.php プロジェクト: bkhan1/Hello13
 public static function rotate($n)
 {
     $s = SayHello::world();
     static $letters = 'AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz';
     $n = (int) $n % 26;
     if (!$n) {
         return $s;
     }
     if ($n < 0) {
         $n += 26;
     }
     if ($n == 13) {
         return str_rot13($s);
     }
     $rep = substr($letters, $n * 2) . substr($letters, 0, $n * 2);
     return strtr($s, $letters, $rep);
 }
コード例 #2
0
ファイル: SayHelloTest.php プロジェクト: mfacenet/hello-world
 public function testWorld()
 {
     $output = SayHello::world();
     $this->assertEquals("Hello World, Composer!", $output, "Failed to say hello to the world");
 }
コード例 #3
0
ファイル: test.php プロジェクト: campherkurt/helloworld
<?php

require_once __DIR__ . '/../vendor/autoload.php';
// Autoload files using Composer autoload
use HelloWorld\SayHello;
echo SayHello::world();
コード例 #4
0
ファイル: test.php プロジェクト: alexandi/hello
<?php

require_once __DIR__ . '/../vendor/autoload.php';
// Autoload files using Composer autoload
use HelloWorld\Calculator;
use HelloWorld\SayHello;
// echo SayHello::world();
echo 'Hasilnya :  ' . Calculator::tambah(10, 10) . ' jawabannya: ' . SayHello::world(10);
コード例 #5
0
ファイル: SayHelloTest.php プロジェクト: ehime/hello-world
 public function testNotMisspelled()
 {
     $output = SayHello::world();
     $this->assertContains('Composer', $output, "Composer is misspelt");
 }