creates file

@param  string  $className
558754
public function create(string $className)
    {
        $this->console->writeLine('Please enter the script name for the console app: ');
        $stubFileName = $this->rootpath->to('bin',  $this->console->readLine());
        if (!file_exists($stubFileName)) {
            $this->createFile($stubFileName, $className, 'script.tmpl');
            $this->console->writeLine(
                    'Script for ' . $className . ' created at ' . $stubFileName
            );
        } else {
            $this->console->writeLine(
                    'Script for ' . $className
                    . ' already exists, skipped creating the script'
            );
        }
    }
783276
protected function classFile($className)
	{
		$classFile = preg_replace('#[_\\\]#', '/', $className).'.php';

		foreach ($this->_paths as $path)
		{
			$classPath = "$path/$classFile";
			if (file_exists($classPath))
			{
				return $classPath;
			}
		}
	}
779223
public static function mapClassNameToFileName($className)
    {
        $arr = preg_split('/(?=[A-Z])/', $className);
        unset($arr[0]); // remove the first element ('')
        $fileName = static::getCurrentTimestamp() . '_' . strtolower(implode($arr, '_')) . '.php';

        return $fileName;
    }
919043
public static function createFromFile($filename, $force_extension = null)
    {
        self::$instance = new Collector;

        self::$instance->buffer = null;

        $extension = ($force_extension!=null)
            ? $force_extension
            : pathinfo($filename, PATHINFO_EXTENSION);

        foreach(self::$instance->readers as $slug => $base) {

            if (Str::lower($extension) == $slug) {

                $class_name = 'PhpOffice\\PhpSpreadsheet\\Reader\\'.$base;
                $reader = new $class_name();
                self::$instance->buffer = $reader->load($filename);
                break;
            }
        }

        if (self::$instance->buffer == null) {
            throw new \InvalidArgumentException(
                "Unsupported file type for reading. Use " . implode(',', self::$instance->readers));
        }

        self::$instance->debug_info = ['created_with' => __METHOD__];

        return self::$instance;
    }
287704
public function addFile($fileName)
    {
        $this->files[$fileName] = sha1_file($fileName);

        $reflection = new FileReflector($fileName, true);
        $reflection->process();

        foreach ($reflection->getClasses() as $class) {
            $class = new ClassDoc($class, $this, ['sourceFile' => $fileName]);
            $this->classes[$class->name] = $class;
        }
        foreach ($reflection->getInterfaces() as $interface) {
            $interface = new InterfaceDoc($interface, $this, ['sourceFile' => $fileName]);
            $this->interfaces[$interface->name] = $interface;
        }
        foreach ($reflection->getTraits() as $trait) {
            $trait = new TraitDoc($trait, $this, ['sourceFile' => $fileName]);
            $this->traits[$trait->name] = $trait;
        }
    }
246958
public function create($className)
    {
        $builder = new Builder($className, $this);
        $this->getGuesser()->fill($builder);
        return $builder;
    }
1228199
public function createToken($className)
    {
        if (!is_subclass_of($className, TokenInterface::class)) {
            $this->throwException(
                "$className is not a valid token sub-class"
            );
        }

        return new $className(
            $this->createCurrentSourceLocation(),
            $this->level,
            str_repeat($this->getIndentStyle(), $this->getIndentWidth())
        );
    }
751752
protected function __autoload($className)
	{
		// Single modules autoload

		foreach ($this->config('defaultAutoloads') as $key => $dir)
		{
			$fileName = $dir . DIRECTORY_SEPARATOR . $className . '.php';
			$fileName = str_replace('\\', DIRECTORY_SEPARATOR, $fileName);

			if (file_exists($fileName) && !class_exists($className))
			{
				$this->loadFiles[$className] = $fileName;

				require $fileName;
			}
		}

		// Multi-Modules autoload

		$modules = array_merge([], $this->config('modules'));

		foreach ($modules as $key => $module)
		{
			$module = ($module == '') ? $module : $module . DIRECTORY_SEPARATOR;

			foreach ($this->config('mvcDirs') as $k => $mvc)
			{
                $phpFile  = explode("\\", $className);
                $phpFile  = $phpFile[count($phpFile) - 1];
				$fileName = $this->path . str_replace('\\', DIRECTORY_SEPARATOR, strtolower(str_replace($phpFile, '', $className))). $phpFile . '.php';

				if (file_exists($fileName) && !class_exists($className))
				{
					$this->loadFiles[$className] = $fileName;

					require $fileName;
				}
			}
		}

		// User custom autoloads

		foreach ($this->config('autoloads') as $key => $dir)
		{
			$fileName = realpath($dir) . DIRECTORY_SEPARATOR . $className . '.php';
			$fileName = str_replace('\\', DIRECTORY_SEPARATOR, $fileName);

			if (file_exists($fileName) && !class_exists($className))
			{
				$this->loadFiles[$className] = $fileName;

				require $fileName;
			}
		}
	}
1345714
public static function mapClassToFile($classFQN, Dir $root = NULL) {
    $ns = self::getNamespace($classFQN);
    $c = self::getClassName($classFQN);
   
    if (!isset($root)) {
      $root = new Dir('.'.DIRECTORY_SEPARATOR);
    }
      
    return new File(self::namespaceToPath($ns, $root), $c.'.php');
  }
521150
protected function _createShell($className, $shortName)
    {
        $instance = parent::_createShell($className, $shortName);
        $webIo = new ConsoleIo(
            new WebConsoleOutput(),
            new WebConsoleOutput(),
            new WebConsoleInput()
        );
        $instance->io($webIo);

        return $instance;
    }
444855
protected function createProjectClass($className)
    {
        $arguments = func_get_args();
        array_shift($arguments);

        return $this->_projectLoader->createClass($className, $arguments);
    }
1371570
public function addClass($className)
  {
    if (!is_numeric(array_search($className, $this->classes))) {
      $this->classes[] = $className;
      return true;
    }
    return false;
  }
1269193
public function create($filename)
    {
        if ($this->exists($filename)) {
            $message = sprintf('Failed to create "%s" because its path is not accessible.', $filename);

            throw new IOException($filename, $message);
        }

        return $this->makeFile($filename, '');
    }
1065898
protected function createFileName($fileName)
    {
        return $this->parseFileName($fileName) . $this->suffix() . $this->config->fileExtension();
    }
507771
final protected function buildClassNameByFileName($filename)
    {
        $className = sprintf('%s/%s', $this->getNamespace(), $filename);
        // Normalize it
        $className = str_replace(array('//', '/', '\\'), '\\', $className);

        return $className;
    }
5831
public function createNew($className)
    {
        $constructArguments = func_get_args();
        $object = $this->_createNew( ...$constructArguments);
        
        $traits = class_uses($object);

        if (isset($traits[Framework::class]) == true) {
            $object->setContainer($this->container);
        }

        return $object;
    }
1226638
public static function create($className, $level) {
        // Create the event
        $event = new LogEvent();

        // Assign level and message
        $event->_setLevel(LogLevel::create($level));

        // Initialize current date and time (with milliseconds)
        $event->_setDate(DateMilli::create());

        // Initialize trace
        $trace = debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT, 4);

        $trace['class'] = $className;
        $trace['file'] = $trace[2]['file'];
        $trace['line'] = $trace[2]['line'];
        $event->_setTrace($trace);

        return $event;
    }