diff options
Diffstat (limited to 'main/app/system/Bakery/Bakery.php')
-rw-r--r-- | main/app/system/Bakery/Bakery.php | 44 |
1 files changed, 19 insertions, 25 deletions
diff --git a/main/app/system/Bakery/Bakery.php b/main/app/system/Bakery/Bakery.php index 8be8480..273b25c 100644 --- a/main/app/system/Bakery/Bakery.php +++ b/main/app/system/Bakery/Bakery.php @@ -5,6 +5,7 @@ * @link https://github.com/userfrosting/UserFrosting * @license https://github.com/userfrosting/UserFrosting/blob/master/licenses/UserFrosting.md (MIT License) */ + namespace UserFrosting\System\Bakery; use Symfony\Component\Console\Application; @@ -31,11 +32,10 @@ class Bakery /** * Constructor */ - public function __construct() - { + public function __construct() { // Check for Sprinkles schema file $sprinklesFile = @file_get_contents(\UserFrosting\SPRINKLES_SCHEMA_FILE); - if ($sprinklesFile === false) { + if ($sprinklesFile === FALSE) { $sprinklesFile = $this->setupBaseSprinkleList(); } @@ -46,7 +46,7 @@ class Bakery $uf = new UserFrosting(); // Set argument as false, we are using the CLI - $uf->setupSprinkles(false); + $uf->setupSprinkles(FALSE); // Get the container $this->ci = $uf->getContainer(); @@ -58,16 +58,14 @@ class Bakery /** * Run the Symfony Console App */ - public function run() - { + public function run() { $this->app->run(); } /** * Return the list of available commands for a specific sprinkle */ - protected function loadCommands() - { + protected function loadCommands() { // Get base Bakery command $commands = $this->getBakeryCommands(); @@ -78,7 +76,7 @@ class Bakery } // Add commands to the App - $commands->each(function($command) { + $commands->each(function ($command) { $instance = new $command(); $instance->setContainer($this->ci); $this->app->add($instance); @@ -89,8 +87,7 @@ class Bakery * Return the list of available commands for a specific sprinkle * Sprinkles commands should be located in `src/Bakery/` */ - protected function getSprinkleCommands($sprinkle) - { + protected function getSprinkleCommands($sprinkle) { // Find all the migration files $path = $this->commandDirectoryPath($sprinkle); $files = glob($path . "*.php"); @@ -100,7 +97,7 @@ class Bakery $commands->transform(function ($file) use ($sprinkle, $path) { $className = basename($file, '.php'); $sprinkleName = Str::studly($sprinkle); - $className = "\\UserFrosting\\Sprinkle\\".$sprinkleName."\\Bakery\\".$className; + $className = "\\UserFrosting\\Sprinkle\\" . $sprinkleName . "\\Bakery\\" . $className; return $className; }); @@ -110,8 +107,7 @@ class Bakery /** * Return the list of available commands in system/Bakery/Command/ */ - protected function getBakeryCommands() - { + protected function getBakeryCommands() { // Find all the migration files $files = glob(\UserFrosting\APP_DIR . "/system/Bakery/Command/" . "*.php"); $commands = collect($files); @@ -119,7 +115,7 @@ class Bakery // Transform the path into a class names $commands->transform(function ($file) { $className = basename($file, '.php'); - $className = "\\UserFrosting\\System\\Bakery\\Command\\".$className; + $className = "\\UserFrosting\\System\\Bakery\\Command\\" . $className; return $className; }); @@ -133,14 +129,13 @@ class Bakery * @param mixed $sprinkleName * @return void */ - protected function commandDirectoryPath($sprinkleName) - { + protected function commandDirectoryPath($sprinkleName) { return \UserFrosting\SPRINKLES_DIR . - \UserFrosting\DS . - $sprinkleName . - \UserFrosting\DS . - \UserFrosting\SRC_DIR_NAME . - "/Bakery/"; + \UserFrosting\DS . + $sprinkleName . + \UserFrosting\DS . + \UserFrosting\SRC_DIR_NAME . + "/Bakery/"; } /** @@ -149,12 +144,11 @@ class Bakery * @access protected * @return void */ - protected function setupBaseSprinkleList() - { + protected function setupBaseSprinkleList() { $model = \UserFrosting\APP_DIR . '/sprinkles.example.json'; $destination = \UserFrosting\SPRINKLES_SCHEMA_FILE; $sprinklesModelFile = @file_get_contents($model); - if ($sprinklesModelFile === false) { + if ($sprinklesModelFile === FALSE) { $this->io->error("File `$sprinklesModelFile` not found. Please create '$destination' manually and try again."); exit(1); } |