Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Y
yii2bootstrap
Project
Project
Details
Activity
Releases
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
夏彬
yii2bootstrap
Commits
3ba68632
Commit
3ba68632
authored
Jul 16, 2011
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
finished Vector.
parent
0918f32e
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
609 additions
and
132 deletions
+609
-132
Component.php
framework/base/Component.php
+142
-130
Event.php
framework/base/Event.php
+2
-2
Exception.php
framework/base/Exception.php
+25
-0
Vector.php
framework/base/Vector.php
+345
-0
VectorIterator.php
framework/base/VectorIterator.php
+95
-0
No files found.
framework/base/Component.php
View file @
3ba68632
This diff is collapsed.
Click to expand it.
framework/base/Event.php
View file @
3ba68632
...
...
@@ -3,7 +3,7 @@
namespace
yii\base
;
/**
*
C
Event is the base class for all event classes.
* Event is the base class for all event classes.
*
* It encapsulates the parameters associated with an event.
* The {@link sender} property describes who raises the event.
...
...
@@ -16,7 +16,7 @@ namespace yii\base;
* @package system.base
* @since 1.0
*/
class
CEvent
extends
C
Component
class
Event
extends
Component
{
/**
* @var object the sender of this event
...
...
framework/base/Exception.php
0 → 100644
View file @
3ba68632
<?php
namespace
yii\base
;
/**
* Exception class file.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.yiiframework.com/
* @copyright Copyright © 2008-2011 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* Exception represents a generic exception for all purposes.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @version $Id: CException.php 2799 2011-01-01 19:31:13Z qiang.xue $
* @package system.base
* @since 1.0
*/
class
Exception
extends
\Exception
{
}
framework/base/Vector.php
0 → 100644
View file @
3ba68632
This diff is collapsed.
Click to expand it.
framework/base/VectorIterator.php
0 → 100644
View file @
3ba68632
<?php
/**
* VectorIterator class file.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.yiiframework.com/
* @copyright Copyright © 2008-2012 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace
yii\base
;
/**
* VectorIterator implements the SPL `Iterator` interface for [[Vector]].
*
* It allows [[Vector]] to return a new iterator for data traversing purpose.
* You normally do not use this class directly.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
*/
class
VectorIterator
implements
\Iterator
{
/**
* @var array the data to be iterated through
*/
private
$_d
;
/**
* @var integer index of the current item
*/
private
$_i
;
/**
* @var integer count of the data items
*/
private
$_c
;
/**
* Constructor.
* @param array $data the data to be iterated through
*/
public
function
__construct
(
&
$data
)
{
$this
->
_d
=
&
$data
;
$this
->
_i
=
0
;
$this
->
_c
=
count
(
$this
->
_d
);
}
/**
* Rewinds the index of the current item.
* This method is required by the SPL interface `Iterator`.
*/
public
function
rewind
()
{
$this
->
_i
=
0
;
}
/**
* Returns the key of the current item.
* This method is required by the SPL interface `Iterator`.
* @return integer the key of the current item
*/
public
function
key
()
{
return
$this
->
_i
;
}
/**
* Returns the current item.
* This method is required by the SPL interface `Iterator`.
* @return mixed the current item
*/
public
function
current
()
{
return
$this
->
_d
[
$this
->
_i
];
}
/**
* Moves the internal pointer to the next item.
* This method is required by the SPL interface `Iterator`.
*/
public
function
next
()
{
$this
->
_i
++
;
}
/**
* Returns a value indicating whether there is an item at current position.
* This method is required by the SPL interface `Iterator`.
* @return boolean whether there is an item at current position.
*/
public
function
valid
()
{
return
$this
->
_i
<
$this
->
_c
;
}
}
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