Skip to content

Commit

Permalink
Fix for namespaced plugin names.
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Sep 10, 2023
1 parent 9c7c3fb commit d5afb2a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Generator/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ protected function _getNamespace(?string $namespace, ?string $plugin): string {
return $namespace;
}
if ($plugin) {
return $plugin;
return str_replace('/', '\\', $plugin);
}

return Configure::read('App.namespace');
Expand Down
3 changes: 3 additions & 0 deletions src/Shell/DtoShell.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ public function init(?string $name = null): void {
}
$file = 'dto' . DS . $name . '.dto.xml';
} else {
if (!is_dir($path)) {
mkdir($path, 0700, true);
}
$file = 'dto.xml';
}

Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Dto/ImmutableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function testBasic() {

// A reason why we want to use immutable datetime objects (FrozenTime):
$created = $articleDto->getCreated();
$isToday = $created->addDay()->isToday();
$isToday = $created->addDays(1)->isToday();
// A mutable datetime inside $articleDto->getCreated() would now accidentally be modified
$this->assertTrue($isToday);

Expand Down

0 comments on commit d5afb2a

Please sign in to comment.