Skip to content

Instantly share code, notes, and snippets.

View assertchris's full-sized avatar

Christopher Pitt assertchris

View GitHub Profile
#!/bin/bash
name=$(date +%s)
cd ../
mkdir "temp_${name}"
cd "temp_${name}"
scrutinizer:
inherit: true
tools:
external_code_coverage: true
checks:
php:
code_rating: true
duplication: true
filter:
paths: [src/*, tests/*]
<?php
interface Action
{
public function matches(array $message);
public function handle($inbox, array $message);
}
class TwitterAction implements Action
{
<?php
use Symfony\Component\Console\Output\StreamOutput;
$handle = fopen("php://output", "w");
$stream = new StreamOutput($handle);
Artisan::call("migrate", ["--path" => "Acme/Migration"], $stream);
<?php
function array_difference(array $first, array $second) {
return array_merge(
array_diff($first, $second),
array_diff($second, $first)
);
}
<?php
trait GreetName
{
/**
* @return array
*/
public function interfacesForGreetName()
{
return [HasGreeting::class, HasName::class];
❯ phpunit --coverage-html=report
PHPUnit 4.1.4 by Sebastian Bergmann.
Configuration read from /path/to/phpunit.xml
................................................................. 65 / 85 ( 76%)
....................
Time: 6.87 minutes, Memory: 116.25Mb
❯ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
- Installing illuminate/container (v4.2.8)
Loading from cache
- Installing michelf/php-markdown (1.4.1)
Loading from cache
<?php
/**
* @param $path
* @param $extension
*
* @return array
*/
function getFilesInPathWithExtension($path, $extension)
{
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
indent_style = space