/** * @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; }
/** * 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); }
/** * */ public function testReplaceWithWrongDatatype() { $this->assertFalse(String::replace('b', ['a', 'b', 'c'], 'abc')); }