Skip to content

Instantly share code, notes, and snippets.

@index0h
Created January 24, 2017 14:03
Show Gist options
  • Save index0h/4651aeb0c9948d6ebd2b4274fb404970 to your computer and use it in GitHub Desktop.
Save index0h/4651aeb0c9948d6ebd2b4274fb404970 to your computer and use it in GitHub Desktop.
TypedArrayCollection.php
<?php
class TypedArrayCollection
{
/** @var string */
private $class;
/** @var object[] */
private $array;
/**
* @param string $class
* @param object[] $array
*/
public function __construct(string $class, array $array)
{
// Check class and array
$this->class = $class;
$this->array = $array;
}
/**
* @param string $class
* @return bool
*/
public function equals(string $class): bool
{
return $this->class == $class;
}
/**
* @return string
*/
public function getClass(): string
{
return $this->class;
}
/**
* @return array
*/
public function getArray(): array
{
return $this->array;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment