collection = new MappingCollection(); } public function register(MappingRule $rule): void { $this->collection->add($rule); } public function getRules(): MappingCollection { return $this->collection; } }