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
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
...
@@ -102,10 +102,11 @@ class Component extends Object
*/
*/
private
$_events
=
[];
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
;
private
$_behaviors
;
/**
/**
* Returns the value of a component property.
* Returns the value of a component property.
* This method will check in the following order and act accordingly:
* This method will check in the following order and act accordingly:
...
@@ -223,7 +224,6 @@ class Component extends Object
...
@@ -223,7 +224,6 @@ class Component extends Object
}
}
}
}
}
}
return
false
;
return
false
;
}
}
...
@@ -244,7 +244,6 @@ class Component extends Object
...
@@ -244,7 +244,6 @@ class Component extends Object
$setter
=
'set'
.
$name
;
$setter
=
'set'
.
$name
;
if
(
method_exists
(
$this
,
$setter
))
{
if
(
method_exists
(
$this
,
$setter
))
{
$this
->
$setter
(
null
);
$this
->
$setter
(
null
);
return
;
return
;
}
else
{
}
else
{
// behavior property
// behavior property
...
@@ -252,7 +251,6 @@ class Component extends Object
...
@@ -252,7 +251,6 @@ class Component extends Object
foreach
(
$this
->
_behaviors
as
$behavior
)
{
foreach
(
$this
->
_behaviors
as
$behavior
)
{
if
(
$behavior
->
canSetProperty
(
$name
))
{
if
(
$behavior
->
canSetProperty
(
$name
))
{
$behavior
->
$name
=
null
;
$behavior
->
$name
=
null
;
return
;
return
;
}
}
}
}
...
@@ -281,7 +279,6 @@ class Component extends Object
...
@@ -281,7 +279,6 @@ class Component extends Object
return
call_user_func_array
([
$object
,
$name
],
$params
);
return
call_user_func_array
([
$object
,
$name
],
$params
);
}
}
}
}
throw
new
UnknownMethodException
(
'Calling unknown method: '
.
get_class
(
$this
)
.
"::
$name
()"
);
throw
new
UnknownMethodException
(
'Calling unknown method: '
.
get_class
(
$this
)
.
"::
$name
()"
);
}
}
...
@@ -343,7 +340,6 @@ class Component extends Object
...
@@ -343,7 +340,6 @@ class Component extends Object
}
}
}
}
}
}
return
false
;
return
false
;
}
}
...
@@ -374,7 +370,6 @@ class Component extends Object
...
@@ -374,7 +370,6 @@ class Component extends Object
}
}
}
}
}
}
return
false
;
return
false
;
}
}
...
@@ -401,7 +396,6 @@ class Component extends Object
...
@@ -401,7 +396,6 @@ class Component extends Object
}
}
}
}
}
}
return
false
;
return
false
;
}
}
...
@@ -444,7 +438,6 @@ class Component extends Object
...
@@ -444,7 +438,6 @@ class Component extends Object
public
function
hasEventHandlers
(
$name
)
public
function
hasEventHandlers
(
$name
)
{
{
$this
->
ensureBehaviors
();
$this
->
ensureBehaviors
();
return
!
empty
(
$this
->
_events
[
$name
])
||
Event
::
hasHandlers
(
$this
,
$name
);
return
!
empty
(
$this
->
_events
[
$name
])
||
Event
::
hasHandlers
(
$this
,
$name
);
}
}
...
@@ -517,7 +510,6 @@ class Component extends Object
...
@@ -517,7 +510,6 @@ class Component extends Object
if
(
$removed
)
{
if
(
$removed
)
{
$this
->
_events
[
$name
]
=
array_values
(
$this
->
_events
[
$name
]);
$this
->
_events
[
$name
]
=
array_values
(
$this
->
_events
[
$name
]);
}
}
return
$removed
;
return
$removed
;
}
}
}
}
...
@@ -562,7 +554,6 @@ class Component extends Object
...
@@ -562,7 +554,6 @@ class Component extends Object
public
function
getBehavior
(
$name
)
public
function
getBehavior
(
$name
)
{
{
$this
->
ensureBehaviors
();
$this
->
ensureBehaviors
();
return
isset
(
$this
->
_behaviors
[
$name
])
?
$this
->
_behaviors
[
$name
]
:
null
;
return
isset
(
$this
->
_behaviors
[
$name
])
?
$this
->
_behaviors
[
$name
]
:
null
;
}
}
...
@@ -573,7 +564,6 @@ class Component extends Object
...
@@ -573,7 +564,6 @@ class Component extends Object
public
function
getBehaviors
()
public
function
getBehaviors
()
{
{
$this
->
ensureBehaviors
();
$this
->
ensureBehaviors
();
return
$this
->
_behaviors
;
return
$this
->
_behaviors
;
}
}
...
@@ -595,7 +585,6 @@ class Component extends Object
...
@@ -595,7 +585,6 @@ class Component extends Object
public
function
attachBehavior
(
$name
,
$behavior
)
public
function
attachBehavior
(
$name
,
$behavior
)
{
{
$this
->
ensureBehaviors
();
$this
->
ensureBehaviors
();
return
$this
->
attachBehaviorInternal
(
$name
,
$behavior
);
return
$this
->
attachBehaviorInternal
(
$name
,
$behavior
);
}
}
...
@@ -627,7 +616,6 @@ class Component extends Object
...
@@ -627,7 +616,6 @@ class Component extends Object
$behavior
=
$this
->
_behaviors
[
$name
];
$behavior
=
$this
->
_behaviors
[
$name
];
unset
(
$this
->
_behaviors
[
$name
]);
unset
(
$this
->
_behaviors
[
$name
]);
$behavior
->
detach
();
$behavior
->
detach
();
return
$behavior
;
return
$behavior
;
}
else
{
}
else
{
return
null
;
return
null
;
...
@@ -681,7 +669,6 @@ class Component extends Object
...
@@ -681,7 +669,6 @@ class Component extends Object
$behavior
->
attach
(
$this
);
$behavior
->
attach
(
$this
);
$this
->
_behaviors
[
$name
]
=
$behavior
;
$this
->
_behaviors
[
$name
]
=
$behavior
;
}
}
return
$behavior
;
return
$behavior
;
}
}
}
}
framework/behaviors/TimestampBehavior.php
View file @
8701d7df
...
@@ -78,6 +78,7 @@ class TimestampBehavior extends AttributeBehavior
...
@@ -78,6 +78,7 @@ class TimestampBehavior extends AttributeBehavior
*/
*/
public
$value
;
public
$value
;
/**
/**
* @inheritdoc
* @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