Vinelab\Minion\Dictionary::make PHP Method

make() public static method

Get a new dictionary with the given attributes.
public static make ( mixed $attributes ) : Dictionary
$attributes mixed
return Dictionary
    public static function make($attributes)
    {
        if (!is_array($attributes)) {
            $attributes = (array) $attributes;
        }
        return new static($attributes);
    }

Usage Example

Example #1
0
 public function test_allows_checking_attributes()
 {
     $data = ['lime' => 'tree', 'cherry'];
     $dict = Dictionary::make($data);
     $this->assertTrue(isset($dict->lime));
     $this->assertFalse(isset($dict->nooooppeee));
     $this->assertTrue(empty($dict->nogood));
     $this->assertFalse(empty($dict->lime));
     $this->assertNull($dict->nogood);
     $this->assertNull($dict->cherry);
 }
All Usage Examples Of Vinelab\Minion\Dictionary::make