composer outdated --direct -f json
This file contains hidden or 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 bash | |
| set -e | |
| find src -name '*.php' -not \( -path '*Trait.php' -prune \) -not \( -path '*/Abstract*' -prune \) -not \( -path '*/Traits/*' -prune \) -not \( -path '*/Contract/*' -prune \) -type f -print0 | while IFS= read -r -d $'\0' file; | |
| do | |
| file="tests/Unit/${file:(4)}"; | |
| path="${file/.php/Test.php}"; | |
| if [[ -e $path ]]; then |
This file contains hidden or 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 Ghostwriter\Mezzio\Workbench; | |
| use Mezzio\Application; | |
| use Mezzio\MiddlewareFactory; | |
| use Mezzio\Router\RouteResult; | |
| use Mezzio\Router\RouterInterface; |
This file contains hidden or 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
| /** | |
| * Check if value is between given range. | |
| * | |
| * @param mixed $value | |
| * @param mixed $min | |
| * @param mixed $max | |
| * | |
| * @return bool | |
| */ | |
| function in_range($value, $min, $max): bool { |
This file contains hidden or 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); | |
| $nodeAddress = spl_object_hash($node); | |
| $nodeFinder = new PhpParser\NodeFinder; | |
| $foundNode = $nodeFinder->findFirst($nodes, function (Node $node) use ($nodeAddress) { | |
| return spl_object_hash($node) === $nodeAddress; |
This file contains hidden or 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
| # Backup | |
| docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
| # Restore | |
| cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE |
This file contains hidden or 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 | |
| // AssertableValueObject.php | |
| final class AssertionsFailedException extends \RuntimeException | |
| { | |
| } | |
| interface AssertableInterface | |
| { |
This file contains hidden or 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 Ghostwriter\Collection; | |
| use Closure; | |
| use Ghostwriter\Collection\Contract\CollectionInterface; | |
| use InvalidArgumentException; | |
| use Traversable; |
This file contains hidden or 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 | |
| $nodeTraverser = new PhpParser\NodeTraverser; | |
| $nodeTraverser->addVisitor(new PhpParser\NodeVisitor\NameResolver); | |
| $visitor = new PhpParser\NodeVisitor\FindingVisitor(function (Node $node) { | |
| return $node instanceof Node\Expr\MethodCall && $node->name instanceof Identifier; | |
| }); |