mirror of
https://github.com/phabelio/PHP-Parser.git
synced 2024-11-26 20:14:46 +01:00
[CS] Open class brackets in new line
This commit is contained in:
parent
fc8ac71e76
commit
7f72c84122
@ -7,7 +7,8 @@ use PhpParser\BuilderHelpers;
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Stmt;
|
||||
|
||||
class Use_ implements Builder {
|
||||
class Use_ implements Builder
|
||||
{
|
||||
protected $name;
|
||||
protected $type;
|
||||
protected $alias = null;
|
||||
|
@ -14,7 +14,8 @@ use PhpParser\Node\Stmt;
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
final class BuilderHelpers {
|
||||
final class BuilderHelpers
|
||||
{
|
||||
/**
|
||||
* Normalizes a node: Converts builder objects to nodes.
|
||||
*
|
||||
|
@ -2,4 +2,5 @@
|
||||
|
||||
namespace PhpParser;
|
||||
|
||||
class ConstExprEvaluationException extends \Exception {}
|
||||
class ConstExprEvaluationException extends \Exception
|
||||
{}
|
@ -28,7 +28,8 @@ use PhpParser\Node\Scalar;
|
||||
* point to string conversions are affected by the precision ini setting. Secondly, they are also
|
||||
* affected by the LC_NUMERIC locale.
|
||||
*/
|
||||
class ConstExprEvaluator {
|
||||
class ConstExprEvaluator
|
||||
{
|
||||
private $fallbackEvaluator;
|
||||
|
||||
/**
|
||||
|
@ -5,7 +5,8 @@ namespace PhpParser\Internal;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
class DiffElem {
|
||||
class DiffElem
|
||||
{
|
||||
const TYPE_KEEP = 0;
|
||||
const TYPE_REMOVE = 1;
|
||||
const TYPE_ADD = 2;
|
||||
|
@ -10,7 +10,8 @@ namespace PhpParser\Internal;
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
class Differ {
|
||||
class Differ
|
||||
{
|
||||
private $isEqual;
|
||||
|
||||
/**
|
||||
|
@ -15,7 +15,8 @@ use PhpParser\Node\Expr;
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
class PrintableNewAnonClassNode extends Expr {
|
||||
class PrintableNewAnonClassNode extends Expr
|
||||
{
|
||||
/** @var Node\Arg[] Arguments */
|
||||
public $args;
|
||||
/** @var null|Node\Name Name of extended class */
|
||||
|
@ -2,7 +2,8 @@
|
||||
|
||||
namespace PhpParser;
|
||||
|
||||
class JsonDecoder {
|
||||
class JsonDecoder
|
||||
{
|
||||
/** @var \ReflectionClass[] Node type to reflection class map */
|
||||
private $reflectionClassCache;
|
||||
|
||||
|
@ -6,7 +6,8 @@ use PhpParser\Node\Name;
|
||||
use PhpParser\Node\Name\FullyQualified;
|
||||
use PhpParser\Node\Stmt;
|
||||
|
||||
class NameContext {
|
||||
class NameContext
|
||||
{
|
||||
/** @var null|Name Current namespace */
|
||||
protected $namespace;
|
||||
|
||||
|
@ -7,7 +7,8 @@ use PhpParser\Node;
|
||||
/**
|
||||
* @property Node\Name $namespacedName Namespaced name (if using NameResolver)
|
||||
*/
|
||||
abstract class ClassLike extends Node\Stmt {
|
||||
abstract class ClassLike extends Node\Stmt
|
||||
{
|
||||
/** @var Node\Identifier|null Name */
|
||||
public $name;
|
||||
/** @var Node\Stmt[] Statements */
|
||||
|
@ -5,7 +5,8 @@ namespace PhpParser;
|
||||
use PhpParser\NodeVisitor\FindingVisitor;
|
||||
use PhpParser\NodeVisitor\FirstFindingVisitor;
|
||||
|
||||
class NodeFinder {
|
||||
class NodeFinder
|
||||
{
|
||||
/**
|
||||
* Find all nodes satisfying a filter callback.
|
||||
*
|
||||
|
@ -10,7 +10,8 @@ use PhpParser\NodeVisitorAbstract;
|
||||
*
|
||||
* This visitor is required to perform format-preserving pretty prints.
|
||||
*/
|
||||
class CloningVisitor extends NodeVisitorAbstract {
|
||||
class CloningVisitor extends NodeVisitorAbstract
|
||||
{
|
||||
public function enterNode(Node $origNode) {
|
||||
$node = clone $origNode;
|
||||
$node->setAttribute('origNode', $origNode);
|
||||
|
@ -9,7 +9,8 @@ use PhpParser\NodeVisitorAbstract;
|
||||
* This visitor can be used to find and collect all nodes satisfying some criterion determined by
|
||||
* a filter callback.
|
||||
*/
|
||||
class FindingVisitor extends NodeVisitorAbstract {
|
||||
class FindingVisitor extends NodeVisitorAbstract
|
||||
{
|
||||
/** @var callable Filter callback */
|
||||
protected $filterCallback;
|
||||
/** @var Node[] Found nodes */
|
||||
|
@ -10,7 +10,8 @@ use PhpParser\NodeVisitorAbstract;
|
||||
* This visitor can be used to find the first node satisfying some criterion determined by
|
||||
* a filter callback.
|
||||
*/
|
||||
class FirstFindingVisitor extends NodeVisitorAbstract {
|
||||
class FirstFindingVisitor extends NodeVisitorAbstract
|
||||
{
|
||||
/** @var callable Filter callback */
|
||||
protected $filterCallback;
|
||||
/** @var null|Node Found node */
|
||||
|
@ -2,7 +2,8 @@
|
||||
|
||||
namespace PhpParser;
|
||||
|
||||
interface Parser {
|
||||
interface Parser
|
||||
{
|
||||
/**
|
||||
* Parses PHP code into a node tree.
|
||||
*
|
||||
|
@ -6,7 +6,8 @@ use PhpParser\Error;
|
||||
use PhpParser\ErrorHandler;
|
||||
use PhpParser\Parser;
|
||||
|
||||
class Multiple implements Parser {
|
||||
class Multiple implements Parser
|
||||
{
|
||||
/** @var Parser[] List of parsers to try, in order of preference */
|
||||
private $parsers;
|
||||
|
||||
|
@ -2,7 +2,8 @@
|
||||
|
||||
namespace PhpParser;
|
||||
|
||||
class ParserFactory {
|
||||
class ParserFactory
|
||||
{
|
||||
const PREFER_PHP7 = 1;
|
||||
const PREFER_PHP5 = 2;
|
||||
const ONLY_PHP7 = 3;
|
||||
|
@ -7,7 +7,8 @@ namespace PhpParser;
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
class TokenStream {
|
||||
class TokenStream
|
||||
{
|
||||
/** @var array Tokens (in token_get_all format) */
|
||||
private $tokens;
|
||||
/** @var int[] Map from position to indentation */
|
||||
|
@ -2,7 +2,8 @@
|
||||
|
||||
namespace PhpParser;
|
||||
|
||||
class CodeTestParser {
|
||||
class CodeTestParser
|
||||
{
|
||||
public function parseTest($code, $chunksPerTest) {
|
||||
$code = canonicalize($code);
|
||||
|
||||
|
@ -6,7 +6,8 @@ use PhpParser\Node\Expr;
|
||||
use PhpParser\Node\Scalar;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class ConstExprEvaluatorTest extends TestCase {
|
||||
class ConstExprEvaluatorTest extends TestCase
|
||||
{
|
||||
/** @dataProvider provideTestEvaluate */
|
||||
public function testEvaluate($exprString, $expected) {
|
||||
$parser = new Parser\Php7(new Lexer());
|
||||
|
@ -4,7 +4,8 @@ namespace PhpParser\Internal;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class DifferTest extends TestCase {
|
||||
class DifferTest extends TestCase
|
||||
{
|
||||
private function formatDiffString(array $diff) {
|
||||
$diffStr = '';
|
||||
foreach ($diff as $diffElem) {
|
||||
|
@ -4,7 +4,8 @@ namespace PhpParser;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class JsonDecoderTest extends TestCase {
|
||||
class JsonDecoderTest extends TestCase
|
||||
{
|
||||
public function testRoundTrip() {
|
||||
$code = <<<'PHP'
|
||||
<?php
|
||||
|
@ -6,7 +6,8 @@ use PhpParser\Node\Name;
|
||||
use PhpParser\Node\Stmt\Use_;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class NameContextTest extends TestCase {
|
||||
class NameContextTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @dataProvider provideTestGetPossibleNames
|
||||
*/
|
||||
|
@ -4,7 +4,8 @@ namespace PhpParser\Node;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class IdentifierTest extends TestCase {
|
||||
class IdentifierTest extends TestCase
|
||||
{
|
||||
public function testToString() {
|
||||
$identifier = new Identifier('Foo');
|
||||
|
||||
|
@ -4,7 +4,8 @@ namespace PhpParser;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class DummyNode extends NodeAbstract {
|
||||
class DummyNode extends NodeAbstract
|
||||
{
|
||||
public $subNode1;
|
||||
public $subNode2;
|
||||
|
||||
|
@ -11,7 +11,8 @@ use PhpParser\ParserTest;
|
||||
|
||||
require_once __DIR__ . '/../ParserTest.php';
|
||||
|
||||
class MultipleTest extends ParserTest {
|
||||
class MultipleTest extends ParserTest
|
||||
{
|
||||
// This provider is for the generic parser tests, just pick an arbitrary order here
|
||||
protected function getParser(Lexer $lexer) {
|
||||
return new Multiple([new Php5($lexer), new Php7($lexer)]);
|
||||
|
@ -7,7 +7,8 @@ use PhpParser\ParserTest;
|
||||
|
||||
require_once __DIR__ . '/../ParserTest.php';
|
||||
|
||||
class Php5Test extends ParserTest {
|
||||
class Php5Test extends ParserTest
|
||||
{
|
||||
protected function getParser(Lexer $lexer) {
|
||||
return new Php5($lexer);
|
||||
}
|
||||
|
@ -7,7 +7,8 @@ use PhpParser\ParserTest;
|
||||
|
||||
require_once __DIR__ . '/../ParserTest.php';
|
||||
|
||||
class Php7Test extends ParserTest {
|
||||
class Php7Test extends ParserTest
|
||||
{
|
||||
protected function getParser(Lexer $lexer) {
|
||||
return new Php7($lexer);
|
||||
}
|
||||
|
@ -175,7 +175,8 @@ EOC;
|
||||
}
|
||||
}
|
||||
|
||||
class InvalidTokenLexer extends Lexer {
|
||||
class InvalidTokenLexer extends Lexer
|
||||
{
|
||||
public function getNextToken(&$value = null, &$startAttributes = null, &$endAttributes = null) : int {
|
||||
$value = 'foobar';
|
||||
return 999;
|
||||
|
Loading…
Reference in New Issue
Block a user