예제 #1
0
 /**
  * @param $controller
  * @param $directory
  * @return array|string
  */
 private static function loadSpecificController($controller, Directory $directory)
 {
     $className = '';
     if (String::isNotEmpty($controller)) {
         $fileName = self::findControllerFilename($controller, $directory);
         /** @noinspection PhpIncludeInspection */
         include_once $fileName;
         $className = self::generateClassName($fileName);
         $className = String::replace('.php', '', implode('\\', $className));
         return $className;
     }
     return $className;
 }
예제 #2
0
 /**
  * Replace string
  *
  * @param string $key   The key
  * @param string $value The value
  *
  * @return void
  */
 private function replaceString($key, $value)
 {
     $this->content = String::replace('{ ' . $key . ' }', $value, $this->content);
 }
예제 #3
0
 /**
  *
  */
 public function testReplaceWithWrongDatatype()
 {
     $this->assertFalse(String::replace('b', ['a', 'b', 'c'], 'abc'));
 }