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 | |
use MongoDB\BSON\Document; | |
use PhpBench\Attributes\Groups; | |
use PhpBench\Attributes\Iterations; | |
use PhpBench\Attributes\Revs; | |
#[Iterations(30)] | |
class CreateObjectBench | |
{ |
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 | |
/** | |
* Demo ReactPHP application using Twig in yielding mode with an async function. | |
*/ | |
namespace App; | |
use Exception; | |
use Psr\Http\Message\ServerRequestInterface; |
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 | |
$pwd = getcwd(); | |
$args = $_SERVER['argv']; | |
if (count($args) !== 2) { | |
echo "Replace any composer package from a project with a symlink to an external directory.\n"; | |
echo "Usage: composer-link <path-to-package>\n"; | |
exit(1); |
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 | |
use Symfony\Component\HttpFoundation\ChainRequestMatcher; | |
use Symfony\Component\HttpFoundation\RequestMatcher; | |
use Symfony\Component\HttpFoundation\RequestMatcherInterface; | |
class RequestMatcherFactory | |
{ | |
public function getRequestMatcher(array $config): RequestMatcherInterface | |
{ |
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 App; | |
class Foo | |
{ | |
} | |
class Bar | |
{ |
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
build: | |
image: node:alpine | |
script: | |
# Skip build if files are already in cache | |
- .gitlab-ci/git-tree-changed.sh .gitlab-cache-key '\.(css|js|json)$' ./frontend ./other-frontend-dir ./public/yet-another || (cd ./frontend && npm ci && npm run build) | |
variables: | |
# $CACHE_KEY_INDEX is set in project variable, and must be updated each time the CI cache is clear | |
# Waiting for the issue to be fixed: https://gitlab.com/gitlab-org/gitlab/-/issues/360438#note_923272903 | |
CACHE_FALLBACK_KEY: ${CI_DEFAULT_BRANCH}-build-${CACHE_KEY_INDEX} | |
cache: |
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 App; | |
use Revolt\EventLoop; | |
use Symfony\Contracts\HttpClient\HttpClientInterface; | |
class RevoltHttpClient | |
{ | |
private int $requests = 0; |
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 PMD\ONE\CoreBundle\Lock\Store; | |
use Doctrine\DBAL\Connection; | |
use Symfony\Component\Lock\Exception\InvalidArgumentException; | |
use Symfony\Component\Lock\Exception\LockConflictedException; | |
use Symfony\Component\Lock\Key; | |
use Symfony\Component\Lock\PersistingStoreInterface; |
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\Integration; | |
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; | |
use Symfony\Component\HttpFoundation\Request; | |
use Symfony\Component\HttpKernel\Controller\ControllerResolverInterface; | |
use Symfony\Component\HttpKernel\HttpKernelInterface; | |
use Symfony\Component\Routing\RouterInterface; |
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 Testing; | |
/** | |
* Authentication on a Vault server using AWS IAM | |
* https://www.vaultproject.io/api-docs/auth/aws#login | |
*/ | |
use AsyncAws\Core\AwsClientFactory; |
NewerOlder