-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
34 changed files
with
725 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
use App\Foo; | ||
|
||
/** | ||
* Constructor with new Foo() | ||
*/ | ||
class Case003 | ||
{ | ||
private $foo; | ||
public function __construct() | ||
{ | ||
$this->foo = new Foo(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
use App\Foo; | ||
|
||
class_exists(Foo::class); | ||
/** | ||
* Constructor with new Foo() | ||
*/ | ||
class Case003 | ||
{ | ||
private $foo; | ||
public function __construct() | ||
{ | ||
$this->foo = new Foo(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
use App\Foo; | ||
|
||
/** | ||
* Constructor with class reference | ||
*/ | ||
class Case004 | ||
{ | ||
private $foo; | ||
public function __construct() | ||
{ | ||
$this->foo = Foo::class; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
use App\Foo; | ||
|
||
class_exists(Foo::class); | ||
/** | ||
* Constructor with class reference | ||
*/ | ||
class Case004 | ||
{ | ||
private $foo; | ||
public function __construct() | ||
{ | ||
$this->foo = Foo::class; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
use App\Foo; | ||
|
||
/** | ||
* Constructor using more complex class references | ||
*/ | ||
class Case005 | ||
{ | ||
private $baz; | ||
private $bazClass; | ||
private $bar; | ||
private $barClass; | ||
public function __construct() | ||
{ | ||
$this->bar = new Foo\Bar(); | ||
$this->barClass = Foo\BarClass::class; | ||
$this->baz = new \Biz\Baz(); | ||
$this->bazClass = \Biz\BazClass::class; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
use App\Foo; | ||
|
||
class_exists(Foo\Bar::class); | ||
class_exists(Foo\BarClass::class); | ||
class_exists(\Biz\Baz::class); | ||
class_exists(\Biz\BazClass::class); | ||
/** | ||
* Constructor using more complex class references | ||
*/ | ||
class Case005 | ||
{ | ||
private $baz; | ||
private $bazClass; | ||
private $bar; | ||
private $barClass; | ||
public function __construct() | ||
{ | ||
$this->bar = new Foo\Bar(); | ||
$this->barClass = Foo\BarClass::class; | ||
$this->baz = new \Biz\Baz(); | ||
$this->bazClass = \Biz\BazClass::class; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
use App\Foo; | ||
|
||
/** | ||
* Constructor call to private method | ||
*/ | ||
class Case006 | ||
{ | ||
private $foo; | ||
private $bar; | ||
public function __construct() | ||
{ | ||
$this->bar = 2; | ||
$this->init(); | ||
} | ||
|
||
private function init() | ||
{ | ||
$this->foo = new Foo(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
use App\Foo; | ||
|
||
class_exists(Foo::class); | ||
/** | ||
* Constructor call to private method | ||
*/ | ||
class Case006 | ||
{ | ||
private $foo; | ||
private $bar; | ||
public function __construct() | ||
{ | ||
$this->bar = 2; | ||
$this->init(); | ||
} | ||
|
||
private function init() | ||
{ | ||
$this->foo = new Foo(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
use App\Foo; | ||
|
||
/** | ||
* Constructor call to public method | ||
*/ | ||
class Case007 | ||
{ | ||
private $foo; | ||
private $bar; | ||
public function __construct() | ||
{ | ||
$this->bar = 2; | ||
$this->init(); | ||
} | ||
|
||
public function init() | ||
{ | ||
$this->foo = new Foo(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
use App\Foo; | ||
|
||
class_exists(Foo::class); | ||
/** | ||
* Constructor call to public method | ||
*/ | ||
class Case007 | ||
{ | ||
private $foo; | ||
private $bar; | ||
public function __construct() | ||
{ | ||
$this->bar = 2; | ||
$this->init(); | ||
} | ||
|
||
public function init() | ||
{ | ||
$this->foo = new Foo(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
use App\Foo; | ||
|
||
/** | ||
* Constructor call to private method with parameter | ||
*/ | ||
class Case008 | ||
{ | ||
private $foo; | ||
private $bar; | ||
public function __construct() | ||
{ | ||
$this->bar = 2; | ||
$var = new Foo(); | ||
$this->init($var); | ||
} | ||
|
||
private function init(Foo $foo) | ||
{ | ||
$this->foo = $foo; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
use App\Foo; | ||
|
||
class_exists(Foo::class); | ||
/** | ||
* Constructor call to private method with parameter | ||
*/ | ||
class Case008 | ||
{ | ||
private $foo; | ||
private $bar; | ||
public function __construct() | ||
{ | ||
$this->bar = 2; | ||
$var = new Foo(); | ||
$this->init($var); | ||
} | ||
|
||
private function init(Foo $foo) | ||
{ | ||
$this->foo = $foo; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
use App\Foo; | ||
|
||
/** | ||
* Constructor call to public method with parameter | ||
*/ | ||
class Case009 | ||
{ | ||
private $foo; | ||
private $bar; | ||
public function __construct() | ||
{ | ||
$this->bar = 2; | ||
$var = new Foo(); | ||
$this->init($var); | ||
} | ||
|
||
public function init(Foo $foo) | ||
{ | ||
$this->foo = $foo; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
use App\Foo; | ||
|
||
/** | ||
* Constructor using more complex class references | ||
*/ | ||
class Case010 | ||
{ | ||
private $baz; | ||
private $bazClass; | ||
private $bar; | ||
private $barClass; | ||
public function __construct() | ||
{ | ||
$this->init(); | ||
} | ||
|
||
private function init() | ||
{ | ||
$this->bar = new Foo\Bar(); | ||
$this->barClass = Foo\BarClass::class; | ||
$this->baz = new \Biz\Baz(); | ||
$this->bazClass = \Biz\BazClass::class; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
use App\Foo; | ||
|
||
class_exists(Foo\Bar::class); | ||
class_exists(Foo\BarClass::class); | ||
class_exists(\Biz\Baz::class); | ||
class_exists(\Biz\BazClass::class); | ||
/** | ||
* Constructor using more complex class references | ||
*/ | ||
class Case010 | ||
{ | ||
private $baz; | ||
private $bazClass; | ||
private $bar; | ||
private $barClass; | ||
public function __construct() | ||
{ | ||
$this->init(); | ||
} | ||
|
||
private function init() | ||
{ | ||
$this->bar = new Foo\Bar(); | ||
$this->barClass = Foo\BarClass::class; | ||
$this->baz = new \Biz\Baz(); | ||
$this->bazClass = \Biz\BazClass::class; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
/** | ||
* Return types of public functions | ||
*/ | ||
class Case011 | ||
{ | ||
private $foo; | ||
public function __construct() | ||
{ | ||
$this->init(); | ||
} | ||
|
||
public function init(): Foo | ||
{ | ||
$bar = new Bar(); | ||
return $bar->createFoo(); | ||
} | ||
} |
Oops, something went wrong.