儘可能不要在 describe 及 it 中使用 require 。
例如:
| { | |
| // http://eslint.org/docs/rules/ | |
| "ecmaFeatures": { | |
| "binaryLiterals": false, // enable binary literals | |
| "blockBindings": false, // enable let and const (aka block bindings) | |
| "defaultParams": false, // enable default function parameters | |
| "forOf": false, // enable for-of loops | |
| "generators": false, // enable generators | |
| "objectLiteralComputedProperties": false, // enable computed object literal property names |
| # ~/.tmux.conf | |
| # | |
| # See the following files: | |
| # | |
| # /opt/local/share/doc/tmux/t-williams.conf | |
| # /opt/local/share/doc/tmux/screen-keys.conf | |
| # /opt/local/share/doc/tmux/vim-keys.conf | |
| # | |
| # URLs to read: | |
| # |
| <?php | |
| class Mailer | |
| { | |
| // Mailer 只依賴在 Mailable 介面, Mailable 只有一個 getMail 方法。 | |
| public function send(Mailable $target) | |
| { | |
| $mail = $target->getMail(); | |
| // ... |
| <?php | |
| namespace Feature\Helper; | |
| use SebastianBergmann\CodeCoverage\Filter; | |
| use SebastianBergmann\CodeCoverage\CodeCoverage as PHPUnitCodeCoverage; | |
| use SebastianBergmann\CodeCoverage\InvalidArgumentException; | |
| use SebastianBergmann\CodeCoverage\Report\Clover; | |
| use SebastianBergmann\CodeCoverage\Report\Html\Facade as Html; | |
| use SebastianBergmann\CodeCoverage\Report\Text; |
| <?php | |
| use Illuminate\Support\Str; | |
| require __DIR__ . '/vendor/autoload.php'; | |
| $fs = new \Illuminate\Filesystem\Filesystem(); | |
| $filePaths = $fs->glob(__DIR__ . '/src/Schema/*/Create*.php'); | |
| foreach ($filePaths as $filePath) { | |
| $file = new SplFileInfo($filePath); |
| <?php | |
| use Illuminate\Container\Container; | |
| use Illuminate\Database\Capsule\Manager as Capsule; | |
| use Illuminate\Database\ConnectionResolverInterface; | |
| use Illuminate\Database\Migrations\DatabaseMigrationRepository; | |
| use Illuminate\Database\Migrations\MigrationRepositoryInterface; | |
| use Illuminate\Database\Migrations\Migrator; | |
| use Illuminate\Events\Dispatcher; |
| #!/bin/bash | |
| versions=("5.6.24" "7.0.9") | |
| function say() | |
| { | |
| value=$1 | |
| echo -e "php-$value\n" | |
| } |