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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Rotua Panjaitan
yii2
Commits
8701d7df
Commit
8701d7df
authored
Jul 29, 2014
by
Carsten Brandt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more explicit comment in phpdoc, code style
parent
74c99dc9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
15 deletions
+3
-15
Component.php
framework/base/Component.php
+2
-15
TimestampBehavior.php
framework/behaviors/TimestampBehavior.php
+1
-0
No files found.
framework/base/Component.php
View file @
8701d7df
...
...
@@ -102,10 +102,11 @@ class Component extends Object
*/
private
$_events
=
[];
/**
* @var Behavior[]
the attached behaviors (behavior name => behavior)
* @var Behavior[]
|null the attached behaviors (behavior name => behavior). This is `null` when not initialized.
*/
private
$_behaviors
;
/**
* Returns the value of a component property.
* This method will check in the following order and act accordingly:
...
...
@@ -223,7 +224,6 @@ class Component extends Object
}
}
}
return
false
;
}
...
...
@@ -244,7 +244,6 @@ class Component extends Object
$setter
=
'set'
.
$name
;
if
(
method_exists
(
$this
,
$setter
))
{
$this
->
$setter
(
null
);
return
;
}
else
{
// behavior property
...
...
@@ -252,7 +251,6 @@ class Component extends Object
foreach
(
$this
->
_behaviors
as
$behavior
)
{
if
(
$behavior
->
canSetProperty
(
$name
))
{
$behavior
->
$name
=
null
;
return
;
}
}
...
...
@@ -281,7 +279,6 @@ class Component extends Object
return
call_user_func_array
([
$object
,
$name
],
$params
);
}
}
throw
new
UnknownMethodException
(
'Calling unknown method: '
.
get_class
(
$this
)
.
"::
$name
()"
);
}
...
...
@@ -343,7 +340,6 @@ class Component extends Object
}
}
}
return
false
;
}
...
...
@@ -374,7 +370,6 @@ class Component extends Object
}
}
}
return
false
;
}
...
...
@@ -401,7 +396,6 @@ class Component extends Object
}
}
}
return
false
;
}
...
...
@@ -444,7 +438,6 @@ class Component extends Object
public
function
hasEventHandlers
(
$name
)
{
$this
->
ensureBehaviors
();
return
!
empty
(
$this
->
_events
[
$name
])
||
Event
::
hasHandlers
(
$this
,
$name
);
}
...
...
@@ -517,7 +510,6 @@ class Component extends Object
if
(
$removed
)
{
$this
->
_events
[
$name
]
=
array_values
(
$this
->
_events
[
$name
]);
}
return
$removed
;
}
}
...
...
@@ -562,7 +554,6 @@ class Component extends Object
public
function
getBehavior
(
$name
)
{
$this
->
ensureBehaviors
();
return
isset
(
$this
->
_behaviors
[
$name
])
?
$this
->
_behaviors
[
$name
]
:
null
;
}
...
...
@@ -573,7 +564,6 @@ class Component extends Object
public
function
getBehaviors
()
{
$this
->
ensureBehaviors
();
return
$this
->
_behaviors
;
}
...
...
@@ -595,7 +585,6 @@ class Component extends Object
public
function
attachBehavior
(
$name
,
$behavior
)
{
$this
->
ensureBehaviors
();
return
$this
->
attachBehaviorInternal
(
$name
,
$behavior
);
}
...
...
@@ -627,7 +616,6 @@ class Component extends Object
$behavior
=
$this
->
_behaviors
[
$name
];
unset
(
$this
->
_behaviors
[
$name
]);
$behavior
->
detach
();
return
$behavior
;
}
else
{
return
null
;
...
...
@@ -681,7 +669,6 @@ class Component extends Object
$behavior
->
attach
(
$this
);
$this
->
_behaviors
[
$name
]
=
$behavior
;
}
return
$behavior
;
}
}
framework/behaviors/TimestampBehavior.php
View file @
8701d7df
...
...
@@ -78,6 +78,7 @@ class TimestampBehavior extends AttributeBehavior
*/
public
$value
;
/**
* @inheritdoc
*/
...
...
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