Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scaffold produces broken controller #1400

Closed
ruudboon opened this issue Dec 16, 2019 · 1 comment
Closed

Scaffold produces broken controller #1400

ruudboon opened this issue Dec 16, 2019 · 1 comment
Assignees
Milestone

Comments

@ruudboon
Copy link
Member

ruudboon commented Dec 16, 2019

On DevTools V4-RC.1
With table:

CREATE TABLE `users` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `password` char(60) NOT NULL,
  `active` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

ALTER TABLE `users`
  ADD PRIMARY KEY (`id`),
  ADD KEY `email` (`email`);

ALTER TABLE `users`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
COMMIT;

Run:

phalcon scaffold --table-name users

app/controllers/UsersController.php

<?php
declare(strict_types=1);

namespace ;


use Phalcon\Mvc\Model\Criteria;
use Phalcon\Paginator\Adapter\Model as Paginator;
use Users;

Expected

<?php
declare(strict_types=1);

use Phalcon\Mvc\Model\Criteria;
use Phalcon\Paginator\Adapter\Model as Paginator;

Empty namespace should be removed. Same goes got User model (show's warning)

@ruudboon ruudboon added this to the 4.0.0 milestone Dec 16, 2019
@Jeckerson Jeckerson self-assigned this Dec 16, 2019
Jeckerson added a commit that referenced this issue Dec 20, 2019
Jeckerson added a commit that referenced this issue Dec 20, 2019
…oller

#1400 - Fix empty namespace for controllers and models
@Jeckerson
Copy link
Member

Fixed.

@Jeckerson Jeckerson mentioned this issue Dec 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants