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 | |
// MariaDB uses the C escape syntax in strings (for example, "\n" to represent the newline character), | |
// we must double any "\" that we use in REGEXP strings (see https://mariadb.com/kb/en/regexp/) | |
// PHP's preg_quote() won't work here as it adds single slashes so use a special regular expression here | |
$string = 'My [string] {with} ~regexp~ |special| /characters/+.'; | |
$pattern = '/(\+|-|\||&&|\|\||!|\(|\)|\{|}|\[|]|\^|"|~|\*|\?|:|\\\)/'; | |
$replacement = '\\\\\\\\${1}'; | |
$stringEscaped = preg_replace($pattern, $replacement, $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\Http\Middleware; | |
use Illuminate\Contracts\Encryption\Encrypter; | |
use Illuminate\Contracts\Foundation\Application; | |
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware; | |
class VerifyCsrfToken extends Middleware | |
{ |
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 App\Models\Permission; | |
use App\Models\Role; | |
use Tests\TestCase; | |
/** | |
* Class RoleTest |
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
#!/bin/bash | |
echo "Patching out... Do you want to continue? (y/n)" | |
read CONFIRMATION | |
if [[ "$CONFIRMATION" != "y" && "$CONFIRMATION" != "Y" ]]; then | |
echo No worries. | |
exit 1 | |
fi |
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": "Project", | |
"author": "Vendor", | |
"description": "Node modules dependencies for local development", | |
"version": "2.0.0", | |
"license": "(OSL-3.0 OR AFL-3.0)", | |
"repository": { | |
"type": "git", | |
"url": "https://github.com/magento/magento2.git" | |
}, |
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 Acme\Console; | |
use Illuminate\Console\Command; | |
use Symfony\Component\Console\Input\InputOption; | |
use Symfony\Component\Console\Input\InputArgument; | |
use Storage; | |
class OneOffSyncUploads 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
<?php | |
namespace Acme\CoreBundle\Command; | |
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; | |
use Symfony\Component\Console\Input\InputArgument; | |
use Symfony\Component\Console\Input\InputInterface; | |
use Symfony\Component\Console\Input\InputOption; | |
use Symfony\Component\Console\Output\OutputInterface; |
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 AppBundle\Doctrine\DBAL\Types; | |
use Doctrine\DBAL\Types\Type; | |
use Doctrine\DBAL\Platforms\AbstractPlatform; | |
class Tinyint extends Type | |
{ | |
const TINYINT = 'tinyint'; |