This file contains hidden or 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
void setup() | |
{ | |
Serial.begin(9600); | |
pinMode(13, OUTPUT); | |
} | |
void loop() | |
{ | |
if (Serial.available() > 0) { | |
This file contains hidden or 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 Application\Service; | |
use Application\Entity\Realizacao; | |
class CumprirTarefa { | |
/** | |
* | |
* @var Tarefa | |
*/ |
This file contains hidden or 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
public function assertFlashMessenger($messenger) { | |
Zend_Controller_Action_HelperBroker::removeHelper('FlashMessenger'); | |
$mockFlashMessenger = \Mockery::mock('Zend_Controller_Action_Helper_FlashMessenger[getName, addMessage]') | |
->shouldReceive('addMessage')->with($messenger)->once() | |
->shouldReceive('getName')->andReturn('FlashMessenger') | |
->mock(); | |
Zend_Controller_Action_HelperBroker::addHelper($mockFlashMessenger); | |
} |
This file contains hidden or 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 | |
trait SomeClass { | |
public function add($x, $y) { return $x + $y; } | |
} | |
class TestComponent { | |
use SomeClass; | |
} |
This file contains hidden or 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
<? | |
$arquivo = isset($_FILES["anexo"]) ? $_FILES["anexo"] : FALSE; | |
$arquivo_tratado = str_replace("+","-",$arquivo); | |
if(is_uploaded_file($arquivo_tratado['tmp_name'] && !empty ($erro)) | |
{ | |
$size = $_FILES[$arquivo_tratado]['size']; | |
if ($size > 10240000){ | |
$erro = "O tamanho maximo para envio de arquivo é de 10M. Por favor tente novamente."; |
This file contains hidden or 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 | |
function listarNomes(){ | |
return array('Raphael', 'Gabriela', 'Eduarda'); | |
} | |
$lista = listarNomes(); | |
echo $lista[0]; | |
//output: |
This file contains hidden or 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 | |
//array vazio | |
$lista = []; | |
//array | |
$lista = ['Raphael', 'Gabriela', 'Eduarda']; | |
//array multi-dimensional |
This file contains hidden or 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 Service\User{ | |
public function getUser(){ | |
return ['id' => 1, | |
'name' => 'Raphael Almeida', | |
'publisher' => true]; | |
} | |
} |
This file contains hidden or 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 TestComponent { } | |
class SomeClass extends CBehavior{ | |
public function add($x, $y) { return $x + $y; } | |
} | |
$test_comp = new TestComponent(); | |
$test_comp->attachbehavior('blah', new SomeClass); |
This file contains hidden or 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 | |
trait SomeClass{ | |
public function add($x, $y) { return $x + $y; } | |
} | |
class TestComponent { | |
use SomeClass; | |
} |