Add methods visibility (#464)

* [PSR-2] Visibility before static

* [PSR-2] Declare method Visibility
This commit is contained in:
Gabriel Caruso 2018-01-10 16:07:41 -02:00 committed by Nikita Popov
parent 248b29ecf6
commit bf7d811cda
2 changed files with 5 additions and 6 deletions

View File

@ -15,7 +15,7 @@ class Autoloader
* *
* @param bool $prepend Whether to prepend the autoloader instead of appending * @param bool $prepend Whether to prepend the autoloader instead of appending
*/ */
static public function register(bool $prepend = false) { public static function register(bool $prepend = false) {
if (self::$registered === true) { if (self::$registered === true) {
return; return;
} }
@ -29,7 +29,7 @@ class Autoloader
* *
* @param string $class A class name. * @param string $class A class name.
*/ */
static public function autoload(string $class) { public static function autoload(string $class) {
if (0 === strpos($class, 'PhpParser\\')) { if (0 === strpos($class, 'PhpParser\\')) {
$fileName = __DIR__ . strtr(substr($class, 9), '\\', '/') . '.php'; $fileName = __DIR__ . strtr(substr($class, 9), '\\', '/') . '.php';
if (file_exists($fileName)) { if (file_exists($fileName)) {

View File

@ -9,14 +9,14 @@ interface NodeTraverserInterface
* *
* @param NodeVisitor $visitor Visitor to add * @param NodeVisitor $visitor Visitor to add
*/ */
function addVisitor(NodeVisitor $visitor); public function addVisitor(NodeVisitor $visitor);
/** /**
* Removes an added visitor. * Removes an added visitor.
* *
* @param NodeVisitor $visitor * @param NodeVisitor $visitor
*/ */
function removeVisitor(NodeVisitor $visitor); public function removeVisitor(NodeVisitor $visitor);
/** /**
* Traverses an array of nodes using the registered visitors. * Traverses an array of nodes using the registered visitors.
@ -25,6 +25,5 @@ interface NodeTraverserInterface
* *
* @return Node[] Traversed array of nodes * @return Node[] Traversed array of nodes
*/ */
function traverse(array $nodes) : array; public function traverse(array $nodes) : array;
} }