Blame view

vendor/symfony/var-dumper/Caster/MongoCaster.php 1 KB
c4650843   Etienne Pallier   Ajout du dossier ...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\VarDumper\Caster;

use Symfony\Component\VarDumper\Cloner\Stub;

d06254b2   Etienne Pallier   bugfix plugin mig...
16
17
@trigger_error('The '.__NAMESPACE__.'\MongoCaster class is deprecated since Symfony 3.4 and will be removed in 4.0.', E_USER_DEPRECATED);

c4650843   Etienne Pallier   Ajout du dossier ...
18
/**
d06254b2   Etienne Pallier   bugfix plugin mig...
19
 * Casts classes from the MongoDb extension to array representation.
c4650843   Etienne Pallier   Ajout du dossier ...
20
 *
c4650843   Etienne Pallier   Ajout du dossier ...
21
 * @author Nicolas Grekas <p@tchwork.com>
d06254b2   Etienne Pallier   bugfix plugin mig...
22
23
 *
 * @deprecated since version 3.4, to be removed in 4.0.
c4650843   Etienne Pallier   Ajout du dossier ...
24
 */
d06254b2   Etienne Pallier   bugfix plugin mig...
25
class MongoCaster
c4650843   Etienne Pallier   Ajout du dossier ...
26
{
d06254b2   Etienne Pallier   bugfix plugin mig...
27
    public static function castCursor(\MongoCursorInterface $cursor, array $a, Stub $stub, $isNested)
c4650843   Etienne Pallier   Ajout du dossier ...
28
    {
d06254b2   Etienne Pallier   bugfix plugin mig...
29
30
31
32
33
34
        if ($info = $cursor->info()) {
            foreach ($info as $k => $v) {
                $a[Caster::PREFIX_VIRTUAL.$k] = $v;
            }
        }
        $a[Caster::PREFIX_VIRTUAL.'dead'] = $cursor->dead();
c4650843   Etienne Pallier   Ajout du dossier ...
35
36
37
38

        return $a;
    }
}