// Get method properties $properties = $phpcsFile->getMethodProperties($methodStart, $methodEnd); // Check if method is public if ($properties['visibility'] === 'public') { echo "Method is public"; }In this example, we use the getMethodProperties method to retrieve the properties of a method in a PHP file. We then check if the method is public by checking the value of the ‘visibility’ key in the properties array. The package library for this code is PHP_CodeSniffer.