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 CodelyTv\Api\Controller; | |
use CodelyTv\Context\Meetup\Module\Video\Domain\Create\CreateVideoCommand; | |
use CodelyTv\Infrastructure\Bus\Command\CommandBus; | |
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
use Symfony\Component\HttpFoundation\Request; | |
use Symfony\Component\HttpFoundation\Response; |
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 CodelyTv\Context\Meetup\Module\Video\Domain\Create; | |
use CodelyTv\Context\Meetup\Module\Video\Domain\VideoId; | |
use CodelyTv\Context\Meetup\Module\Video\Domain\VideoTitle; | |
use CodelyTv\Context\Meetup\Module\Video\Domain\VideoUrl; | |
use CodelyTv\Shared\Domain\CourseId; | |
final class CreateVideoCommandHandler |
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 CodelyTv\Context\Meetup\Module\Video\Domain\Create; | |
use CodelyTv\Context\Meetup\Module\Video\Domain\Video; | |
use CodelyTv\Context\Meetup\Module\Video\Domain\VideoId; | |
use CodelyTv\Context\Meetup\Module\Video\Domain\VideoRepository; | |
use CodelyTv\Context\Meetup\Module\Video\Domain\VideoTitle; | |
use CodelyTv\Context\Meetup\Module\Video\Domain\VideoUrl; | |
use CodelyTv\Infrastructure\Bus\Event\DomainEventPublisher; |
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 CodelyTv\Context\Meetup\Module\Video\Tests\Behaviour; | |
use CodelyTv\Context\Meetup\Module\Video\Domain\Create\CreateVideoCommandHandler; | |
use CodelyTv\Context\Meetup\Module\Video\Domain\Create\VideoCreator; | |
use CodelyTv\Context\Meetup\Module\Video\Test\PhpUnit\VideoModuleUnitTestCase; | |
use CodelyTv\Context\Meetup\Module\Video\Test\Stub\CreateVideoCommandStub; | |
use CodelyTv\Context\Meetup\Module\Video\Test\Stub\VideoCreatedDomainEventStub; | |
use CodelyTv\Context\Meetup\Module\Video\Test\Stub\VideoIdStub; |
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 CodelyTv\Context\Meetup\Module\Video\Test\PhpUnit; | |
use CodelyTv\Context\Meetup\Module\Video\Domain\Video; | |
use CodelyTv\Context\Meetup\Module\Video\Domain\VideoRepository; | |
use CodelyTv\Context\Meetup\Test\PhpUnit\MeetupContextUnitTestCase; | |
use Mockery\MockInterface; | |
use function CodelyTv\Test\similarTo; |
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
// Post: http://codely.tv/screencasts/finder-kata-scala/ | |
// Repo: https://github.com/CodelyTV/incomprehensible-finder-refactoring-kata-scala | |
package tv.codely.finderKata.algorithm | |
import java.util | |
import java.util.ArrayList | |
import scala.collection.JavaConverters._ |
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
// Post: http://codely.tv/screencasts/finder-kata-scala/ | |
// Repo: https://github.com/CodelyTV/incomprehensible-finder-refactoring-kata-scala | |
package tv.codely.finderKata.algorithm | |
import java.util | |
import java.util.ArrayList | |
import scala.collection.JavaConverters._ |
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
// Post: http://codely.tv/screencasts/finder-kata-scala/ | |
// Repo: https://github.com/CodelyTV/incomprehensible-finder-refactoring-kata-scala | |
package tv.codely.finderKata.algorithm | |
final class BestPeoplePairFinder() { | |
def find(people: Seq[Person], peoplePairCriterion: Ordering[PeoplePair]): Option[PeoplePair] = { | |
val canFindPeoplePairs = people.size >= 2 | |
if (!canFindPeoplePairs) { |
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
import scala.util.Random | |
var javi = "Javi" * 10 // Inferencia de tipos | |
javi = "Rafa" // podemos reasignar el contenido de una variable (var) | |
val rafa = "Rafa" // ";" al final de línea no necesario | |
// rafa = "Javi" // Petaría en tiempo de compilación. No podemos reasignar el contenido de un valor (val) | |
def codely(name: String): String = { // función pública con tipo de retorno explícito. Se declaran con = ya que asignamos una expresión. | |
println("Este mensaje se imprimirá por pantalla al invocar a la función codely") |
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
val lele = if ("Codely mola".isInstanceOf[String]) 3 else 7 |