Maks3w / FR3DLdapBundle

This bundle integrates LDAP Authentication with any user manager (Ex: FOSUserBundle)
119 stars 77 forks source link

[Documentation] Hydrator typo? #122

Closed xDaizu closed 8 years ago

xDaizu commented 8 years ago

In the hydrator cookbook the code reads:

// src/Acme/DemoBundle/Ldap/UserHydrator.php
<?php

namespace Acme\DemoBundle\Ldap;

use FR3D\LdapBundle\Hydrator\HydratorInterface;
use Symfony\Component\Security\Core\User\UserInterface;

class LdapManager implements HydratorInterface
{
    /**
     * Populate an user with the data retrieved from LDAP.
     *
     * @param array $ldapUserAttributes
     *
     * @return UserInterface
     */
    public function hydrate(array $entry)
    {
        $user = new \Acme\DemoBundle\Entity\User();
        $user->setUsername($ldapUserAttributes['uid'][0]);
        $user->setEmail($ldapUserAttributes['email'][0]);

        return $user;
    }
}

where the @param field, the actual parameter $entry and the argument inside the function $ldapUserAttributes[...] have inconsistent naming :sweat_smile:

Also, I can't find the class FR3D\LdapBundle\Hydrator\HydratorInterface;, is it deprecated or I'm just blind?

Maks3w commented 8 years ago

About the 2nd. Yep, you may blind https://github.com/Maks3w/FR3DLdapBundle/blob/master/Hydrator/HydratorInterface.php

About the 1st. Fixed https://github.com/Maks3w/FR3DLdapBundle/commit/ba7a62b5610f1702a719a91580146c5d9553cecc

xDaizu commented 8 years ago

@Maks3w ...sorry, but I can't find that file anywhere in the vendor/fr3d/ldap-bundle/ folder... Using "fr3d/ldap-bundle": "2.0.*@dev"as the docs say.

fr3d

Maks3w commented 8 years ago

v3 is the current version

xDaizu commented 8 years ago

If the version of the documentation is 3.0, put it in the installation snippet, plz! :)

El vie., 26 de febrero de 2016 18:45, Maks3w notifications@github.com escribió:

v3 is the current version

— Reply to this email directly or view it on GitHub https://github.com/Maks3w/FR3DLdapBundle/issues/122#issuecomment-189388518 .