Skip to content

Instantly share code, notes, and snippets.

View PurpleBooth's full-sized avatar

Billie Thompson PurpleBooth

View GitHub Profile
#!/usr/bin/env bash
composer validate
### Previous version
# php -r "\$lock = json_decode(file_get_contents('composer.lock'))->hash; \$json = md5(file_get_contents('composer.json')); if (\$lock !== \$json) { echo \"Lock file out of date\\n\"; exit(1); } echo \"Lock file up to date\\n\"; exit(0);"
cache:
directories:
- $HOME/.composer/cache/
package main
import (
"net/http"
"fmt"
"encoding/json"
)
type Message struct {
Name string
@PurpleBooth
PurpleBooth / composer.phar
Last active February 13, 2017 23:14
I am on a system with docker but without PHP
#!/bin/bash
set -euo pipefail
if [ ! -d "$HOME/.composer" ]; then
mkdir "$HOME/.composer"
touch "$HOME/.composer/.lastpull"
fi
if test find "$HOME/.composer/" -name ".lastpull" -and -mtime +7 > /dev/null 2>&1 ; then
@PurpleBooth
PurpleBooth / container_shell_Dockerfile
Last active February 25, 2021 16:36
A sensible PHP in Docker env
FROM php:5-cli
RUN apt-get update \
&& apt-get install -y \
git software-properties-common python-software-properties libicu-dev zlib1g-dev curl subversion bash \
&& rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-configure zip \
&& docker-php-ext-install zip \
&& docker-php-ext-configure intl \
&& docker-php-ext-install intl \
<?php
return PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules(array(
'@Symfony' => true,
'@Symfony:risky' => true,
'array_syntax' => array('syntax' => 'short'),
'dir_constant' => true,
'heredoc_to_nowdoc' => true,
<?php
class MyExampleService()
{
private $entityManager;
public function __construct(EntityManager $entityManager, OtherDependencies $dependencyOne)
{
$this->entityManager = $entityManager;
}
<?php
return PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules([
'@Symfony' => true,
'@Symfony:risky' => true,
'array_syntax' => ['syntax' => 'short'],
'dir_constant' => true,
'heredoc_to_nowdoc' => true,
<?php
return PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules(
[
'@Symfony' => true,
'@Symfony:risky' => true,
'array_syntax' => ['syntax' => 'short'],
'declare_strict_types' => true,
#/usr/bin/env bash
# ... Other Stuff Here ...
###############################################################################
# MOTD #
###############################################################################
(cd "${CODE_PATH}" && git standup -g)
echo