<commit_before><?php
require 'vendor/autoload.php';

use pattern\observerPattern\login;

interface Observer {
	public  function handle();
}

class EmailNotifier implements Observer {

	public function handle()
	{
		var_dump('send some emails out');
	}
}

class  fileLogger implements Observer {

	public function handle()
	{
		var_dump('log some file data');
	}
}

$login = new Login;
$login->attach([new EmailNotifier, new fileLogger]);

$login->fire();<commit_msg>add few more dummy classes to futher illustrate that we can follow the Open Close principle (SOLID) by creating an additional class rather then mod orginial class (Login.php)<commit_after><?php
require 'vendor/autoload.php';

use pattern\observerPattern\login;
use pattern\observerPattern\Observer;

class EmailNotifier implements Observer {

	public function handle()
	{
		var_dump('send some emails out');
	}
}

class  fileLogger implements Observer {

	public function handle()
	{
		var_dump('log some file data');
	}
}

class  adminNotify implements Observer {

	public function handle()
	{
		var_dump('notify admin that new users has login.');
	}
}

class  someOtherClass implements Observer {

	public function handle()
	{
		var_dump('Do something....');
	}
}

//lets just say this is our factory class below :)
$login = new Login;
$login->attach([new EmailNotifier, new fileLogger]);

$login->attach(new someOtherClass())->attach(new adminNotify());
$login->fire();
{'fraction_non_alphanumeric': 0.11404728789986092, 'fraction_numerical': 0.0, 'mean_word_length': 4.849593495934959, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4502137', 'n_tokens_mistral': 442, 'n_tokens_neox': 419, 'n_words': 138}