Skip to content
This repository was archived by the owner on Sep 20, 2021. It is now read-only.

Commit 41ff1d2

Browse files
committed
Move to PSR-1 and PSR-2.
1 parent c330d48 commit 41ff1d2

55 files changed

Lines changed: 786 additions & 921 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Aggregate.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
* New BSD License
1010
*
11-
* Copyright © 2007-2015, Ivan Enderlin. All rights reserved.
11+
* Copyright © 2007-2015, Hoa community. All rights reserved.
1212
*
1313
* Redistribution and use in source and binary forms, with or without
1414
* modification, are permitted provided that the following conditions are met:
@@ -41,9 +41,9 @@
4141
*
4242
* Extending the SPL IteratorAggregate interface.
4343
*
44-
* @author Ivan Enderlin <ivan.enderlin@hoa-project.net>
45-
* @copyright Copyright © 2007-2015 Ivan Enderlin.
44+
* @copyright Copyright © 2007-2015 Hoa community
4645
* @license New BSD License
4746
*/
48-
49-
interface Aggregate extends \IteratorAggregate { }
47+
interface Aggregate extends \IteratorAggregate
48+
{
49+
}

Append.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
* New BSD License
1010
*
11-
* Copyright © 2007-2015, Ivan Enderlin. All rights reserved.
11+
* Copyright © 2007-2015, Hoa community. All rights reserved.
1212
*
1313
* Redistribution and use in source and binary forms, with or without
1414
* modification, are permitted provided that the following conditions are met:
@@ -41,9 +41,9 @@
4141
*
4242
* Extending the SPL AppendIterator class.
4343
*
44-
* @author Ivan Enderlin <ivan.enderlin@hoa-project.net>
45-
* @copyright Copyright © 2007-2015 Ivan Enderlin.
44+
* @copyright Copyright © 2007-2015 Hoa community
4645
* @license New BSD License
4746
*/
48-
49-
class Append extends \AppendIterator { }
47+
class Append extends \AppendIterator
48+
{
49+
}

CallbackFilter.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
* New BSD License
1010
*
11-
* Copyright © 2007-2015, Ivan Enderlin. All rights reserved.
11+
* Copyright © 2007-2015, Hoa community. All rights reserved.
1212
*
1313
* Redistribution and use in source and binary forms, with or without
1414
* modification, are permitted provided that the following conditions are met:
@@ -41,9 +41,9 @@
4141
*
4242
* Extending the SPL CallbackFilterIterator class.
4343
*
44-
* @author Ivan Enderlin <ivan.enderlin@hoa-project.net>
45-
* @copyright Copyright © 2007-2015 Ivan Enderlin.
44+
* @copyright Copyright © 2007-2015 Hoa community
4645
* @license New BSD License
4746
*/
48-
49-
class CallbackFilter extends \CallbackFilterIterator { }
47+
class CallbackFilter extends \CallbackFilterIterator
48+
{
49+
}

CallbackGenerator.php

Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
* New BSD License
1010
*
11-
* Copyright © 2007-2015, Ivan Enderlin. All rights reserved.
11+
* Copyright © 2007-2015, Hoa community. All rights reserved.
1212
*
1313
* Redistribution and use in source and binary forms, with or without
1414
* modification, are permitted provided that the following conditions are met:
@@ -41,31 +41,29 @@
4141
*
4242
* Yield a value based on a callback.
4343
*
44-
* @author Ivan Enderlin <ivan.enderlin@hoa-project.net>
45-
* @copyright Copyright © 2007-2015 Ivan Enderlin.
44+
* @copyright Copyright © 2007-2015 Hoa community
4645
* @license New BSD License
4746
*/
48-
49-
class CallbackGenerator implements Iterator {
50-
47+
class CallbackGenerator implements Iterator
48+
{
5149
/**
5250
* Callback.
5351
*
54-
* @var \Hoa\Iterator\CallbackGenerator callable
52+
* @var callable
5553
*/
5654
protected $_callback = null;
5755

5856
/**
5957
* Current key.
6058
*
61-
* @var \Hoa\Iterator\Demultiplexer mixed
59+
* @var mixed
6260
*/
6361
protected $_key = 0;
6462

6563
/**
6664
* Current computed value.
6765
*
68-
* @var \Hoa\Iterator\Demultiplexer mixed
66+
* @var mixed
6967
*/
7068
protected $_current = null;
7169

@@ -74,12 +72,11 @@ class CallbackGenerator implements Iterator {
7472
/**
7573
* Constructor.
7674
*
77-
* @access public
7875
* @param callable $callback Callback.
7976
* @return void
8077
*/
81-
public function __construct ( Callable $callback ) {
82-
78+
public function __construct(callable $callback)
79+
{
8380
$this->_callback = $callback;
8481

8582
return;
@@ -88,11 +85,10 @@ public function __construct ( Callable $callback ) {
8885
/**
8986
* Return the current element.
9087
*
91-
* @access public
9288
* @return mixed
9389
*/
94-
public function current ( ) {
95-
90+
public function current()
91+
{
9692
$handle = $this->_callback;
9793

9894
return $this->_current = $handle($this->_key);
@@ -101,22 +97,20 @@ public function current ( ) {
10197
/**
10298
* Return the key of the current element.
10399
*
104-
* @access public
105100
* @return mixed
106101
*/
107-
public function key ( ) {
108-
102+
public function key()
103+
{
109104
return $this->_key;
110105
}
111106

112107
/**
113108
* Move forward to next element.
114109
*
115-
* @access public
116110
* @return void
117111
*/
118-
public function next ( ) {
119-
112+
public function next()
113+
{
120114
++$this->_key;
121115

122116
return;
@@ -125,11 +119,10 @@ public function next ( ) {
125119
/**
126120
* Rewind the iterator to the first element.
127121
*
128-
* @access public
129122
* @return void
130123
*/
131-
public function rewind ( ) {
132-
124+
public function rewind()
125+
{
133126
$this->_key = 0;
134127
$this->_current = null;
135128

@@ -139,11 +132,10 @@ public function rewind ( ) {
139132
/**
140133
* Check if current position is valid.
141134
*
142-
* @access public
143135
* @return bool
144136
*/
145-
public function valid ( ) {
146-
137+
public function valid()
138+
{
147139
return true;
148140
}
149141
}

Counter.php

Lines changed: 28 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
* New BSD License
1010
*
11-
* Copyright © 2007-2015, Ivan Enderlin. All rights reserved.
11+
* Copyright © 2007-2015, Hoa community. All rights reserved.
1212
*
1313
* Redistribution and use in source and binary forms, with or without
1414
* modification, are permitted provided that the following conditions are met:
@@ -41,45 +41,43 @@
4141
*
4242
* A counter.
4343
*
44-
* @author Ivan Enderlin <ivan.enderlin@hoa-project.net>
45-
* @copyright Copyright © 2007-2015 Ivan Enderlin.
44+
* @copyright Copyright © 2007-2015 Hoa community
4645
* @license New BSD License
4746
*/
48-
49-
class Counter implements Iterator {
50-
47+
class Counter implements Iterator
48+
{
5149
/**
5250
* From (lower bound).
5351
*
54-
* @var \Hoa\Iterator\Counter int
52+
* @var int
5553
*/
5654
protected $_from = 0;
5755

5856
/**
5957
* Current key.
6058
*
61-
* @var \Hoa\Iterator\Counter int
59+
* @var int
6260
*/
6361
protected $_key = 0;
6462

6563
/**
6664
* Current index.
6765
*
68-
* @var \Hoa\Iterator\Counter int
66+
* @var int
6967
*/
7068
protected $_i = 0;
7169

7270
/**
7371
* To (upper bound).
7472
*
75-
* @var \Hoa\Iterator\Counter int
73+
* @var int
7674
*/
7775
protected $_to = 0;
7876

7977
/**
8078
* Step.
8179
*
82-
* @var \Hoa\Iterator\Counter int
80+
* @var int
8381
*/
8482
protected $_step = 0;
8583

@@ -90,18 +88,21 @@ class Counter implements Iterator {
9088
* Equivalent to:
9189
* for($i = $from; $i < $to; $i += $step)
9290
*
93-
* @access public
9491
* @param int $from Start value.
9592
* @param int $to Maximum value.
9693
* @param int $step Step.
9794
* @return void
98-
* @throw \Hoa\Iterator\Exception
95+
* @throws \Hoa\Iterator\Exception
9996
*/
100-
public function __construct ( $from, $to, $step ) {
101-
102-
if($step <= 0)
97+
public function __construct($from, $to, $step)
98+
{
99+
if ($step <= 0) {
103100
throw new Exception(
104-
'The step must be non-negative; given %d.', 0, $step);
101+
'The step must be non-negative; given %d.',
102+
0,
103+
$step
104+
);
105+
}
105106

106107
$this->_from = $from;
107108
$this->_to = $to;
@@ -113,33 +114,30 @@ public function __construct ( $from, $to, $step ) {
113114
/**
114115
* Return the current element.
115116
*
116-
* @access public
117117
* @return int
118118
*/
119-
public function current ( ) {
120-
119+
public function current()
120+
{
121121
return $this->_i;
122122
}
123123

124124
/**
125125
* Return the key of the current element.
126126
*
127-
* @access public
128127
* @return int
129128
*/
130-
public function key ( ) {
131-
129+
public function key()
130+
{
132131
return $this->_key;
133132
}
134133

135134
/**
136135
* Move forward to next element.
137136
*
138-
* @access public
139137
* @return void
140138
*/
141-
public function next ( ) {
142-
139+
public function next()
140+
{
143141
++$this->_key;
144142
$this->_i += $this->_step;
145143

@@ -149,11 +147,10 @@ public function next ( ) {
149147
/**
150148
* Rewind the iterator to the first element.
151149
*
152-
* @access public
153150
* @return void
154151
*/
155-
public function rewind ( ) {
156-
152+
public function rewind()
153+
{
157154
$this->_key = 0;
158155
$this->_i = $this->_from;
159156

@@ -163,11 +160,10 @@ public function rewind ( ) {
163160
/**
164161
* Check if current position is valid.
165162
*
166-
* @access public
167163
* @return bool
168164
*/
169-
public function valid ( ) {
170-
165+
public function valid()
166+
{
171167
return $this->_i < $this->_to;
172168
}
173169
}

0 commit comments

Comments
 (0)