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
<?php | |
/** | |
* Experiment: constructor to have already partially initialized object, before it gets called. | |
*/ | |
class Foobar { | |
private $a; | |
private $b; | |
private $c; |
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
<?php | |
/** | |
* Example of what a decent Dependency Injection Container should inject to make our life happier | |
*/ | |
class MyTest { | |
public function __construct(\Nette\Security\User $user) { // Constructor injection | |
} | |
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
<?php | |
use \Doctrine\ORM\Event\LoadClassMetadataEventArgs; | |
use Nette, | |
Doctrine, | |
Doctrine\ORM\Events; | |
/** | |
* Updates custom repository class definition if explicitly defined in parent 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
<?php | |
/** | |
* Class loader for the whole application | |
* | |
* Makes sure all the classes are available when they're needed. No less, no more. | |
* Usually the first file to load in your app | |
* | |
* @author Jan Dolecek <juzna.cz@gmail.com> | |
* @author Filip Procházka (filip.prochazka@kdyby.org) | |
*/ |
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
<?php | |
$a = new ArrayObject(array( | |
'single' => "ahoj", | |
'double' => "lamo", | |
)); | |
$b = new ArrayObject(array( | |
'single' => "zdar", | |
'double' => "vole", |
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
<? | |
$dbHost = 'localhost'; | |
$dbUser = '...'; | |
$dbPass = '...'; | |
$dbDatabase = '...'; |
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
<?php | |
class Tool { | |
/** | |
* @return Tool[][] | |
*/ | |
function getItems() { | |
return call_user_func('x'); // dummy | |
} | |
} |
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
/** | |
* Handle action, only valid for a logged-in user | |
* @User | |
*/ | |
public function handleLike($itemId) { ... } |
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
<?php | |
namespace MyApp; | |
/** | |
*/ | |
class Object { | |
function isThisAnObject() { | |
} | |
} |
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
object(Pepa)#2 (1) { | |
["myObj"]=> | |
object(stdClass)#1 (2) { | |
["ahoj"]=> | |
int(1) | |
["novak"]=> | |
string(4) "pepa" | |
} | |
} |