Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
b4944934
Commit
b4944934
authored
Jan 05, 2014
by
Carsten Brandt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ensure methods, properties and events to be unique
parent
da161734
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
16 deletions
+12
-16
ClassDoc.php
extensions/yii/apidoc/models/ClassDoc.php
+2
-2
Context.php
extensions/yii/apidoc/models/Context.php
+6
-10
TypeDoc.php
extensions/yii/apidoc/models/TypeDoc.php
+4
-4
No files found.
extensions/yii/apidoc/models/ClassDoc.php
View file @
b4944934
...
@@ -57,11 +57,11 @@ class ClassDoc extends TypeDoc
...
@@ -57,11 +57,11 @@ class ClassDoc extends TypeDoc
if
(
strncmp
(
$constantReflector
->
getShortName
(),
'EVENT_'
,
6
)
==
0
)
{
if
(
strncmp
(
$constantReflector
->
getShortName
(),
'EVENT_'
,
6
)
==
0
)
{
$event
=
new
EventDoc
(
$constantReflector
);
$event
=
new
EventDoc
(
$constantReflector
);
$event
->
definedBy
=
$this
->
name
;
$event
->
definedBy
=
$this
->
name
;
$this
->
events
[]
=
$event
;
$this
->
events
[
$event
->
name
]
=
$event
;
}
else
{
}
else
{
$constant
=
new
ConstDoc
(
$constantReflector
);
$constant
=
new
ConstDoc
(
$constantReflector
);
$constant
->
definedBy
=
$this
->
name
;
$constant
->
definedBy
=
$this
->
name
;
$this
->
constants
[]
=
$constant
;
$this
->
constants
[
$constant
->
name
]
=
$constant
;
}
}
}
}
}
}
...
...
extensions/yii/apidoc/models/Context.php
View file @
b4944934
...
@@ -132,8 +132,8 @@ class Context extends Component
...
@@ -132,8 +132,8 @@ class Context extends Component
if
(
isset
(
$this
->
traits
[
$trait
]))
{
if
(
isset
(
$this
->
traits
[
$trait
]))
{
$trait
=
$this
->
traits
[
$trait
];
$trait
=
$this
->
traits
[
$trait
];
$trait
->
usedBy
[]
=
$class
->
name
;
$trait
->
usedBy
[]
=
$class
->
name
;
$class
->
properties
=
array_merge
(
$trait
->
properties
,
$class
->
properties
);
// TODO make unique
$class
->
properties
=
array_merge
(
$trait
->
properties
,
$class
->
properties
);
$class
->
methods
=
array_merge
(
$trait
->
methods
,
$class
->
methods
);
// TODO make unique
$class
->
methods
=
array_merge
(
$trait
->
methods
,
$class
->
methods
);
}
}
}
}
}
}
...
@@ -153,10 +153,6 @@ class Context extends Component
...
@@ -153,10 +153,6 @@ class Context extends Component
$subclass
=
$this
->
classes
[
$subclass
];
$subclass
=
$this
->
classes
[
$subclass
];
$subclass
->
interfaces
=
array_unique
(
array_merge
(
$subclass
->
interfaces
,
$class
->
interfaces
));
$subclass
->
interfaces
=
array_unique
(
array_merge
(
$subclass
->
interfaces
,
$class
->
interfaces
));
$subclass
->
traits
=
array_unique
(
array_merge
(
$subclass
->
traits
,
$class
->
traits
));
$subclass
->
traits
=
array_unique
(
array_merge
(
$subclass
->
traits
,
$class
->
traits
));
$subclass
->
events
=
array_merge
(
$class
->
events
,
$subclass
->
events
);
// TODO make unique
$subclass
->
constants
=
array_merge
(
$class
->
constants
,
$subclass
->
constants
);
// TODO make unique
$subclass
->
properties
=
array_merge
(
$class
->
properties
,
$subclass
->
properties
);
// TODO make unique
$subclass
->
methods
=
array_merge
(
$class
->
methods
,
$subclass
->
methods
);
// TODO make unique
$this
->
updateSubclassInferfacesTraits
(
$subclass
);
$this
->
updateSubclassInferfacesTraits
(
$subclass
);
}
}
}
}
...
@@ -169,10 +165,10 @@ class Context extends Component
...
@@ -169,10 +165,10 @@ class Context extends Component
{
{
foreach
(
$class
->
subclasses
as
$subclass
)
{
foreach
(
$class
->
subclasses
as
$subclass
)
{
$subclass
=
$this
->
classes
[
$subclass
];
$subclass
=
$this
->
classes
[
$subclass
];
$subclass
->
events
=
array_merge
(
$class
->
events
,
$subclass
->
events
);
// TODO make unique
$subclass
->
events
=
array_merge
(
$class
->
events
,
$subclass
->
events
);
$subclass
->
constants
=
array_merge
(
$class
->
constants
,
$subclass
->
constants
);
// TODO make unique
$subclass
->
constants
=
array_merge
(
$class
->
constants
,
$subclass
->
constants
);
$subclass
->
properties
=
array_merge
(
$class
->
properties
,
$subclass
->
properties
);
// TODO make unique
$subclass
->
properties
=
array_merge
(
$class
->
properties
,
$subclass
->
properties
);
$subclass
->
methods
=
array_merge
(
$class
->
methods
,
$subclass
->
methods
);
// TODO make unique
$subclass
->
methods
=
array_merge
(
$class
->
methods
,
$subclass
->
methods
);
$this
->
updateSubclassInheritance
(
$subclass
);
$this
->
updateSubclassInheritance
(
$subclass
);
}
}
}
}
...
...
extensions/yii/apidoc/models/TypeDoc.php
View file @
b4944934
...
@@ -36,9 +36,9 @@ class TypeDoc extends BaseDoc
...
@@ -36,9 +36,9 @@ class TypeDoc extends BaseDoc
private
function
getFilteredMethods
(
$visibility
)
private
function
getFilteredMethods
(
$visibility
)
{
{
$methods
=
[];
$methods
=
[];
foreach
(
$this
->
methods
as
$method
)
{
foreach
(
$this
->
methods
as
$
name
=>
$
method
)
{
if
(
$method
->
visibility
==
$visibility
)
{
if
(
$method
->
visibility
==
$visibility
)
{
$methods
[]
=
$method
;
$methods
[
$name
]
=
$method
;
}
}
}
}
return
$methods
;
return
$methods
;
...
@@ -60,9 +60,9 @@ class TypeDoc extends BaseDoc
...
@@ -60,9 +60,9 @@ class TypeDoc extends BaseDoc
return
[];
return
[];
}
}
$properties
=
[];
$properties
=
[];
foreach
(
$this
->
properties
as
$property
)
{
foreach
(
$this
->
properties
as
$
name
=>
$
property
)
{
if
(
$property
->
visibility
==
$visibility
)
{
if
(
$property
->
visibility
==
$visibility
)
{
$properties
[]
=
$property
;
$properties
[
$name
]
=
$property
;
}
}
}
}
return
$properties
;
return
$properties
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment