This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace MyApp\MyBundle\Controller; | |
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
use NineThousand\Jobqueue\Job\StandardJob as Job; | |
use NineThousand\Bundle\NineThousandJobqueueBundle\Vendor\Doctrine\Adapter\Job\Symfony2DoctrineJobAdapter as JobAdapter; | |
use NineThousand\Bundle\NineThousandJobqueueBundle\Entity\Job as JobEntity; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace CollegeDegrees\EdudirectBundle\Command\Util; | |
use CollegeDegrees\EdudirectBundle\Entity\Host; | |
use CollegeDegrees\EdudirectBundle\Entity\Login; | |
use CollegeDegrees\EdudirectBundle\Entity\Publishers; | |
use Doctrine\ORM\Query; | |
use Symfony\Component\Yaml\Yaml; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
#Tests/Service/CustomerPurchaseControlTest.php | |
namespace CodeMeme\CommerceBundle\Tests\Service; | |
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; | |
use CodeMeme\CommerceBundle\Tests\Fixtures\Job\LoadJobQueueControlTestData; | |
use CodeMeme\CommerceBundle\Model\Cart\ActiveCart; | |
use CodeMeme\CommerceBundle\Entity\Purchase; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** @MappedSuperclass */ | |
class MagicMethods | |
{ | |
public function __get($name) { | |
return $this->{strtolower($name)}; | |
} | |
public function __set($name, $value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//how to merge custom options into your client upon instantiation | |
$options = array( | |
'server' => 'http://staging.collegedegrees.com', | |
); | |
$client = new cdClient($options); | |
$client->request(); | |
$client->initHeaders(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
We've built in the ability to only select certain content by using CSS selectors. This may yield unexpected results if not used carefully and is subject to change. for example, you may wish to only select the body head and form, and you may wish to store those things in variables so you can mix in your own content. Here is how you'd do something like that: | |
*/ | |
include('library.php'); | |
$client = new cdClient(); | |
$client->request(); | |
$client->initHeaders(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//a list of unknown size | |
$bars=array(); | |
// I want to walk through the array and take the first one that isn't empty | |
//this code looks wierd but it's a compromise. | |
foreach ($bars as $bar) { if ($foo = $bar) { break 1; } | |
//this is what i wanted to do | |
while (!$foo = current($bars)) { | |
next($bars); |