Sample User repository method that return all user names in an array:
/**
* Find user names
*
* @return array
*/
public function findAllNames()
#!/bin/bash | |
# current Git branch | |
branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,') | |
# v1.0.0, v1.5.2, etc. | |
versionLabel=v$1 | |
# establish branch and tag name variables | |
devBranch=develop |
<?php | |
abstract class TestCase extends \PHPUnit_Framework_TestCase | |
{ | |
protected function assertException(callable $callback, $expectedException = 'Exception', $expectedCode = null, $expectedMessage = null) | |
{ | |
$expectedException = ltrim((string) $expectedException, '\\'); | |
if (!class_exists($expectedException) && !interface_exists($expectedException)) { | |
$this->fail(sprintf('An exception of type "%s" does not exist.', $expectedException)); | |
} |
I've sniffed most of the Tinder API to see how it works. You can use this to create bots (etc) very trivially. Some example python bot code is here -> https://gist.github.com/rtt/5a2e0cfa638c938cca59 (horribly quick and dirty, you've been warned!)
# Version key/value should be on his own line | |
PACKAGE_VERSION=$(cat package.json \ | |
| grep version \ | |
| head -1 \ | |
| awk -F: '{ print $2 }' \ | |
| sed 's/[",]//g' \ | |
| tr -d '[[:space:]]') | |
echo $PACKAGE_VERSION |
# The command finds the most recent tag that is reachable from a commit. | |
# If the tag points to the commit, then only the tag is shown. | |
# Otherwise, it suffixes the tag name with the number of additional commits on top of the tagged object | |
# and the abbreviated object name of the most recent commit. | |
git describe | |
# With --abbrev set to 0, the command can be used to find the closest tagname without any suffix: | |
git describe --abbrev=0 | |
# other examples |
<?php | |
declare(strict_types=1); | |
namespace SymfonyLive\Mastermind\Adapters\Database; | |
use Doctrine\Common\Persistence\ManagerRegistry; | |
use Doctrine\Common\Persistence\ObjectManager; | |
use Doctrine\ORM\Tools\SchemaTool; | |
use RuntimeException; |
docker exec -it container-name redis-cli FLUSHALL |