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
class MyCode | |
{ | |
private function option1() | |
{ | |
$this->notMyCode->doSomething(function () { | |
// dużo logiki, 100 linii, trudne do przetestowania, etc, więc odpada | |
}); | |
} | |
private function option2() |
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 MyCode | |
{ | |
private function option1() | |
{ | |
$this->notMyCode->doSomething(function ($value) { | |
return strlen($value); | |
}); | |
} |
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 | |
/** | |
* Model szkieletor: | |
* struktura danych co nie ma żadnej logiki, żadnej enkapsulacji, | |
* korzystający może z tym obiektem zrobić co tylko zechce. | |
*/ | |
class BadEntity | |
{ | |
private $username; |
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 ShopOpenings | |
{ | |
/** | |
* @var array | |
*/ | |
private $config; | |
/** |
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 FormController | |
{ | |
public function formAction() | |
{ | |
$form = $this->createFormBuilder() | |
->add('something_at', 'datetime', [ | |
'date_widget' => 'single_text', | |
'time_widget' => 'single_text', |
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
`/Applications/Colobot.app/Contents/MacOS/colobot --language=pl` | |
/\ This opens the polish translation of http://colobot.info/ | |
How do I set this pernamently, so that double-clicking `Colobot.app` opens the polish version? |
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
<project name="blabla"> | |
<condition property="composerDoesNotExist"> | |
<not> | |
<available file="${basedir}/bin/composer.phar" /> | |
</not> | |
</condition> | |
<target name="composer-download" description="Downloading Composer" if="composerDoesNotExist"> | |
<mkdir dir="${basedir}/bin" /> |
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
#### OSX etc #### | |
.DS_Store* | |
Icon? | |
Thumbs.db | |
ehthumbs.db | |
*.swp | |
*.out | |
/nbproject/ | |
*.lock | |
*~ |
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 | |
$cacheId = 'xyz'; | |
$cacheDriver = new \Doctrine\Common\Cache\ApcCache(); | |
if ($cacheDriver->contains($cacheId)) { | |
return $cacheDriver->fetch($cacheId); | |
} |