This gist is about:
- https://twitter.com/taylorotwell/status/600680897550098432
- https://twitter.com/Ocramius/status/600705252539691008
Mainly:
function
cannot (should not) be used when side-effects occur
<?php | |
namespace BLAHBLAH\GraphLoader; | |
use Doctrine\Common\Persistence\Mapping\ClassMetadata; | |
use Doctrine\Common\Persistence\ObjectManager; | |
use Doctrine\Instantiator\Instantiator; | |
use BLAHBLAH\Exception\UnexpectedValueException; | |
final class ArrayObjectGraphLoader implements ArrayObjectGraphLoaderInterface |
<?php | |
class Product | |
{ | |
/** @ORM\Column @ORM\Id ... */ | |
private $id; | |
} |
This gist is about:
Mainly:
function
cannot (should not) be used when side-effects occur<?php | |
namespace FixturesStuff | |
use Doctrine\Common\DataFixtures\Purger\ORMPurger; | |
use Doctrine\ORM\EntityManagerInterface; | |
/** | |
* @TODO this has to go once we implement correct purging of entities | |
*/ |
<?php | |
namespace FixtureLoader; | |
use Doctrine\Common\Persistence\Mapping\ClassMetadata; | |
use Doctrine\Common\Persistence\ObjectManager; | |
use Doctrine\Instantiator\Instantiator; | |
class SimpleFixtureLoader | |
{ |
(function (exports) { | |
function EventBus() { | |
this.handlers = []; | |
} | |
EventBus.prototype.push = function (event) { | |
foreach (idx in this.handlers) { | |
if (this.handler[idx].canHandle(event)) { | |
this.handler[idx].handle(event); | |
} |
<?php | |
use doctrine\ORM\EntityManagerInterface; | |
$entityManager->transactional(function (EntityManagerInterface $entityManager) { | |
// first transaction | |
$entityManager->transactional(function () { | |
// nested transaction #1 | |
}); |
<?php | |
namespace ProxyManagerTest\Functional; | |
class Foo54b039119141f998026307 extends \ProxyManagerTestAsset\ClassWithCollidingPrivateInheritedProperties implements \ProxyManager\Proxy\GhostObjectInterface | |
{ | |
/** | |
* @var \Closure|null initializer responsible for generating the wrapped object | |
*/ |
<?php | |
namespace MyModule; | |
use Zend\ServiceManager\AbstractFactoryInterface; | |
use Zend\ServiceManager\ServiceLocatorInterface; | |
use Zend\Filter\Word\CamelCaseToUnderscore; | |
use Zend\Db\Resultset\HydratingResultSet; | |
use Zend\Stdlib\Hydrator\ClassMethods; | |
<div class="ngCellText" ng-class="col.colIndex()" style="padding-top:5px; padding-left:5px;"> | |
<span ng-cell-text> | |
{{console.log(row)}} | |
{{row.getProperty(col.id)}} | |
<button type="button" class="btn btn-sm btn-default" title="Edit peddler"> | |
<span class="glyphicon glyphicon-edit"></span> | |
</button> | |
<button type="button" class="btn btn-sm btn-default" title="Pricing forumulas" ng-click="viewPricingFormulas()"> | |
<span class="glyphicon glyphicon-usd"></span> |