Skip to content

Commit

Permalink
Moving the plugin namespace fixing code to a better place in the tasks.
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Krämer committed Nov 1, 2014
1 parent 2026c92 commit 06629ea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Shell/Task/ControllerTask.php
Expand Up @@ -123,7 +123,7 @@ public function bake($controllerName) {

$namespace = Configure::read('App.namespace');
if ($this->plugin) {
$namespace = $this->plugin;
$namespace = str_replace('/', '\\', $this->plugin);
}

$data = compact(
Expand Down Expand Up @@ -158,7 +158,7 @@ public function bakeController($controllerName, array $data) {
'plugin' => null,
'pluginPath' => null,
];
$data['namespace'] = str_replace('/', '\\', $data['namespace']);

$this->Template->set($data);

$contents = $this->Template->generate('classes', 'controller');
Expand Down
3 changes: 1 addition & 2 deletions src/Shell/Task/TestTask.php
Expand Up @@ -195,7 +195,6 @@ public function bake($type, $className) {

$this->out("\n" . sprintf('Baking test case for %s ...', $fullClassName), 1, Shell::QUIET);

$namespace = str_replace('/', '\\', $namespace);
$this->Template->set('fixtures', $this->_fixtures);
$this->Template->set('plugin', $this->plugin);
$this->Template->set(compact(
Expand Down Expand Up @@ -261,7 +260,7 @@ public function buildTestSubject($type, $class) {
public function getRealClassName($type, $class) {
$namespace = Configure::read('App.namespace');
if ($this->plugin) {
$namespace = $this->plugin;
$namespace = str_replace('/', '\\', $this->plugin);
}
$suffix = $this->classSuffixes[strtolower($type)];
$subSpace = $this->mapType($type);
Expand Down

0 comments on commit 06629ea

Please sign in to comment.