Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could Filesystem::createDir return path? #130

Closed
h4kuna opened this issue Jan 18, 2017 · 2 comments
Closed

Could Filesystem::createDir return path? #130

h4kuna opened this issue Jan 18, 2017 · 2 comments

Comments

@h4kuna
Copy link
Contributor

h4kuna commented Jan 18, 2017

  • bug report? no
  • feature request? yes
  • version: 2.4

Description

Hi, if I use any directory in component, probably i want create absolute path with any $appDir, $wwwDir, $tempDir and add sub directory.

Use case

class Foo
{
	/** @var string */
	private $tempDir;


	public function __construct($tempDir)
	{
		// now
		$this->tempDir = $tempDir . DIRECTORY_SEPARATOR . 'foo';
		\Nette\Utils\FileSystem::createDir($this->tempDir);

		// after
		$this->tempDir = \Nette\Utils\FileSystem::createDir($tempDir . DIRECTORY_SEPARATOR . 'foo');
	}

}

Is it possible? I can create PR.

@JanTvrdik
Copy link
Contributor

That looks like a misuse of return value to me.

@dg
Copy link
Member

dg commented Jan 18, 2017

This can be useful, but it also brings inconsistency and unpredictability.

@dg dg closed this as completed Jan 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants