Code Duplication    Length = 18-18 lines in 2 locations

src/Model.php 2 locations

@@ 451-468 (lines=18) @@
448
     *
449
     * @return string|false method name if it exists
450
     */
451
    public static function getMutator($property)
452
    {
453
        $class = get_called_class();
454
455
        $k = $class.':'.$property;
456
        if (!array_key_exists($k, self::$mutators)) {
457
            $inflector = Inflector::get();
458
            $method = 'set'.$inflector->camelize($property).'Value';
459
460
            if (!method_exists($class, $method)) {
461
                $method = false;
462
            }
463
464
            self::$mutators[$k] = $method;
465
        }
466
467
        return self::$mutators[$k];
468
    }
469
470
    /**
471
     * Gets the accessor method name for a given proeprty name.
@@ 479-496 (lines=18) @@
476
     *
477
     * @return string|false method name if it exists
478
     */
479
    public static function getAccessor($property)
480
    {
481
        $class = get_called_class();
482
483
        $k = $class.':'.$property;
484
        if (!array_key_exists($k, self::$accessors)) {
485
            $inflector = Inflector::get();
486
            $method = 'get'.$inflector->camelize($property).'Value';
487
488
            if (!method_exists($class, $method)) {
489
                $method = false;
490
            }
491
492
            self::$accessors[$k] = $method;
493
        }
494
495
        return self::$accessors[$k];
496
    }
497
498
    /**
499
     * Checks if a given property is a relationship.