forked from CouscousPHP/Couscous
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request CouscousPHP#124 from CouscousPHP/analysis-XWl6yq
Applied fixes from StyleCI
- Loading branch information
Showing
53 changed files
with
175 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,8 +12,8 @@ | |
* | ||
* @author Ross J. Hagan <[email protected]> | ||
*/ | ||
class InitTemplateCommand extends Command { | ||
|
||
class InitTemplateCommand extends Command | ||
{ | ||
protected function configure() | ||
{ | ||
$this | ||
|
@@ -35,28 +35,28 @@ protected function configure() | |
|
||
protected function execute(InputInterface $input, OutputInterface $output) | ||
{ | ||
$fileExtension = '.twig'; | ||
|
||
$fileExtension = '.twig'; | ||
|
||
$dirName = $input->getArgument('directory'); | ||
$directory = getcwd() . '/' . $dirName . '/'; | ||
$templateName = $input->getArgument('template_name') . $fileExtension; | ||
$dirName = $input->getArgument('directory'); | ||
$directory = getcwd().'/'.$dirName.'/'; | ||
$templateName = $input->getArgument('template_name').$fileExtension; | ||
|
||
$fileLocation = $directory . $templateName; | ||
$fileExists = file_exists($fileLocation); | ||
$fileLocation = $directory.$templateName; | ||
$fileExists = file_exists($fileLocation); | ||
|
||
if (! file_exists(getcwd() . '/' . $dirName)) { | ||
if (!file_exists(getcwd().'/'.$dirName)) { | ||
$output->writeln('<comment>Creating directory.</comment>'); | ||
mkdir(getcwd() . '/' . $dirName); | ||
mkdir(getcwd().'/'.$dirName); | ||
} | ||
|
||
if ($fileExists) { | ||
$output->writeln('<error>That template exists at ' . $fileLocation . ', so nothing has been changed.</error>'); | ||
$output->writeln('<error>That template exists at '.$fileLocation.', so nothing has been changed.</error>'); | ||
$output->writeln('<error>Try another name!</error>'); | ||
|
||
return; | ||
} | ||
|
||
if (! $fileExists) { | ||
if (!$fileExists) { | ||
$output->writeln('<comment>Initialising template.</comment>'); | ||
$template = <<<HTML | ||
<!DOCTYPE html> | ||
|
@@ -87,7 +87,5 @@ protected function execute(InputInterface $input, OutputInterface $output) | |
HTML; | ||
file_put_contents($fileLocation, $template); | ||
} | ||
|
||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.