-
Notifications
You must be signed in to change notification settings - Fork 74
Expand file tree
/
Copy pathclassconstant.js
More file actions
43 lines (40 loc) · 1.05 KB
/
classconstant.js
File metadata and controls
43 lines (40 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/**
* Copyright (C) 2018 Glayzzle (BSD3 License)
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
* @url http://glayzzle.com
*/
"use strict";
const ConstantStatement = require("./constantstatement");
const KIND = "classconstant";
/**
* Defines a class/interface/trait constant
* @constructor ClassConstant
* @memberOf module:php-parser
* @extends {ConstantStatement}
* @property {string} visibility
* @property {boolean} final
* @property {boolean} nullable
* @property {TypeReference|IntersectionType|UnionType|null} type
* @property {AttrGroup[]} attrGroups
*/
const ClassConstant = ConstantStatement.extends(
KIND,
function ClassConstant(
kind,
constants,
flags,
nullable,
type,
attrGroups,
docs,
location,
) {
ConstantStatement.apply(this, [kind || KIND, constants, docs, location]);
this.nullable = nullable;
this.type = type;
this.attrGroups = attrGroups;
this.visibility = flags.compute_visibility;
this.final = flags.isFinal;
},
);
module.exports = ClassConstant;