Skip to content

Commit 13a62bb

Browse files
committed
Fix uses adding with action creation
1 parent e66a1cf commit 13a62bb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Ubiquity/scaffolding/ScaffoldController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,10 @@ public function _newAction($controller, $action, $parameters = null, $content =
177177
if ($routeAnnotation != '') {
178178
$msgContent .= $this->_addMessageForRouteCreation($routeInfo["path"]);
179179
if(\count($this->getUses())>0){
180-
$namespace='namespace '.$r->getNamespaceName().";\n";
180+
$namespace='namespace '.$r->getNamespaceName().";";
181181
$posUses = \strpos($fileContent, $namespace);
182182
if($posUses!==false){
183-
$posUses+=strlen($namespace);
183+
$posUses+=\strlen($namespace)+1;
184184
$uses=$this->uses;
185185
foreach ($uses as $use=>$_){
186186
if(\strpos($fileContent, 'use '.$use)!==false){

0 commit comments

Comments
 (0)