Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 10... Línea 10...
10
use Laravel\SerializableClosure\Support\ClosureStream;
10
use Laravel\SerializableClosure\Support\ClosureStream;
11
use Laravel\SerializableClosure\Support\ReflectionClosure;
11
use Laravel\SerializableClosure\Support\ReflectionClosure;
12
use Laravel\SerializableClosure\Support\SelfReference;
12
use Laravel\SerializableClosure\Support\SelfReference;
13
use Laravel\SerializableClosure\UnsignedSerializableClosure;
13
use Laravel\SerializableClosure\UnsignedSerializableClosure;
14
use ReflectionObject;
14
use ReflectionObject;
-
 
15
use ReflectionProperty;
15
use UnitEnum;
16
use UnitEnum;
Línea 16... Línea 17...
16
 
17
 
17
class Native implements Serializable
18
class Native implements Serializable
18
{
19
{
Línea 272... Línea 273...
272
                        continue;
273
                        continue;
273
                    }
274
                    }
Línea 274... Línea 275...
274
 
275
 
Línea 275... Línea 276...
275
                    $property->setAccessible(true);
276
                    $property->setAccessible(true);
276
 
277
 
277
                    if (PHP_VERSION >= 7.4 && ! $property->isInitialized($instance)) {
278
                    if (! $property->isInitialized($instance)) {
Línea 278... Línea 279...
278
                        continue;
279
                        continue;
Línea 372... Línea 373...
372
                        continue;
373
                        continue;
373
                    }
374
                    }
Línea 374... Línea 375...
374
 
375
 
Línea 375... Línea 376...
375
                    $property->setAccessible(true);
376
                    $property->setAccessible(true);
376
 
377
 
377
                    if (PHP_VERSION >= 7.4 && ! $property->isInitialized($data)) {
378
                    if (! $property->isInitialized($data) || $property->isReadOnly()) {
Línea 378... Línea 379...
378
                        continue;
379
                        continue;
Línea 488... Línea 489...
488
                if (! $reflection->isUserDefined()) {
489
                if (! $reflection->isUserDefined()) {
489
                    break;
490
                    break;
490
                }
491
                }
Línea 491... Línea 492...
491
 
492
 
492
                foreach ($reflection->getProperties() as $property) {
493
                foreach ($reflection->getProperties() as $property) {
493
                    if ($property->isStatic() || ! $property->getDeclaringClass()->isUserDefined()) {
494
                    if ($property->isStatic() || ! $property->getDeclaringClass()->isUserDefined() || $this->isVirtualProperty($property)) {
494
                        continue;
495
                        continue;
Línea 495... Línea 496...
495
                    }
496
                    }
Línea 496... Línea 497...
496
 
497
 
497
                    $property->setAccessible(true);
498
                    $property->setAccessible(true);
498
 
499
 
Línea 499... Línea 500...
499
                    if (PHP_VERSION >= 7.4 && ! $property->isInitialized($instance)) {
500
                    if (! $property->isInitialized($instance) || ($property->isReadOnly() && $property->class !== $reflection->name)) {
Línea 509... Línea 510...
509
                    $property->setValue($data, $value);
510
                    $property->setValue($data, $value);
510
                }
511
                }
511
            } while ($reflection = $reflection->getParentClass());
512
            } while ($reflection = $reflection->getParentClass());
512
        }
513
        }
513
    }
514
    }
-
 
515
 
-
 
516
    /**
-
 
517
     * Determine is virtual property.
-
 
518
     *
-
 
519
     * @param  \ReflectionProperty  $property
-
 
520
     * @return bool
-
 
521
     */
-
 
522
    protected function isVirtualProperty(ReflectionProperty $property): bool
-
 
523
    {
-
 
524
        return method_exists($property, 'isVirtual') && $property->isVirtual();
-
 
525
    }
514
}
526
}