public function getSubjectByName(string $subjectName): \SplSubject
    {
        if (!array_key_exists($subjectName, $this->subjectList)) {
            throw new Exception(
                'The subject '.$subjectName.' is not in the list.',
                self::ERR_SUBJECT_NAME_NOT_EXIST
            );
        }
        
        return $this->subjectList[$subjectName];
    }
public function getSubjectByName(string $subjectName): \SplSubject
    {
        if (!array_key_exists($subjectName, $this->subjectList)) {
            throw new Exception(
                'The subject '.$subjectName.' is not in the list.',
                self::ERR_SUBJECT_NAME_NOT_EXIST
            );
        }
        
        return $this->subjectList[$subjectName];
    }
public function getSubjectByName ( string $ subjectName ) : \ SplSubject { if ( ! array_key_exists ( $ subjectName , $ this -> subjectList ) ) { throw new Exception ( 'The subject ' . $ subjectName . ' is not in the list.' , self :: ERR_SUBJECT_NAME_NOT_EXIST ) ; } return $ this -> subjectList [ $ subjectName ] ; }
Obtain a subject object with this name

@param string $subjectName The name of the subject object

@return \SplSubject

@throws \Exception If the subject name not exist
Obtain a subject object with this name