Exemplo n.º 1
0
 /**
  * @inheritdoc
  */
 public function verify(Node $node) : AbstractRuleResult
 {
     if ($node instanceof ClassMethod && self::isMagic($node->name)) {
         return $this->ok($node);
     }
     $type = $node instanceof Function_ ? 'function' : 'method';
     $isCamelCase = isCamelCase($node->name);
     if ($isCamelCase) {
         return $this->ok($node);
     }
     $title = "Wrong {$type} name: " . $node->name;
     $description = ucfirst($type) . ' names must be declared in camelCase.';
     return $this->warning($title, $description, $node);
 }
 /**
  * @dataProvider provideIsCamelCaseData
  */
 public function testIsCamelCase($input, $expected)
 {
     $actual = isCamelCase($input);
     $this->assertEquals($expected, $actual);
 }