GithubHelp home page GithubHelp logo

baconuser's People

Contributors

bakura10 avatar dasprid avatar ircmaxell avatar ocramius avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

baconuser's Issues

Registration Service attempts to get form from service locator when it is actually part of the form element manager

I was looking over the code and noticed that the registration form factory is defined in the form element manager configuration:

https://github.com/Bacon/BaconUser/blob/master/config/module.config.php#L40

However, the form registration service attempts to get the form from the service manager: https://github.com/Bacon/BaconUser/blob/master/src/BaconUser/Service/Factory/RegistrationServiceFactory.php#L31

There is no 'BaconUser\Form\RegistrationForm' key in the service manager configuration. I'm sure the form should be instantiated by the form element manager:

Like so:
$serviceLocator->get('FormElementManager')->get('BaconUser\Form\RegistrationForm')

I could be wrong and haven't tested anything, merely an observation.

Don't change identifier column names

Here : https://github.com/Bacon/BaconUser/blob/master/config/doctrine/BaconUser.Entity.User.dcm.xml#L9

You are changing the column name of the primary key (from id to user_id). I'd suggest NOT to change the default name for identifier because Doctrine make assumptions about this name when using those entities in associations (and User one is often used !). As a consequence, we need to add a @joincolumn and change the referencedColumn attribute whenever we have an association to a user, which is not intuitive and very annoying.

I had this problem in ZfcUserDoctrine too, and I'd like not to have it here. We should favor the default usage here.

Write more tests that reuse config

Currently, tests is mostly done with mocks. This is good, but as a consequence there were plenty of issues that could have been detected by testing directly the code instead of mocking everything.

For example, we should reuse the default config provided by the module, and use it to test them.

Replace forms by fieldsets

Currently BaconUser uses form. However, forms are not reusable while fieldset are. This means that if someone want to have another form with a user, he has to duplicate all the fields.

We need to change that so we have a UserFieldset instead, and multiple forms (RegistrationForm, LoginForm…) that reuse the fieldset, and set the validation group accordingly.

Remove displayName ?

Hi,

I can see the use of the username property (even if it's not used, it's often useful it tons of projects). However, I'd be for removing the displayName property. Most of the time, people use "firstName" and "lastName" (I already had a display name in some clients websites that ended being simply a free input where people would enter first name and last name, but it's just a hell to normalize then). I think most of the time this property will be disabled in favor of first name and last name, so I'd say maybe we could remove it (so less nullable inputs).

Thoughts @DASPRiD @Ocramius ?

Remove form in RegistrationService

Here: https://github.com/Bacon/BaconUser/blob/master/src/BaconUser/Service/RegistrationService.php#L27

The registration service is tied to a form. I think it's not responsability of the service to do that. The RegistrationService should only receive data considered as valid. When using REST we mostly don't use form but only input filter.

Furthermore, because the form is in the registration form itself, there is no way to retrieve it to show errors.

What do oyu think @Ocramius?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.