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 | |
/* | |
* Since we don't have method over loading, shouldn't this be possible? | |
*/ | |
interface Object1Saver | |
{ | |
public function save(Object1 $obj); | |
} |
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 | |
/* | |
* Say you have an entity class which has no need to expose its internal data | |
* fields in the business layer like so: | |
*/ | |
class LibraryBook | |
{ | |
/** @var string */ |
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 | |
interface Item | |
{ | |
public function runAction(); | |
} | |
interface SomeCollection | |
{ | |
public function foreachItem(callable $fn); |
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
// Given | |
(defn make-customer [name email] | |
{:name name, :email email}) | |
// Examples | |
(def customer1 (make-customer "Tom" "email@address.com")) | |
// vs... |
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
Feature: View a widget | |
# Approach 1 | |
Scenario: View a widget's attributes | |
Given there is a widget named "the widget" with attribute1 "attr 1 val" and attribute2 "attr 2 val" and attribute3 "attr 3 val" | |
Then the widget named "the widget" should have attribute1 value "attr 1 val" and attribute2 value "attr 2 val" and attribute3 "attr 3 val" | |
# Approach 2 | |
Scenario: View a widget's attributes | |
Given there is a widget named "the widget" |
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 | |
// An example of navigating HAL enabled JSON APIs in Behat tests | |
// using https://github.com/tomphp/hal-client | |
use TomPHP\HalClient\Client; | |
class APIContext | |
{ | |
// ... |
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 | |
/* | |
* This is the setup required to make an annotation builder able to load | |
* a hydrator from annotation via the HydratorManager. | |
*/ | |
$annotationBuilder = new \Zend\Form\Annotation\AnnotationBuilder(); | |
$factory = new \Zend\Form\Factory($serviceLocator->get('FormElementManager')); | |
$annotationBuilder->setFormFactory($factory); |
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 | |
class BaseClass | |
{ | |
private $var; | |
public function __construct($injector) | |
{ | |
$this->var = $injector; | |
} |
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 | |
public function getFileScanner($fileName) | |
{ | |
if ($this->fileScanner && $this->fileScanner->getFile() == $fileName) { | |
return $this->fileScanner; | |
} | |
$this->fileScanner = new FileScanner($fileName); |
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 Test; | |
class MyClass | |
{ | |
public function someFunction( | |
MyType $param1, | |
LongTypeName $param2, | |
array $param3 |
OlderNewer