Skip to content

Instantly share code, notes, and snippets.

View tiraeth's full-sized avatar

Marcin Chwedziak tiraeth

View GitHub Profile
diff --git a/library/Mockery/Container.php b/library/Mockery/Container.php
index 0d7bdf2..a5db81f 100644
--- a/library/Mockery/Container.php
+++ b/library/Mockery/Container.php
@@ -200,6 +200,10 @@ class Container
$constructorArgs = array();
}
+ if (empty($partialMethods)) {
+ $builder->addBlackListedMethod("__destruct");
@tiraeth
tiraeth / patch.diff
Created July 12, 2014 22:27
padraic/mockery: fix __construct and __destruct behaviour
diff --git a/library/Mockery/Container.php b/library/Mockery/Container.php
index 0d7bdf2..f412c5b 100644
--- a/library/Mockery/Container.php
+++ b/library/Mockery/Container.php
@@ -193,7 +193,7 @@ class Container
$builder->addBlackListedMethods($blocks);
if (!is_null($constructorArgs)) {
- $builder->addBlackListedMethod("__construct"); // we need to pass through
+ $builder->addBlackListedMethods(array("__construct", "__destruct")); // we need to pass through
@tiraeth
tiraeth / composer.json
Created October 30, 2013 17:51
Example usage of mach/silex-rest
{
"require": {
"mach/silex-rest": "dev-master"
},
"autoload": {
"psr-0": { "": "src/" }
}
}
@tiraeth
tiraeth / PostgreSqlPlatform.php
Created October 2, 2013 10:29
How to override default platform in Doctrine2 with Symfony2. Example: Force RESTART IDENTITY for TRUNCATE in PostgreSQL when used in "test" environment. This will help you with functional tests as you will always have the same ids.
<?php
namespace Acme\DBAL\Platforms;
use Doctrine\DBAL\Platforms\PostgreSqlPlatform as DoctrinePostgreSqlPlatform;
class PostgreSqlPlatform extends DoctrinePostgreSqlPlatform
{
public function getTruncateTableSQL($tableName, $cascade = false)
{
<?php
function mbank_zakoduj_haslo($haslo)
{
$mapa = array(
'a' => 'n',
'b' => 'o',
'c' => 'p',
'd' => 'q',
'e' => 'r',
@tiraeth
tiraeth / gist:5531366
Last active December 17, 2015 01:49 — forked from ahilles107/gist:5531359
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
<?php
namespace Symfony\Component\DependencyInjection;
interface ParameterBagContainerInterface
{
public function getParameterBag();
public function isFrozen();
}
@tiraeth
tiraeth / solution1.erb
Last active December 15, 2015 13:59 — forked from SkyKOG/gist:5261972
<link rel="stylesheet" href="//cdn.oesmith.co.uk/morris-0.4.1.min.css">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
<script src="//cdn.oesmith.co.uk/morris-0.4.1.min.js"></script>
<h1>Doctors by Specialisations</h1>
<br><br>
#!/bin/bash
OUT=`git log -n 1 --oneline | grep [CI]`
if [ $OUT = "" ]; then
# Do not build a test!
else
# Do build a test!
fi
@tiraeth
tiraeth / gist:4139118
Created November 24, 2012 10:29
Morris.Gauge
class Morris.Gauge extends Morris.EventEmitter
defaults:
stroke: "#f39d11"
strokeWidth: 28
duration: 500
easing: "<"
maxValue: 100
initialValue: 0
constructor: (options) ->