From b44ba83e8edc706d2dfc63c874b105d23d57dfa0 Mon Sep 17 00:00:00 2001 From: Lorenzo Sapora Date: Mon, 16 Nov 2020 13:24:35 +0000 Subject: [PATCH] Cut unused functions You'll eat this dog food, and like it. --- FindUnusedClasses.php | 38 -------------------------------------- 1 file changed, 38 deletions(-) diff --git a/FindUnusedClasses.php b/FindUnusedClasses.php index b6082e1..766419b 100644 --- a/FindUnusedClasses.php +++ b/FindUnusedClasses.php @@ -92,42 +92,4 @@ public function isARegisteredController($className) { return in_array($className, $this->controllerNames); } - - public function ignoreCommonStuff($funcName, $fileName) - { - if ($funcName == 'handle' and preg_match('/(Middleware|Listeners|Commands)/', $fileName) === 1) { - return true; - } - if ($funcName == 'broadcastOn' and preg_match('/Events/', $fileName) === 1) { - return true; - } - - return in_array($funcName, $this->crudNames) and Str::contains($fileName, 'Controller'); - } - - public function shouldConsider($filename) - { - if (Str::contains($filename, 'ServiceProvider')) { - return false; - } - if (Str::contains($filename, 'Policies')) { - return false; - } - if (Str::contains($filename, 'Observers')) { - return false; - } - return true; - } - - protected function mangleLaravelNames($fName) - { - $match = ''; - if (preg_match('/^scope(.+$)/', $fName, $match) === 1) { - return Str::camel($match[1]); - } - if (preg_match('/^(get|set)(.+)Attribute$/', $fName, $match) === 1) { - return Str::snake($match[2]); - } - return $fName; - } }