Skip to content

Instantly share code, notes, and snippets.

Avatar

Matthias Gutjahr mattsches

View GitHub Profile
View laravel facades discussion.md

Found an example there is a thing in laravel called FormRequest. Sometimes, I need extra validation. So I need to use some service there somehow. What options I have

  1. facade
  2. service locator via app() global function
  3. I also have instance of container there via $this->container

which one is the best here? I suppose instance of container

I can't do constructor injection. Why? Because for me, it seams that there are too many arguments on the __construct method

@mattsches
mattsches / layered.inc.php
Last active Dec 20, 2015 — forked from onli/layered.inc.php
Added charset to connection adapter
View layered.inc.php
<?php
use Zend\Db\Sql\Sql;
use Zend\Db\Sql\Select;
use Zend\Db\Adapter\Adapter;
$result = null;
/**
* Tells the DB Layer to start a DB transaction.
*
* @access public
@mattsches
mattsches / test.php
Created Feb 22, 2012 — forked from rodneyrehm/test.php
PHPGangsta: Doppelte Array-Einträge entfernen
View test.php
<?php
if (extension_loaded('xdebug')) {
echo "WARNING: xdebug is enabled\n";
}
function _count()
{
$array = array(1, 5, 8, 'Michael', 5, 4, 9, 'Martin', 18, 12, 'Michael', 4, 12);