You can copy the XML below and paste them into your live templates in PHPStorm to start using it :)
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
const plugin = require('tailwindcss/plugin'); | |
let untilBreakpoint = plugin(({ addVariant, config }) => { | |
let screens = config('theme.screens'); | |
for (let screen in screens) { | |
let def = screens[screen]; | |
if (typeof def === 'string') { | |
addVariant(`-${screen}`, `@media (max-width: calc(${def} - 1px))`); |
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 | |
/** | |
* Imagine this is an API call | |
*/ | |
function listPage(int $i): array | |
{ | |
$next = $i >= 9 ? null : $i + 1; | |
return ['cursor' => $next, 'items' => array_fill(0, 5, $i)]; | |
} |
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 | |
declare(strict_types=1); | |
namespace AcmeCompany\Flysystem; | |
use Aws\CommandInterface; | |
use Aws\S3\Exception\S3Exception; | |
use Aws\S3\S3ClientInterface; | |
use Exception; |
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 | |
final class EventDispatcher { | |
private $listeners = []; | |
public function listen(callable $listener) | |
{ | |
$this->listeners[] = $listener; | |
} |
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 | |
interface EventDispatcher | |
{ | |
public function listen(string $event, callable $listener); | |
public function emit(object $event): object; | |
} | |
class ExampleEventDispatcher implements EventDispatcher | |
{ |
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\Twig; | |
interface AssetLocator | |
{ | |
public function lookup(string $asset): string; | |
} |
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\Translator; | |
use MessageFormatter; | |
use Symfony\Component\Translation\MessageSelector; | |
class IcuMessageSelector extends MessageSelector | |
{ | |
/** |
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\Routing\Matcher\Dumper\PhpMatcherDumper; | |
use Symfony\Component\Routing\Route; | |
use Symfony\Component\Routing\RouteCollection; | |
include __DIR__.'/vendor/autoload.php'; | |
if (count($argv) < 2) { | |
die('Not enough arguments'); |
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 | |
function mirco_time_precise_date_time_immutable() | |
{ | |
return DateTimeImmutable::createFromFormat('U.u', sprintf('%.6F', microtime(true))); | |
} |
NewerOlder