From 7fbef8d15a684fd0b7b10f33d8a9153d30f3636d Mon Sep 17 00:00:00 2001 From: Samer Halawani Date: Sun, 14 Jan 2018 14:52:10 +0300 Subject: [PATCH] Adapt removeSpecialChars Change from `private` to `protected` and overwrite it in the `MigrationGenerator` in order to comply with the laravel migration filename schema --- Generator/Commands/MigrationGenerator.php | 12 ++++++++++++ Generator/GeneratorCommand.php | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Generator/Commands/MigrationGenerator.php b/Generator/Commands/MigrationGenerator.php index abe6e457c..d4889a103 100644 --- a/Generator/Commands/MigrationGenerator.php +++ b/Generator/Commands/MigrationGenerator.php @@ -125,4 +125,16 @@ public function getDefaultFileName() { return 'create_' . Str::lower($this->containerName) . '_tables'; } + + /** + * Removes "special characters" from a string + * + * @param $str + * + * @return string + */ + protected function removeSpecialChars($str) + { + return $str; + } } diff --git a/Generator/GeneratorCommand.php b/Generator/GeneratorCommand.php index c2f03702a..c23497fef 100644 --- a/Generator/GeneratorCommand.php +++ b/Generator/GeneratorCommand.php @@ -342,7 +342,7 @@ protected function getDefaultFileExtension() * * @return string */ - private function removeSpecialChars($str) + protected function removeSpecialChars($str) { // remove everything that is NOT a character or digit $str = preg_replace('/[^A-Za-z0-9]/', '', $str);