Skip to content

Introduced ClassLike Interface #172

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/ClassLike.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

namespace Microsoft\PhpParser;

/**
* Represents Classes, Interfaces and Traits.
*/
interface ClassLike {}
3 changes: 2 additions & 1 deletion src/Node/Statement/ClassDeclaration.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

namespace Microsoft\PhpParser\Node\Statement;

use Microsoft\PhpParser\ClassLike;
use Microsoft\PhpParser\NamespacedNameInterface;
use Microsoft\PhpParser\NamespacedNameTrait;
use Microsoft\PhpParser\Node\ClassBaseClause;
Expand All @@ -14,7 +15,7 @@
use Microsoft\PhpParser\Node\StatementNode;
use Microsoft\PhpParser\Token;

class ClassDeclaration extends StatementNode implements NamespacedNameInterface {
class ClassDeclaration extends StatementNode implements NamespacedNameInterface, ClassLike {
use NamespacedNameTrait;

/** @var Token */
Expand Down
3 changes: 2 additions & 1 deletion src/Node/Statement/InterfaceDeclaration.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@

namespace Microsoft\PhpParser\Node\Statement;

use Microsoft\PhpParser\ClassLike;
use Microsoft\PhpParser\NamespacedNameInterface;
use Microsoft\PhpParser\NamespacedNameTrait;
use Microsoft\PhpParser\Node\InterfaceBaseClause;
use Microsoft\PhpParser\Node\InterfaceMembers;
use Microsoft\PhpParser\Node\StatementNode;
use Microsoft\PhpParser\Token;

class InterfaceDeclaration extends StatementNode implements NamespacedNameInterface {
class InterfaceDeclaration extends StatementNode implements NamespacedNameInterface, ClassLike {
use NamespacedNameTrait;

/** @var Token */
Expand Down
3 changes: 2 additions & 1 deletion src/Node/Statement/TraitDeclaration.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@

namespace Microsoft\PhpParser\Node\Statement;

use Microsoft\PhpParser\ClassLike;
use Microsoft\PhpParser\NamespacedNameInterface;
use Microsoft\PhpParser\NamespacedNameTrait;
use Microsoft\PhpParser\Node\StatementNode;
use Microsoft\PhpParser\Node\TraitMembers;
use Microsoft\PhpParser\Token;

class TraitDeclaration extends StatementNode implements NamespacedNameInterface {
class TraitDeclaration extends StatementNode implements NamespacedNameInterface, ClassLike {
use NamespacedNameTrait;

/** @var Token */
Expand Down