put() public method

Write the contents of a file.
public put ( string $path, string $contents ) : integer
$path string
$contents string
return integer
Beispiel #1
0
 /**
  * Generate phpspec file/settings.
  *
  * @return void
  */
 protected function phpspec()
 {
     $this->testingVersion = '~2.0';
     $file = $this->file->get(__DIR__ . '/stubs/phpspec.stub');
     $content = str_replace('{namespace}', $this->createNamespace(), $file);
     $this->file->put($this->projectLower . '/' . 'phpspec.yml', $content);
     $this->exportIgnores[] = 'phpspec.yml';
 }
Beispiel #2
0
 /**
  * Generate phpspec config file, create a specs directory and
  * add package to development requirements.
  *
  * @return void
  */
 protected function phpspec()
 {
     $this->developmentRequirements[] = 'phpspec/phpspec';
     $file = $this->file->get(__DIR__ . '/stubs/phpspec.stub');
     $content = str_replace('{namespace}', $this->createNamespace(), $file);
     $this->file->makeDirectory($this->projectLower . '/specs');
     $this->exportIgnores[] = 'specs/';
     $this->file->put($this->projectLower . '/' . 'phpspec.yml.dist', $content);
     $this->exportIgnores[] = 'phpspec.yml.dist';
     $this->gitIgnores[] = 'phpspec.yml';
 }