xref: /imagick/util/analyze_params.php (revision d17fb225)
1<?php
2
3declare(strict_types = 1);
4
5
6$classes = [
7    'Imagick',
8    'ImagickDraw',
9    'ImagickPixel',
10    'ImagickKernel'
11];
12
13
14foreach ($classes as $class) {
15    $nameCounts = [];
16
17
18    echo "class = $class \n";
19
20    $classReflection = new ReflectionClass($class);
21    $classMethods = $classReflection->getMethods();
22
23    foreach ($classMethods as $imagickMethod) {
24        $parameters = $imagickMethod->getParameters();
25        foreach ($parameters as $parameter) {
26            $name = $parameter->getName();
27            $nameCounts[$name] = ($nameCounts[$name] ?? 0) + 1;
28        }
29    }
30
31
32    arsort($nameCounts);
33
34    foreach ($nameCounts as $name => $count) {
35        echo "$name: $count \n";
36    }
37
38    echo "\n\n";
39
40}
41
42