Code Duplication    Length = 18-18 lines in 2 locations

src/Model.php 2 locations

@@ 468-485 (lines=18) @@
465
     *
466
     * @return string|false method name if it exists
467
     */
468
    public static function getMutator($property)
469
    {
470
        $class = get_called_class();
471
472
        $k = $class.':'.$property;
473
        if (!array_key_exists($k, self::$mutators)) {
474
            $inflector = Inflector::get();
475
            $method = 'set'.$inflector->camelize($property).'Value';
476
477
            if (!method_exists($class, $method)) {
478
                $method = false;
479
            }
480
481
            self::$mutators[$k] = $method;
482
        }
483
484
        return self::$mutators[$k];
485
    }
486
487
    /**
488
     * Gets the accessor method name for a given proeprty name.
@@ 496-513 (lines=18) @@
493
     *
494
     * @return string|false method name if it exists
495
     */
496
    public static function getAccessor($property)
497
    {
498
        $class = get_called_class();
499
500
        $k = $class.':'.$property;
501
        if (!array_key_exists($k, self::$accessors)) {
502
            $inflector = Inflector::get();
503
            $method = 'get'.$inflector->camelize($property).'Value';
504
505
            if (!method_exists($class, $method)) {
506
                $method = false;
507
            }
508
509
            self::$accessors[$k] = $method;
510
        }
511
512
        return self::$accessors[$k];
513
    }
514
515
    /**
516
     * Checks if a given property is a relationship.