sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common
sudo gedit /etc/apt/sources.list.d/docker.list
copy this line: deb [arch=amd64] https://download.docker.com/linux/ubuntu artful stable save file!
<?php | |
//Ruim | |
function shouldNotProccess() { //Não devo processar | |
// ... | |
} | |
if (!shouldNotProccess()) { // Devo processar? | |
// … | |
} |
<?php | |
//Ruim | |
if (in_array(self::GRUPO_ADMINISTRADOR, $gruposAcesso)) { | |
return true; | |
} | |
return false; | |
//Bom |
<?php | |
const GRUPO_ADMINISTRADOR = 10; | |
private function deveExecutar() | |
{ | |
$gruposAcesso = explode(',',$_SESSION['GRUPOSACESSO']); | |
if (in_array(self::GRUPO_ADMINISTRADOR, $gruposAcesso)) { | |
return true; |
<?php | |
private function deveExecutar() | |
{ | |
$gruposAcesso = explode(',',$_SESSION['GRUPOSACESSO']); | |
if (in_array(10, $gruposAcesso)) { | |
return true; | |
} |
<?php | |
try { | |
// Faz alguma coisa… | |
} catch (Exception $e) { | |
return $e->getMessage(); | |
} |
<?php | |
$ymd = date('Y-m-d'); // Ruim | |
$currentDate = date('Y-m-d'); // Bom | |
/* Ruim */ var $d = 0; //quantidade de dias trabalhados | |
/* Bom */ var $workDays = 0; | |
<?php | |
if (! function_exists('git_version')) { | |
/** | |
* Get latest git tag version. | |
* | |
* @return string | |
*/ | |
function git_version() | |
{ |
sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common
sudo gedit /etc/apt/sources.list.d/docker.list
copy this line: deb [arch=amd64] https://download.docker.com/linux/ubuntu artful stable save file!
<?php | |
//Trecho de código, retirado de https://github.com/laravel/framework/blob/5.6/src/Illuminate/Database/Eloquent/Model.php#L189 | |
/** | |
* The "booting" method of the model. | |
* | |
* @return void | |
*/ | |
protected static function boot() |
<?php | |
$finder = PhpCsFixer\Finder::create() | |
->exclude('somedir') | |
->notPath('src/Symfony/Component/Translation/Tests/fixtures/resources.php') | |
->in(__DIR__); | |
return PhpCsFixer\Config::create() | |
->setRules([ | |
'@PSR2' => true, |