Skip to content

Instantly share code, notes, and snippets.

View amacgregor's full-sized avatar
:shipit:
Working on Side Projects

Allan MacGregor amacgregor

:shipit:
Working on Side Projects
View GitHub Profile
@amacgregor
amacgregor / Command.php
Created December 16, 2014 14:29
L4shell patched
<?php
namespace Netson\L4shell;
use Config;
use Log;
use File;
class Command {
/**
@amacgregor
amacgregor / score_data.json
Last active August 29, 2015 14:12
Example score data from a triplecheck.io build
{
"app\/code\/community\/Kodematix\/Inquiry\/Block\/Inquiry.php":{
"phpmetrics":{
"instability":-1,
"lloc":5,
"maintainability":"3.89",
"nocchecks":5
},
"phpcs":{
"errors":5,
{
"files":{
"app\/code\/community\/Kodematix\/Inquiry\/Block\/Inquiry.php":{
"phpmetrics":{
"metrics":{
"loc":48,
"logicalLoc":10,
"volume":529.1,
"length":104,
"vocabulary":34,
input {
file {
type => "magento-exception"
path => "/path/to/magento/www/var/log/exception.log"
codec => multiline {
pattern => "^%{TIMESTAMP_ISO8601}"
negate => true
what => previous
}
}
{
"files":{
"app\/code\/local\/Igex\/StoreLocator\/Block\/Adminhtml\/Import\/Form.php":{
"phpmetrics":{
"metrics":{
"loc":31,
"logicalLoc":8,
"volume":364.35,
"length":75,
"vocabulary":29,
<?php
/**
* @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
*/
namespace Magento\Wishlist\Helper;
class Rss extends \Magento\Wishlist\Helper\Data
{
/**
/**
* Retrieve Customer instance
*
* @return \Magento\Customer\Api\Data\CustomerInterface
*/
public function getCustomer()
{
if (is_null($this->_customer)) {
$params = $this->urlDecoder->decode($this->_getRequest()->getParam('data'));
<?php
class NotificationManager {
public function sendNotification($type = '', $data)
{
switch($type){
case "email":
$notification = new EmailService();
$notification->setTo($data['to']);
<?php
interface NotificationInterface {
public function setData($data);
public function sendNotification();
}
<?php
interface NotificationInterface {
public function setData($data);
public function sendNotification();
}
class TwitterAdapter implements NotificationInterface
{
protected $_data;