Permalink
Browse files

unify constructor initialization style throughout symfony

  • Loading branch information...
1 parent e2ce316 commit 341f3cf41fd1d15c22d296137579ec4b7b1634a7 @Tobion Tobion committed Nov 10, 2013
@@ -18,7 +18,7 @@
*/
class ExcludeDirectoryFilterIterator extends FilterIterator
{
- private $patterns;
+ private $patterns = array();
/**
* Constructor.
@@ -28,7 +28,6 @@ class ExcludeDirectoryFilterIterator extends FilterIterator
*/
public function __construct(\Iterator $iterator, array $directories)
{
- $this->patterns = array();
foreach ($directories as $directory) {
$this->patterns[] = '#(^|/)'.preg_quote($directory, '#').'(/|$)#';
}
@@ -20,8 +20,8 @@
*/
abstract class MultiplePcreFilterIterator extends FilterIterator
{
- protected $matchRegexps;
- protected $noMatchRegexps;
+ protected $matchRegexps = array();
+ protected $noMatchRegexps = array();
/**
* Constructor.
@@ -32,12 +32,10 @@
*/
public function __construct(\Iterator $iterator, array $matchPatterns, array $noMatchPatterns)
{
- $this->matchRegexps = array();
foreach ($matchPatterns as $pattern) {
$this->matchRegexps[] = $this->toRegex($pattern);
}
- $this->noMatchRegexps = array();
foreach ($noMatchPatterns as $pattern) {
$this->noMatchRegexps[] = $this->toRegex($pattern);
}
View
@@ -24,12 +24,12 @@ class Command
/**
* @var array
*/
- private $bits;
+ private $bits = array();
/**
* @var array
*/
- private $labels;
+ private $labels = array();
/**
* @var \Closure|null
@@ -44,8 +44,6 @@ class Command
public function __construct(Command $parent = null)
{
$this->parent = $parent;
- $this->bits = array();
- $this->labels = array();
}
/**
@@ -13,11 +13,10 @@
class Iterator implements \Iterator
{
- protected $values;
+ protected $values = array();
public function __construct(array $values = array())
{
- $this->values = array();
foreach ($values as $value) {
$this->attach(new \SplFileInfo($value));
}

0 comments on commit 341f3cf

Please sign in to comment.