Code Duplication    Length = 14-14 lines in 2 locations

src/MetaDataHelper.php 2 locations

@@ 80-93 (lines=14) @@
77
     * @param string $className
78
     * @return array[]
79
     */
80
    public function methodsMeta(string $className) : array
81
    {
82
        if(!isset($this->cache[$className][__METHOD__])) {
83
            $this->cache[$className][__METHOD__] = [];
84
            $classReflector = new \ReflectionClass($className);
85
            foreach($classReflector->getMethods(\ReflectionMethod::IS_PUBLIC) as $line) {
86
                if(!$line->isStatic()) {
87
                    $doc = $line->getDocComment();
88
                    $this->cache[$className][__METHOD__][$line->name] = StrHelper::parseDocComment($doc);
89
                }
90
            }
91
        }
92
        return $this->cache[$className][__METHOD__];
93
    }
94
95
    /**
96
     * Get methods rules
@@ 116-129 (lines=14) @@
113
     * @param string $className
114
     * @return array
115
     */
116
    public function fieldsMeta(string $className) : array
117
    {
118
        if(!isset($this->cache[$className][__METHOD__])) {
119
            $this->cache[$className][__METHOD__] = [];
120
            $classReflector = new \ReflectionClass($className);
121
            foreach($classReflector->getProperties(\ReflectionProperty::IS_PUBLIC) as $line) {
122
                if(!$line->isStatic()) {
123
                    $doc = $line->getDocComment();
124
                    $this->cache[$className][__METHOD__][$line->name] = StrHelper::parseDocComment($doc);
125
                }
126
            }
127
        }
128
        return $this->cache[$className][__METHOD__];
129
    }
130
131
    /**
132
     * Get fields rules