Code Duplication    Length = 18-18 lines in 2 locations

src/Model.php 2 locations

@@ 597-614 (lines=18) @@
594
     *
595
     * @return string|false method name if it exists
596
     */
597
    public static function getMutator($property)
598
    {
599
        $class = get_called_class();
600
601
        $k = $class.':'.$property;
602
        if (!array_key_exists($k, self::$mutators)) {
603
            $inflector = Inflector::get();
604
            $method = 'set'.$inflector->camelize($property).'Value';
605
606
            if (!method_exists($class, $method)) {
607
                $method = false;
608
            }
609
610
            self::$mutators[$k] = $method;
611
        }
612
613
        return self::$mutators[$k];
614
    }
615
616
    /**
617
     * Gets the accessor method name for a given proeprty name.
@@ 625-642 (lines=18) @@
622
     *
623
     * @return string|false method name if it exists
624
     */
625
    public static function getAccessor($property)
626
    {
627
        $class = get_called_class();
628
629
        $k = $class.':'.$property;
630
        if (!array_key_exists($k, self::$accessors)) {
631
            $inflector = Inflector::get();
632
            $method = 'get'.$inflector->camelize($property).'Value';
633
634
            if (!method_exists($class, $method)) {
635
                $method = false;
636
            }
637
638
            self::$accessors[$k] = $method;
639
        }
640
641
        return self::$accessors[$k];
642
    }
643
644
    /**
645
     * Marshals a value for a given property from storage.