Commit 7a37d602 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Changement syntaxe PHP 5.4 -> 5.3.

parent 681b09bb
Loading
Loading
Loading
Loading
+2 −2
Changes for src/UnicaenLdap/Entity/Entity.php: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -130,7 +130,7 @@ abstract class Entity
     */
    public function getId()
    {
        $key = self::getNodeParams($this->type)[0];
        list($key) = self::getNodeParams($this->type);
        return $this->get($key);
    }

@@ -141,7 +141,7 @@ abstract class Entity
     */
    public function getKey()
    {
        return self::getNodeParams($this->type)[0];
        return reset(self::getNodeParams($this->type));
    }

    /**
+9 −9
Changes for src/UnicaenLdap/Service/Service.php: 9 added lines, 9 removed lines.
Original line number Diff line number Diff line
@@ -146,7 +146,7 @@ abstract class Service implements ServiceManagerAwareInterface
     */
    public function getList( $orderBy=null, $limit=self::DEFAULT_LIMIT, $offset=self::DEFAULT_OFFSET )
    {
        $key = Entity::getNodeParams($this->type)[0];
        list($key) = Entity::getNodeParams($this->type);
        return $this->search( "($key=*)", $orderBy, $limit, $offset );
    }

@@ -161,7 +161,7 @@ abstract class Service implements ServiceManagerAwareInterface
     */
    public function search( $filter, $orderBy=null, $limit=self::DEFAULT_LIMIT, $offset=self::DEFAULT_OFFSET )
    {
        $key = Entity::getNodeParams($this->type)[0];
        list($key) = Entity::getNodeParams($this->type);
        if ($limit < 0) $limit = 3999999999; // Limite maximum à 4 milliard...
        if ($offset < 0) $offset = 0; // Moins de zéro = impossible

@@ -186,7 +186,7 @@ abstract class Service implements ServiceManagerAwareInterface
            $i = 0;
            ErrorHandler::start(E_WARNING);
            for ($entry=ldap_first_entry($resource,$search); $entry; $entry=ldap_next_entry($resource,$entry)) {
                $value = ldap_get_values_len($resource,$entry,$key)[0];
                list($value) = ldap_get_values_len($resource,$entry,$key);
                if (null !== $value){
                    $result[] = $value;
                    $i++;
@@ -233,7 +233,7 @@ abstract class Service implements ServiceManagerAwareInterface
     */
    public function searchAttributes( $filter, array $attributes, $orderBy=null, $limit=self::DEFAULT_LIMIT, $offset=self::DEFAULT_OFFSET )
    {
        $key = Entity::getNodeParams($this->type)[0];
        list($key) = Entity::getNodeParams($this->type);
        if ($limit < 0) $limit = 3999999999; // Limite maximum à 4 milliard...
        if ($offset < 0) $offset = 0; // Moins de zéro = impossible

@@ -259,7 +259,7 @@ abstract class Service implements ServiceManagerAwareInterface
            $i = 0;
            ErrorHandler::start(E_WARNING);
            for ($entry=ldap_first_entry($resource,$search); $entry; $entry=ldap_next_entry($resource,$entry)) {
                $id = ldap_get_values_len($resource,$entry,$key)[0];
                list($id) = ldap_get_values_len($resource,$entry,$key);
                $data = array();
                foreach( $attributes as $attribute ){
                    $attrValue = ldap_get_values_len($resource,$entry,$attribute);
@@ -378,7 +378,7 @@ abstract class Service implements ServiceManagerAwareInterface
     */
    public function get( $id )
    {
        $key = Entity::getNodeParams($this->type)[0];
        list($key) = Entity::getNodeParams($this->type);
        return $this->getBy( $id, $key );
    }

@@ -399,7 +399,7 @@ abstract class Service implements ServiceManagerAwareInterface
            $value = current($value);
        }

        $classname = Entity::getNodeParams($this->type)[1];
        list($tmp, $classname) = Entity::getNodeParams($this->type);
        list( $resource, $search ) = $this->__searchBegin( Filter::equals($by, $value), $this->ou, array('*','+') );
        $count = ldap_count_entries($resource, $search);
        switch( $count ){
@@ -428,7 +428,7 @@ abstract class Service implements ServiceManagerAwareInterface
     */
    public function getAll( $ids, $orderBy=null )
    {
        $key = Entity::getNodeParams($this->type)[0];
        list($key) = Entity::getNodeParams($this->type);
        return $this->getAllBy($ids, $key, $orderBy);
    }

@@ -472,7 +472,7 @@ abstract class Service implements ServiceManagerAwareInterface
     */
    public function exists( $id )
    {
        $key = Entity::getNodeParams($this->type)[0];
        list($key) = Entity::getNodeParams($this->type);
        return $this->existsBy($id, $key);
    }