Skip to content

Instantly share code, notes, and snippets.

View brettsantore's full-sized avatar

Brett Santore brettsantore

  • KBRA
  • North Wales, Pa
View GitHub Profile
@brettsantore
brettsantore / phpcs.xml
Created June 21, 2018 14:18
Config Files
<?xml version="1.0"?>
<ruleset name="Custom Standard" namespace="Santore">
<file>./src</file>
<file>./tests</file>
<rule ref="ZEND"/>
<!-- Ignore Camel Case Names In Tests-->
<rule ref="PSR1.Methods.CamelCapsMethodName">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
@brettsantore
brettsantore / gist:32f40f69ea4bbcf55417cf7758e9c049
Created July 6, 2017 18:13
Removing unnecessary else statements
The follwing code can be in many place, functions, methods, or a single page script.
I'd like to put these to pieces of code side by side, so you can have a look and hopefully we can agree,
the 2nd version is more readable.
The first example is a snippet that expects something to be true, and then acts on that assertion.
The code would work, but there is a hanging detail at the bottom, that I think should be cleaned up.
If the expectation was false, were going to enter the else protion, and do something there.
if($expectation == true) {