cphalcon icon indicating copy to clipboard operation
cphalcon copied to clipboard

Rename Phalcon\Mvc\Url

Open ekmst opened this issue 7 years ago • 6 comments

I propose to rename Phalcon\Mvc\Url to Phalcon\Url. Since the Url is used not only in web applications but also in console (and micro) applications too. I think it will be semantic more correct.

  • Phalcon\Mvc\Url to Phalcon\Url
  • Phalcon\Mvc\UrlInterface to Phalcon\UrlInterface
  • Phalcon\Mvc\Url\Exception to Phalcon\Url\Exception

ekmst avatar Jan 08 '19 12:01 ekmst

There is entirely too much stuff in the Phalcon\Mvc namespace.

dschissler avatar Jan 08 '19 13:01 dschissler

There is entirely too much stuff in the Phalcon\Mvc namespace.

I agree.

I also suggest renaming Phalcon\Mvc\User\*, as they do not directly relate to the MVC pattern.

For example:

  • Phalcon\Mvc\User\Component to Phalcon\User\Component
  • Phalcon\Mvc\User\Module to Phalcon\User\Module
  • Phalcon\Mvc\User\Plugin to Phalcon\User\Plugin

ekmst avatar Jan 08 '19 14:01 ekmst

If they are empty then can be abandoned also, because Injectable can be used directly in PHP. Less code is better.

And why User\Module exists? we have... class Module implements ModuleDefinitionInterface { ... }

ViltusVilks avatar Jan 08 '19 14:01 ViltusVilks

@ekmst The Phalcon\Mvc\User\* classes will be removed for sure. We were thinking about leaving only one of them, something in the lines of Phalcon\Plugin maybe?

Honestly those classes do nothing. They just offer a more intuitive way to make a class DI aware which one can do easily by extending InjectionAware.

As for the Url. Yes I agree. It would be best if we move it out of the Mvc namespace and I would love to see if I can introduce also the Uri implementation for PSR7 and make those two work together.

niden avatar Jan 09 '19 16:01 niden

This has been resolved

niden avatar Feb 16 '19 16:02 niden

I agree with @ekmst for

Phalcon\Mvc\User\Component to Phalcon\User\Component
Phalcon\Mvc\User\Module to Phalcon\User\Module
Phalcon\Mvc\User\Plugin to Phalcon\User\Plugin

But for Url it would be better to do something like;

Phalcon\Mvc\Url to Phalcon\Link
Phalcon\Mvc\UrlInterface to Phalcon\Link\Interface
Phalcon\Mvc\Url\Exception to Phalcon\Link\Exception

ghost avatar Apr 04 '19 04:04 ghost