get_slug(); $this->sources[ $slug ] = $source; } public function has_source( $slug ) { return isset( $this->sources[ $slug ] ); } /** * @param string $slug * * @return ALLSI_Image_Source|null */ public function get_source( $slug ) { return $this->has_source( $slug ) ? $this->sources[ $slug ] : null; } /** * Return all registered sources. Mainly used for debugging/tests. * * @return ALLSI_Image_Source[] */ public function all() { return $this->sources; } }