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
openapi: 3.1.0 | |
info: | |
title: OpenAPI HttpFoundation Testing Laravel Example | |
version: 1.0.0 | |
servers: | |
- url: http://localhost:8000/api | |
paths: |
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 Tests\Feature; | |
use Osteel\OpenApi\Testing\ValidatorBuilder; | |
use Tests\TestCase; | |
class ExampleTest extends TestCase | |
{ | |
/** |
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 | |
// Load Composer's autoload | |
require_once __DIR__ . '/vendor/autoload.php'; | |
// Load the RSS feed | |
$feed = Feed::loadRss('https://tech.osteel.me/feeds/rss.xml')->toArray(); | |
// Generate the list of blog posts | |
$posts = ''; |
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
name: Update blog posts | |
on: | |
push: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 * * *' | |
jobs: | |
build: |
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 Osteel\PhpCliDemo\Commands; | |
use Symfony\Component\Console\Command\Command; | |
use Symfony\Component\Console\Input\InputInterface; | |
use Symfony\Component\Console\Output\OutputInterface; | |
use Symfony\Component\Console\Style\SymfonyStyle; | |
class Play extends Command |
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
$term1 = rand(1, 10); | |
$term2 = rand(1, 10); | |
$result = $term1 + $term2; | |
$io = new SymfonyStyle($input, $output); | |
$answer = (int) $io->ask(sprintf('What is %s + %s?', $term1, $term2)); | |
if ($answer === $result) { | |
$io->success('Well done!'); |
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
#!/usr/bin/env php | |
<?php | |
require __DIR__.'/../vendor/autoload.php'; | |
use Symfony\Component\Console\Application; | |
$application = new Application(); | |
// ... register commands |
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
#!/usr/bin/env php | |
<?php | |
require __DIR__.'/../vendor/autoload.php'; | |
use Osteel\PhpCliDemo\Commands\Play; | |
use Symfony\Component\Console\Application; | |
$application = new Application(); |
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 Osteel\PhpCliDemo\Services; | |
use Symfony\Component\Console\Style\SymfonyStyle; | |
class InputOutput extends SymfonyStyle | |
{ | |
/** | |
* Ask a question and return the answer. |
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 Osteel\PhpCliDemo\Commands; | |
use Osteel\PhpCliDemo\Services\InputOutput; | |
use Symfony\Component\Console\Command\Command; | |
use Symfony\Component\Console\Input\InputInterface; | |
use Symfony\Component\Console\Output\OutputInterface; | |
class Play extends Command |
OlderNewer