original_string: public function createApi($config)
      {
          $routesMaster = $config['_path_api_routes_'];
  
          if (!file_exists($routesMaster)) {
              $this->putIfNotExists($routesMaster, "<?php\n\n");
          }
  
          $this->fileService->mkdir($config['_path_api_controller_'], 0777, true);
  
          $routes = $this->fileService->get($config['template_source'].'/ApiRoutes.txt');
  
          foreach ($config as $key => $value) {
              $routes = str_replace($key, $value, $routes);
          }
  
          $this->filesystem->append($routesMaster, $routes);
  
          $request = $this->fileService->get($config['template_source'].'/ApiController.txt');
  
          foreach ($config as $key => $value) {
              $request = str_replace($key, $value, $request);
          }
  
          $request = $this->putIfNotExists($config['_path_api_controller_'].'/'.$config['_ucCamel_casePlural_'].'Controller.php', $request);
  
          return $request;
      }
code: public function createApi($config)
      {
          $routesMaster = $config['_path_api_routes_'];
  
          if (!file_exists($routesMaster)) {
              $this->putIfNotExists($routesMaster, "<?php\n\n");
          }
  
          $this->fileService->mkdir($config['_path_api_controller_'], 0777, true);
  
          $routes = $this->fileService->get($config['template_source'].'/ApiRoutes.txt');
  
          foreach ($config as $key => $value) {
              $routes = str_replace($key, $value, $routes);
          }
  
          $this->filesystem->append($routesMaster, $routes);
  
          $request = $this->fileService->get($config['template_source'].'/ApiController.txt');
  
          foreach ($config as $key => $value) {
              $request = str_replace($key, $value, $request);
          }
  
          $request = $this->putIfNotExists($config['_path_api_controller_'].'/'.$config['_ucCamel_casePlural_'].'Controller.php', $request);
  
          return $request;
      }
code_tokens: public function createApi ( $ config ) { $ routesMaster = $ config [ '_path_api_routes_' ] ; if ( ! file_exists ( $ routesMaster ) ) { $ this -> putIfNotExists ( $ routesMaster , "<?php\n\n" ) ; } $ this -> fileService -> mkdir ( $ config [ '_path_api_controller_' ] , 0777 , true ) ; $ routes = $ this -> fileService -> get ( $ config [ 'template_source' ] . '/ApiRoutes.txt' ) ; foreach ( $ config as $ key => $ value ) { $ routes = str_replace ( $ key , $ value , $ routes ) ; } $ this -> filesystem -> append ( $ routesMaster , $ routes ) ; $ request = $ this -> fileService -> get ( $ config [ 'template_source' ] . '/ApiController.txt' ) ; foreach ( $ config as $ key => $ value ) { $ request = str_replace ( $ key , $ value , $ request ) ; } $ request = $ this -> putIfNotExists ( $ config [ '_path_api_controller_' ] . '/' . $ config [ '_ucCamel_casePlural_' ] . 'Controller.php' , $ request ) ; return $ request ; }
docstring: Create the Api.
  
  @param array $config
  
  @return bool
docstring_tokens: Create the Api .