Skip to content

Instantly share code, notes, and snippets.

View iambrianreich's full-sized avatar
🏠
Working from home

Brian Reich iambrianreich

🏠
Working from home
View GitHub Profile
@iambrianreich
iambrianreich / Status.php
Created October 20, 2017 04:25
PHP 7 Assertsions
<?php
/**
* This file contains the Catalyst\OrderLine\Status class.
*
* PHP Version 7.1
*
* @category Catalyst
* @package Catalyst
* @subpackage OrderLine
@iambrianreich
iambrianreich / Divider.php
Last active October 8, 2017 02:15
Testing a Trivial Exception Scenario in PHPUnit
<?php
namespace RWC\Math;
class Divider
{
public function divide(float $divided, float $divisor) : float
{
if($divisor == 0)
@iambrianreich
iambrianreich / google-reviews.php
Last active November 12, 2021 21:02
Use the Google Places API to render a Google My Business reviews badge on a WordPress site using shortcodes.
<?php /** @noinspection SpellCheckingInspection */
/**
* This file contains the WordPress code for rendering a Google Reviews badge.
*
* Usage:
*
* 1. Create a Google API Console account if you have not already done so.
* 2. Register for the Google Places API.
* 3. Create an API key.
* 4. Ensure that the API key can be used from wherever this script will execute