public function apply($testable, array $config = array()) {
		$message = '{:name} has no declared visibility.';
		$tokens = $testable->tokens();
		$classes = $testable->findAll(array(T_CLASS));
		$filtered = $testable->findAll($this->inspectableTokens);

		foreach ($classes as $classId) {
			$children = $tokens[$classId]['children'];
			foreach ($children as $member) {
				if (!in_array($member, $filtered)) {
					continue;
				}
				$modifiers = Parser::modifiers($member, $tokens);
				$visibility = $testable->findNext($this->findTokens, $modifiers);
				if ($visibility === false) {
					$token = $tokens[$member];
					$this->addViolation(array(
						'modifiers' => $modifiers,
						'message' => String::insert($message, $token),
						'line' => $token['line'],
					));
				}
			}
		}
	}
public function apply($testable, array $config = array()) {
		$message = '{:name} has no declared visibility.';
		$tokens = $testable->tokens();
		$classes = $testable->findAll(array(T_CLASS));
		$filtered = $testable->findAll($this->inspectableTokens);

		foreach ($classes as $classId) {
			$children = $tokens[$classId]['children'];
			foreach ($children as $member) {
				if (!in_array($member, $filtered)) {
					continue;
				}
				$modifiers = Parser::modifiers($member, $tokens);
				$visibility = $testable->findNext($this->findTokens, $modifiers);
				if ($visibility === false) {
					$token = $tokens[$member];
					$this->addViolation(array(
						'modifiers' => $modifiers,
						'message' => String::insert($message, $token),
						'line' => $token['line'],
					));
				}
			}
		}
	}
public function apply ( $ testable , array $ config = array ( ) ) { $ message = '{:name} has no declared visibility.' ; $ tokens = $ testable -> tokens ( ) ; $ classes = $ testable -> findAll ( array ( T_CLASS ) ) ; $ filtered = $ testable -> findAll ( $ this -> inspectableTokens ) ; foreach ( $ classes as $ classId ) { $ children = $ tokens [ $ classId ] [ 'children' ] ; foreach ( $ children as $ member ) { if ( ! in_array ( $ member , $ filtered ) ) { continue ; } $ modifiers = Parser :: modifiers ( $ member , $ tokens ) ; $ visibility = $ testable -> findNext ( $ this -> findTokens , $ modifiers ) ; if ( $ visibility === false ) { $ token = $ tokens [ $ member ] ; $ this -> addViolation ( array ( 'modifiers' => $ modifiers , 'message' => String :: insert ( $ message , $ token ) , 'line' => $ token [ 'line' ] , ) ) ; } } } }
Will iterate all the tokens looking for tokens in inspectableTokens
The token needs an access modifier if it is a T_FUNCTION or T_VARIABLE
and is in the first level of T_CLASS. This prevents functions and variables
inside methods and outside classes to register violations.

@param  Testable $testable The testable object
@return void
Will iterate all the tokens looking for tokens in inspectableTokens The token needs an access modifier if it is a T_FUNCTION or T_VARIABLE and is in the first level of T_CLASS . This prevents functions and variables inside methods and outside classes to register violations .