Skip to content

Instantly share code, notes, and snippets.

View NandoKstroNet's full-sized avatar
🎯
Focusing

Nando Kstro Net NandoKstroNet

🎯
Focusing
View GitHub Profile
@NandoKstroNet
NandoKstroNet / single.twig
Created May 24, 2017 18:08
View single de post criado na série de posts sobre Symfony da Code Experts Learning
{% extends 'base.html.twig' %}
{% block stylesheets %}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.css">
{% endblock %}
{% block body %}
<div class="container">
<div class="col-md-12">
<div class="col-md-6">
@NandoKstroNet
NandoKstroNet / SomaTest.php
Created May 25, 2017 15:41
Arquivo criado no post Silex e Testes da Code Experts Learning
<?php
namespace App;
class SomaTest extends \PHPUnit_Framework_TestCase
{
public function testSeASomaFuncionaCorretamente()
{
$soma = new Soma();
$result = $soma->fazSoma(15, 15);
@NandoKstroNet
NandoKstroNet / phpunit.xml.dist
Created May 25, 2017 15:54
Arquivo de configuração de nossa suite de testes com PHPUnit criada no post sobre Silex e Testes da Code Experts Learning
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="./bootstrap.php"
cacheTokens="true"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="false"
convertWarningsToExceptions="true"
@NandoKstroNet
NandoKstroNet / bootstrap.php
Created May 25, 2017 16:00
Arquivo bootstrap do nosso post sobre Silex e Testes da Code Experts Learning
<?php
define('DS', DIRECTORY_SEPARATOR);
require __DIR__ . DS . 'vendor' . DS . 'autoload.php';
@NandoKstroNet
NandoKstroNet / Soma.php
Created May 25, 2017 16:11
Classe Soma criada no post Silex e Testes da Code Experts Learning
<?php
namespace App;
class Soma
{
public function fazSoma($num1, $num2): int
{
return 30;
}
}
@NandoKstroNet
NandoKstroNet / Soma.php
Created May 25, 2017 16:16
Classe Soma final, criada no post Silex e Testes da Code Experts Learning
<?php
namespace App;
class Soma
{
public function fazSoma(int $num1, int $num2): int
{
return $num1 + $num2;
}
}
@NandoKstroNet
NandoKstroNet / if.php
Created June 21, 2017 21:57
Código criado nos posts da série como começar a desenvolver com PHP pela Code Experts Learning
<?php
$a = 10;
if($a == 10) {
print 'A variável $a é igual a ' . $a;
}
@NandoKstroNet
NandoKstroNet / if_else.php
Last active June 21, 2017 22:09
Código criado nos posts da série como começar a desenvolver com PHP pela Code Experts Learning
<?php
$a = 15;
if($a == 10) {
print 'A variável $a é igual a 10';
} else {
print 'A variável $a não é igual a 10';
}
@NandoKstroNet
NandoKstroNet / if_elseif_else.php
Last active June 21, 2017 22:40
Código criado para a série de posts sobre Como Começar com PHP pra Web da Code Experts Learning
<?php
$a = 15;
if($a == 10) {
print 'A variável $a é igual a 10';
else if($a == 15) {
print 'A variável $a é igual a 15';
} else {
print 'Nenhum valor encontrado...';
}
@NandoKstroNet
NandoKstroNet / switch.php
Created June 21, 2017 22:28
Código criado para a série de postagens sobre Como Começar a Desenvolver pra Web com PHP da Code Experts Learning
<?php
$a = 15;
switch($a) {
case 10:
print 'A variável $a é igual a 10';
break;
case 15:
print 'A variável $a é igual a 15';
break;